Single Species private MySQL
Ensembl has just made it even easier to access genome data in the cloud. We are pleased to announce the availability of pre-configured Ensembl MySQL EC2 cloud images. These are pre-built images that allow you to run your own private single species MySQL instances on EC2, the full list is here. There are images for each of our species; just start one up and connect with the API (or mysql client) just as you would with ensembldb, or useastdb – except this MySQL server you’ll have for exclusive use. You’ll also have full root permissions on the instance so you can configure, tweak and restart the MySQL server as you wish.
Experienced users of Amazon EC2 need only to skip to the full list of AMIs on the ensembl website and when launching to ensure security group access to port 5306 on your instance.
If you’re not already familiar with Amazon EC2 and would like to get started with ensembl in the cloud then the following set of brief instructions should be enough get you going. The steps are:
- Set up your Amazon EC2 Account
- Instantiate the Ensembl Image
- Connect to the instance
Signing up for your amazon EC2 account is simple if you don’t already have one. Just go to http://aws.amazon.com/ec2 and click Sign Up for Amazon EC2. Then follow the on screen instructions.
Launching an instance is just as simple when you use the amazon EC2 launch wizard. The amazon AWS documentation describes the process expertly, and can be found here. To launch the Ensembl Amazon Machine Image(AMI) follow the documentation beginning at Step 1 to launch the wizard. We shall digress at step 2, “choosing an AMI” where instead select an Ensembl AMI from the list here. As an example, we select Homo sapiens with id ami-b0fb5
Ensure that you are in the useast region (which is the default) and in the launcher wizard select the community AMI tab (the green arrow in the figure below) and paste in ami-dccb0fb5 to the box incated with the red arrow and underlined in red.
After clicking Select, for best performance choose the Large(m1.large, 7.5GB) instance type from the dropdown, although you may also choose the smaller Micro(t1.micro) type which would incur a lower cost per hour http://aws.amazon.com/ec2/#pricing
Click Continue and follow on with steps 3 & 4 from the amazon docs to create a key-pair. Next create a security group (firewall rule) that will allow access to our MySQL instance. The process is described in detail as step 5 of the amazon docs, with the exception that we require only ports 22 for ssh access and port 5306 to allow access to the MySQL server (don’t forget to click Apply Rule Changes).
Take particular note on the point of caution from the docs regarding restricting access to specific IP addresses.
The quick-start security group enables all IP addresses to access your instance over the specified ports (e.g., SSH). This is acceptable for the short exercise in this tutorial, but it’s unsafe for production environments. In production, you’ll authorize only a specific IP address or range of addresses to access your instance
Finally launch the instance as described in step 6 and record the public DNSname of your new server.
If all has been successful you will now have a private AWS instance running a MySQL server with a single Ensembl species, which is Homo sapiens in the case of this exercise.
Connecting to the instance
To connect to the instance you do so as:
mysql <PUBLIC_DNS_NAME> -u anonymous -P5306
If you cannot connect, check that the instance is running and also review that the security group settings are correct, both ports 22 and 5306 need to be open.
You may ssh directly to the instance with the username ‘ensembl’ as described here.
ssh -i <YOUR_KEYPAIR> ensembl@<PUBLIC_DNS_NAME>
The Ensembl MySQL AMI comes pre-installed and configured with the current perl API and you can run your scripts against Ensembl from within this instance, but targeting MySQL on localhost:5306 rather than the public DNS name.
Amazon bill by the hour so don’t forget to terminate the instance when you have finished.
Full details of Amazon AWS costs and charges are here http://aws.amazon.com/ec2/#pricing and be aware that you are billed for both storage, and EC2 time, it is your responsibility to monitor your usage.