Aspera On Demand: Attaching an EBS volume for MySQL database


This article provides a basic set of instructions on how to modify your Aspera on Demand (AoD) image to utilize EBS storage for use with the Console MySQL database.  The default AoD image uses the local disk for storing the MySQL database.  As of the AOD 3.4 release, the local disk is 20 GB, which is plenty large for many customers.  In some cases this is not sufficient for the amount of data that needs to be stored in the MySQL database.  By adding on EBS storage, you can provide as much storage as needed for the MySQL database.  The EBS block storage is persistent, so the data is be preserved even if an instance is shutdown.



This article uses the Server on Demand as an example, and assumes that you are prepared with the following:

  1. Your Aspera server on Demand is running and entitled
  2. You have a basic familiarity with AWS management console
  3. You have your SSH key and are able to SSH to your Aspera Server on Demand

Step 1:  Create EBS volume

Log into your AWS console, and navigate to the EC2 dashboard in the region where your Aspera on Demand is running.  Then select Elastic Block Store Volumes from the left hand navigation bar.   In screenshot 1 below, you can see the Volumes menu option and the AWS region highlighted.   In screenshot 2 you can see the parameters that I choose when creating a new EBS volume.  Since this volume will be used for the Aspera Console database, and we are expecting heavy I/O, I have chosen to use the "Provisioned IOPS" option. 


Figure 1:  Elastic Block Storage Volumes menu for the Northern California region



Figure 2:  Creating a new EBS volume


Step 2:  Attach EBS volume to Aspera on Demand EC2 instance

Once the EBS volume is available (as indicated by the 'state' status), select it and choose 'Attach Volume' from the drop down Actions menu item.  In screenshot 3 you can see the 'Attach Volume' memory option and the State of the newly created EBS volume.   The following dialogue box will present you with the available EC2 instances to which you can attach this volume.  Select your instance, as shown in screenshot 4.  Note that this dialogue box also tells you what device the volume is available under in Linux.  In my case, it is /dev/sdf.



Screenshot #3: Attach EBS volume menu option



Screenshot #4:  Attach volume dialogue box.


Step 3:  Mount new volume from within Aspera on Demand

Next we need to login to the Aspera on Demand Server, create a new file system and mount the storage.   If you are not familiar with how to login to your Aspera on Demand server, please refer to this article.  Once you are logged in, create the file system of your choice.  In my example, I use xfs, to be consistent with the rest of the platform.


You can view the newly created partition as follows (xvdf in my example)


# cat /proc/partitions
major minor #blocks name
202 1 20971520 xvda1
202 16 440366080 xvdb
202 32 440366080 xvdc
9 0 880731136 md0
202 80 104857600 xvdf


Creating the file system:

 # mkfs.xfs -f -l lazy-count=0 /dev/xvdf
meta-data=/dev/xvdf isize=256 agcount=4, agsize=6553600 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=26214400, imaxpct=25
= sunit=0 swidth=0 blks
naming = version 2 bsize=4096 ascii-ci=0
log = internal log bsize=4096 blocks=12800, version=2
= sectsz=512 sunit=0 blks, lazy-count=0
realtime = none extsz=4096 blocks=0, rtextents=0


Editing /etc/fstab

#vim /etc/fstab
/dev/xvda1 / xfs defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/md/localhost:ephemeral /mnt/ephemeral xfs defaults 0 0
/mnt/ephemeral/ swapfile1 swap swap default 0 0
/dev/xvdf /mnt/ebs xfs defaults 0 0


Mounting the new file system:

# mkdir /mnt/ebs
# mount -a
# df -h /mnt/ebs
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvdf             100G  33M 100G   1% /mnt/ebs




Step 4:  Migrate the Console database 

In this last step, we need to move the MySQL database to the new partition.  In order to accomplish this, we need to stop all access to the database, move the database itself, and then restart the services.


Shut down the console services:


# asctl all:stop


Copy the MySQL database to the new location


# cd /opt/aspera/common/mysql/ 
# cp -avr data /mnt/ebs 
# mv data data.backup 
# ln -s /mnt/ebs/data /opt/aspera/common/mysql/data


Restart the console services


# asctl all:start


Once this step is complete, log into the Console and confirm that it is working as expected.









Powered by Zendesk