Day1 3 Lab
Day1 3 Lab
1. Create an Amazon EC2 t2.micro instance running the most recent version of
Amazon Linux.
You will use this EC2 instance as a SQL client to access your RDS/MySQL
instance.
Follow the documentation at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
2. Create and use an EC2 Security Group that allows inbound access as follows:
• SSH using TCP on port 22 from Anywhere* (0.0.0.0/0)
• MYSQL/Aurora using TCP on port 3306 from MyIP
• *You might get an automated warning that your EC2 instance is “open
to the world”, because we’re not limiting the source IP range for SSH.
This is expected. In a production system, as a security best practice, you
must only provide a limited IP range for allowed SSH access. For this lab
however, you can disregard the warning.
• Make a note of the MyIP address. We’ll need to update the RDS
Security Group later to allow inbound access from this IP address.
Page 1 of 6
3. Access the Linux console on the t2.micro instance
See documentation at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html
Page 2 of 6
• Once the RDS instance is available, find your instance’s DNS endpoint.
We’ll use this endpoint to connect the MySQL client to your RDS
instance.
i. On the AWS Console, in the AWS Services box, type ‘RDS’ and
press enter.
Page 3 of 6
iv. Scroll down and find your endpoint name. You will need it later!
Note: When using the endpoint name, you usually should not use the
port extension (:3306), just the name.
6. Verify you can access your RDS/MySQL instance from your EC2 instance:
$ mysql –h <mysql endpoint> -u <user name> -p
Example:
$ mysql -h sql-lab.cxpjiluqq0c9.us-west-2.rds.amazonaws.com -u awsuser -p
Enter password:
Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.
mysql>
Note: if you cannot connect to your RDS/MySQL instance, verify that you
have updated the RDS Security Group to allow traffic from your EC2
instance’s IP address.
Page 4 of 6
7. Download and Prepare Landsat scenes
See documentation at
https://aws.amazon.com/public-data-sets/landsat/
From your EC2 instance, download the Landsat scenes
$ wget https://landsat-pds.s3.amazonaws.com/c1/L8/scene_list.gz
• Unzip the scene list
$ gunzip scene_list.gz
• Trim the list to the last 250,000 scenes
$ cp scene_list scene_list.orig
$ tail -n 250000 scene_list.orig > scene_list
Page 5 of 6
• This generates a list of all the satellite images during the last year which
have less than 50% cloud cover
• Note how long it takes to get an answer
10. Experiment with RDS features
• Stop the database and restart it
• Enable Multi-AZ for failover
• Take a snapshot
• Review the various monitoring metrics available
Page 6 of 6