This article provides step by step instructions on how to run a MySQL instance with Zadara Storage at AWS
It assumes a Zadara account and a VPSA have already been created.
If you need to create a Zadara account, please visit the link below:
Once the Zadara account and VPSA are created, it is time to create a MySQL environment.
Launch a MySQL instance from the AWS market place
- Login into AWS cloud console
- Go to the AWS market place and find the AMI with pre installed MySQL from Turnkey Linux
- Click Continue and click Accept Terms
- Click Launch with EC2 Console tab
- choose the AMI in US East can click launch with EC2 console
- you will see the Request Instances Wizard, click continue to choose the AMI
- At Intance Details, choose the size of the instance and the VPC and subnet
- Click continue until you reach the “Create Key Pair”. Choose the right key pair
- Click continue and choose your security group
- Review the data and click Launch
Mount VPSA volumes to a MySQL instance:
- Connect to your instance via ssh (if needed assign elastic IP to connect from outside the cloud)
- update your version #apt-get update
- Install iscsi initiator #apt-get install open-iscsi
- Restart iscsi service # /etc/init.d/open-iscsi restart
- Check the IQN of the initiator #cat /etc/iscsi/initiatorname.iscsi
- At this point, iSCSI initiator is installed. Next, in order to attach VPSA volumes, you need to use iscsiadm to discover the target and add the CHAP Auth.
- Go to the VPSA GUI/ Servers and choose 'Automatic' from the 'Add' pulldown at the top.
- Select Linux and iSCSI (you will see the instructions you need to run on the VM to connect to VPSA)
- Go back to the MySQL server. Copy/paste the wget command, and run the chmod and the vpsa_linux commands.
- At this point, if you hit in the VPSA GUI Servers /Refresh, you should see the new linux server listed
- Go to VPSA GUI/Volumes. Create a new block volume and attach it to the MySQL server.
- On the MySQL server, you should see the new device by typing #ls -l /dev/disk/by-path
- Create a file system: #mkfs /dev/sda ( Change 'sda' to whichever device the iSCSI daemon has created, after the volume has been attached to the server. The 'dmesg' command will also show this )
- Create a directory for data: #mkdir /mnt/data
- Mount the new file system: #mount /dev/sda /mnt/data
Configure MySQL to point to VPSA volume
- Stop my sql service # /etc/init.d/mysql stop
- Edit /etc/mysql/my.cnf file and look for the entry for “datadir”, and change the path (which should be "/var/lib/mysql") to the new data directory (/mnt/data).
- restart mysql # /etc/init.d/mysql restart