Giter Site home page Giter Site logo

awstpeworkshop-20180921-rds-aurora's Introduction

AWSTPEWorkshop-20180921-RDS-AURORA

For this workshop, we introduce the main feature with Aurora, also combinded with RDS-MySQL. It helps audience to understand the difference between Aurora and My-SQL. We also talk about the Read-Replica setting, how we convert or migrate our database from RDS-MySQL to Aurora


Step 1:

  • Switch Region on the AWS console, a drag down menu near right-up corner. Pick one region close to you.

Step 2: Create a Aurora DB (Serverless)

  • AWS Console > Services > RDS > Create Database > Select Enging > Amazon Aurora

AWS Workshop Series - createrdsaurora

  • We go through latest type "Serverless" for our workshop first

AWS Workshop Series - auroraserverless

  • We go through latest type "Serverless" for our workshop first, and setup the identifer, DB user, and DB Password.

AWS Workshop Series - inputdbuserpassword

  • Next step, we need to setup the Resource Allocation for your Aurora Serverless.

AWS Workshop Series - auroraserverlesscapacity

  • Select the Parameter Group for your database instance.

AWS Workshop Series - pickupparametergroup

  • Select DB VPC and Subnet Group for network setting.

AWS Workshop Series - dbsubnetgroup


Step 3:

  • Check if you already have a EC2 Key pair in your selected region.

  • If not, create one through AWS Console > EC2 > Key Pairs > Create Key Pair.

  • Remember to download the private key(.pem) and well saved.

  • In usual, we will move it into ~/.ssh/ sub-folder in your home directory.

  • To make it secure, remeber to change the privilege with command chmod 0400 XXXXX.pem

  • If you are windows user, and you should download putty.exe and puttygen.exe from Here. And also check the document Here if you don't know how to convert .pem to .ppk


Step 4:

  • Launch a new EC2 instance to operate your database in VPC
  • **AWS Console > Services > EC2 > Launch Instance **
  • Select Amazon Linux 2 with Free tier eligible label, with proper instance type (ex: t2.micro / t3.micro)
  • Locate this instance in the same VPC, with public IP attached and SSH security group granted.
  • set the userdata with following content
#!/bin/sh
yum install mysql
  • Connect to your EC2, and run the following command to test your database is alive.
> mysql -h YOUR-AURORA-ENDPOINT -u YOUR-AURORA-USER -p

Step 5:

  • Practice how to take a DB Snapshot and restore to a new instance/cluster
  • AWS Console > Services > RDS > Cluster
  • Select Correct DB which you created in Step2 > Actions > Take snapshot
  • Give a name to this snap shot

AWS Workshop Series - dbbackuprestore


Step 6:

Restore a snapshot to a new Instance

  • AWS Console > Services > RDS > Snapshots
  • Select Correct Snapshot you created in Step5 > Actions > Restore Snapshot
  • Pick Provisioned this time, and enable the Back Track

AWS Workshop Series - aurorabacktrack


Step 7:

  • Create a new RDS-MySQL Cluster with Multi-AZ setting
  • AWS Console > Services > RDS > Instances
  • Create Instance > Select DB Engine as MySQL
  • Pick Dev/Test - MySQL, and go next step
  • Click Multi-AZ and set the identifer, account and password.
  • Check the Failover feature, and reboot feature

Step 8:

  • Check ReadReplica on your RDS instance

AWS Workshop Series - replicapromote

  • Start from the MySQL Instance you created at Step7 > Instance Actions
  • You can create a MySQL ReadReplica
  • You can also create an Aurora ReadReplica, we choose this one

AWS Workshop Series - aurorareplica

  • Once your reaplica is ready, please check the Instance list, and you will find "Promote Read Replica" Feature now is available. This feature can help you to clone a latest database for branch, testing and verification purpose.

AWS Workshop Series - promotereplica


Note:
We have setup our first Aurora Instance as Serverless mode, 
some of you might already found that, you cannot find your db in "Instance List". 
We have set the timer to 5 minutes as default, if your serverless db has no access in last 5 minutes, 
it will going into sleep mode right away.

Try to connect your database through your EC2 again, and it will back to live right away.

Workshop Challenge:

Try to edit the Parameter Group for more advanced setting

  • AWS Console > Services > RDS > Parameter Group > Create Parameter Group

AWS Workshop Series - parametergroup

  • Give a proper name, and select correct group family.
  • Click your parameter group > Edit Parameter
  • Setup the binlog_format anything but OFF
  • Create a mysql-slave on your EC2, set the master as your RDS server.

After Workshop

  1. Remember to delete the EC2, all the RDS and Aurora Instance, and check those snapshot we created in workshop.

awstpeworkshop-20180921-rds-aurora's People

Contributors

juntinyeh avatar

Watchers

 avatar  avatar

Forkers

awshktsa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.