Which availability zone does RDS failover to? - amazon-web-services

I created a database in RDS and I was wondering where in the dashboard do you see the failover AZ. Under summary I can see the AZ of the instance which I assume is the master but where is the slave located? How do I know which AZ it will fail over to?

The subnets in which you launch your multi-az deployment RDS instances determine the availability zones for your master and slave (Primary and secondary) RDNS instances.You can also check the secondary server AZ from the Replication section at the bottom of the database configuration details.
If you selected "Do not create a standby instance" at the time of creation of the RDS instance ,then you will not see any secondary RDS instance.

Related

Move RDS Aurora Instance from private to public subnet

I currently have the typical setup of an RDS cluster with 1 instance running in a private subnet. I am migrating our application out of AWS and into Heroku (while leaving the DB as is), but I need to be able to connect to the DB from the Heroku dynos.
What I can't figure out is how to move the DB out of the private subnet and into a public one.
The AWS docs have instructions for moving from public to private, and I thought I could just follow them for the opposite direction too. But the process involves standing up a new secondary in the desired subnet using Multi-AZ configuration and a failover. But when I go to Modify my instance, there is no option for configuring Multi-AZ:
It seems like Aurora instances in particular do not support Multi-AZ? "Multi-AZ DB clusters are in preview for RDS for MySQL and RDS for PostgreSQL" Leaving me somewhat stuck.
Edit I did just see this message elsewhere: "You have no Aurora Replicas in your DB cluster." which might be why Multi-AZ is not available. But I'm not seeing any options to spin up a replica anywhere.
Again my goal is to get my Aurora DB into a public subnet (or otherwise make it accessible from the internet, but not through an SSH tunnel)
The Availability Zone options are in the "Availability & durability" section above "Connectivity" FYI
I just had your same issue but with a Postgres DB, though I have the option to change its "Subnet group" in the Connectivity section, which you don't have it seems, but it only appears for me if the DB is NOT currently multi-AZ. AWS will prevent you from moving the DB between subnet groups* in the same VPC, but you can just move the DB to a subnet group in a different VPC and then move it back to the subnet group that you actually want it in (configured with the appropriate public subnets).
*You can create subnet groups in the RDS service, left side menu.

Will AWS transfer data between availability zones if I request data from RDS?

I have a Multi-AZ ECS cluster with EC2 instances and an Aurora RDS cluster with cross-az read replicas. I use the cluster URL for selecting data in RDS.
Does the cluster automatically forward my request to the RDS in the same AZ, if it is possible? If not, how can I prevent unnecessary data transfer between availability zones? (I want to use RDS in different AZ, if and only if the RDS in the same AZ is out of service)
According to AWS documentation:
"Data transferred between Amazon RDS and Amazon EC2 Instances in the same Availability Zone is free."
"Amazon RDS DB Instances inside VPC: For data transferred between an Amazon EC2 instance and Amazon RDS DB Instance in different Availability Zones of the same Region, Amazon EC2 Regional Data Transfer charges apply on both sides of transfer."

Amazon RDS - multi AZ

I want to take a multi AZ RDS db instance with Amazon. But from their FAQs or guidelines I cannot find if I can select a specific AZ for the standby DB. I understand that the secondary DB will be in the same Region. Can anyone tell me if it is possible to select the AZ of the stand by ?
When you select Multi-AZ deployment for the RDS instance, Amazon will manage the Master and Slave placement within the defined VPC.
This is because, when a failure happens, AWS is able to promote the secondary instance as master to handle the requests, while other database failovers.
Note: You are only able to select the Availability Zone if you are provisioning a single instance.

Common AWS failures - Handling AZ failover

Specifically I have a question what is the recommended way to organize AZ failover in AWS environment. Also it will be good to understand typical AWS failures in order to organize Application HA (High Availability).
So, Application architecture (AWS services usage) is following:
It's more/less typical Web Applications architecture in the AWS
There is route 53 that resolves ip of some ELB.
There is public subnet that has ELB and it routes traffic to Web Servers to private VPC;
In the private subnet traffic goes: Web Servers -> ELB-> Application Servers;
Application Servers writes data to Multi-AZ RDS.
The main drawback with such deployment that services are active in one AZ because in a Multi-AZ deployment, Amazon RDS automatically provisions and maintains a synchronous standby replica in a different Availability Zone. So, master is only in one AZ and services in another AZ is not allowable to write to RDS because it's standby.
Two questions:
What is the better way to implement HA for such deployment?
What is the common AWS failures (if one AZ is unavailable whether it's often happens only with some services (e.g. VPC/EC2/EBS other issues?)or usually it's whole AZ specific services are not available)?
Considerations about HA for such approach:
RDS. From AWS docs: "In the event of a planned or unplanned outage of your DB instance, Amazon RDS automatically switches to a standby replica in another Availability Zone if you have enabled Multi-AZ. The time it takes .....". So, AWS Automatically will change RDS Master.
Active/Not active AZ. Different health checks can be added to Route53 and basically make Active another AWS AZ. But How to make it synchronously with RDS (only after RDS becomes master in another AZ make this AZ active)?
Update
Another reason to maintain one active and one passive AZ is that our application servers should support stickiness by device IP address (e.g. It keeps session based on user's or device's IP). And we have 1 EC2 Web Server instance in each AZ that maintains it (we can't allow to go requests to different AZ(s)).
I think you misunderstand how availability zones work. Services in one AZ can connect to the RDS master in a different AZ. You should have all services running in at least 2 AZs.
For RDS, when then master fails or the AZ the master is in goes down, the RDS service will promote the standby to master and update the DNS for the RDS endpoint so that the endpoint will then point to the new master.
All you code needs to do in order to handle an RDS failover is to gracefully handle sudden DB disconnects with a retry.

Amazon RDS Read Replica in Same Region, Different VPC

For version cut-over, I am using CloudFormation to spin up a new infrastructure with a new VPC, Subnets, and Security Groups. I want a copy of my production database in the new VPC (same region). I do not want to use a Snapshot, because that would require me to take the app down for a while (after the snapshot is taken, any new data will be lost, so I have to shut down the app).
I want to create a read-replica into the new VPC/SecurityGroup/Subnets, and then when I am ready for cut-over I will promote that read replica. Is this possible?
AWS documentation gives clues that creating a read replica across VPCs in the same region is not supported, but does not explicitly say so. Alternately, I am open to moving the database after promotion.
Thanks
P.S. example of what I mean by "clue":
"Within a region, all cross-region replicas created from the same source DB instance must either be in the same Amazon VPC or be outside of a VPC."
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html
This almost answers my question... But what about replicas created in the same region as the source DB?
It is not supported.
You can do a read replica within the same VPC, then take a snapshot of the replica and restore it on the other VPC.
You can actually do this using external MySQL replicas. You will need appropriate routing and security groups between your VPCs. As long as your VPC subnets can communicate with each other, create a replica, stop replication on it and record the binlog position info where it was stopped. Take a snapshot of the replica and use that to spin up a new RDS instance in the new VPC, now set the external replica to your old RDS instance and start replicating where the binlog position was recorded. You've now got a master RDS instance in your new VPC, replicating from the old VPC.
This article covers it in easy to follow steps:
http://quiddle.net/post/78453641455/migrating-rds-from-ec2-to-vpc