1

Our current server consisting of an 2x EC2 instances and RDS (Read/Write) database is in Mumbai Region. However I would like to copy everything (2x EC2 & RDS (R/W)) across to Sydney, and other to other regions.

Ideally I would like to replicate the contents in those instances as well.

Does anyone know a quick and easy way of doing this?


Edit 25/01/2019:

However I would like to copy everything including what ever is inside the instances (2x EC2s and the RDSs)


Edit 29/01/2019: The purpose is to "scale/expand out". I want to have the same infrastructure replicated 1-to-1 (exactly/identically) across various regions.

3kstc
  • 1,871
  • 3
  • 29
  • 53

3 Answers3

0

It is simple! - For EC2 - you need to create an AMI of those instances then right click on the AMI you've just created and choose "copy AMI" to the designated region.

  • For RDS
    • If you just wanna copy data to another region then take a snapshot then copy that snapshot to destination region
    • If you want to make the RDS replicate to another region continuously then you need to create a read-replica from your RDS instance.
Dominic Nguyen
  • 753
  • 6
  • 11
  • Cam on! Will creating an AMI ensure that all contents (directories etc) inside of those instances get carried across as well? And also "read-replica" for the RDS be a copy of the contents (ie all the data inside) as well? – 3kstc Jan 25 '19 at 03:42
  • Yes! an AMI of EC2 mean everything of that instance including all your contents on disks and also the number of ebs volumns, mount point, etc... RDS read-replica is and near real-time replication solution. Your RDS will continuously copy data from the master instance to other region, the read-replica can only read, not write, but you can promote it to become master when needed. – Dominic Nguyen Jan 25 '19 at 04:13
  • 1
    @DungNguyen I believe OP may be reading too much into your answer, or you are reading too little into the question, or perhaps the intent of the question is unclear. An AMI is a point in time snapshot. It does not "replicate" content beyond that. – Michael - sqlbot Jan 25 '19 at 20:08
  • @DungNguyen I have managed to create AMIs for my instances and now they are active. I want to replicate RDS to another region, but not continuously. So that I have the same tables in place. The documentation is really confusing. Are you able to shed some light? – 3kstc Jan 30 '19 at 03:01
  • Then you just need to create a snapshot of your RDS then copy the snapshit to the destination region you want. Then, lunch new RDS instance from that snapshot. – Dominic Nguyen Jan 30 '19 at 03:05
0

Option for replicating environment depends on how much downtime can you tolerate.

If you are okay with downtime 1. Copy the AMI of EC2 instance and snapshot of RDS to another regions 2. Bring up your new environment. This is perfect for non critial workload

If this is critical application 1. Copy the AMI of ec2 instance ( I am assuming this would be your web/app instnaces) For real time replication use rsync or robocopy .. or solution like cloudendure . 2. Create a new RDS instance in sydney 3. USE DMS migration tool .. create source and target relationship 4. once insync cut off the relation bring new environment in sydney

launchpad
  • 28
  • 4
0

As suggested by previous answers for EC2 you can create AMIs and then move the AMI to a different region.

For RDS, you can either create read replicas (and read replicas of read replicas, but beware of latency), read replicas are used to mainly improve read performance of your app.

You can also create a Multi AZ backup which will act as a disaster recovery site. However, note that Multi-AZ is only used in case of a failover. Moreover, Multi-AZ involves Synchronous data copy and read replicas are asynchronous, so read replicas can demonstrate eventual consistency behavior.

But the real question here is - What are you trying to achieve?

Are you trying to "scale out" your infrastructure to support huge traffic to your application? Or are you simply trying to setup disaster recovery (DR)?

If your answer is DR, then the approach is pretty straight forward with Multi AZ and EC2 instance snapshots. But if the answer is scaling out and performance, you really need to be thinking of better strategies such as using Cloudfront (CDN) if it is a web app, using Elasticache in-memory cache for frequently read data, or RDS read replicas, using Elastic Load Balancers with Dynamic/Step scale-out/scale-in. Other, methods would be to evaluate the type of RDS storage subsystem used i.e. using Provisional IOPs vs. Using General Purpose SSD, checking if there are any NAT “instance” bottlenecks in your VPC and so on.

It may be tempting to spin up all these redundant copies of EC2 AMIs or RDS read replicas with a click of a button, but you really need to be thinking about the cost you are going to incur on a monthly basis for completely un-used resources.

Anjan Biswas
  • 7,746
  • 5
  • 47
  • 77
  • Thanks for the informative answer - I am trying to the "scale out" our infrastructure - ie clone/copy/replicate the current set-up across multiple regions. – 3kstc Jan 29 '19 at 01:56
  • I recommend you look at read replica (for RDS) strategies within a Single region but with Multiple Availability Zone. Often time it would cater to your need without breaking the bank. If that still isn’t enough then you can have cross region read replicas (to atmost 1 or 2 other regions) but beware of pricing since pricing varies by region. Same strategy for EC2, try ALB within a region with multiple availability zones, since AMI is simply going to create a backup/image of instance. For high performance load balancer you can try “Network Load Balancer”, but evaluate cost. – Anjan Biswas Jan 29 '19 at 02:06
  • thanks! Read through some of the things about RDS replication. I think I am more confused now! All I want to do is to replicate RDS to another region, but not continuously. I want to make sure that all the tables in the RDS's are still there. So that both regions are independent of each other. How can I do this? – 3kstc Jan 30 '19 at 03:06