Amazon RDS MySQL replication - mysql

I am struggling to setup replica with Amazon RDS. I want to make RDS as my master but for slave I want to setup my server outside of RDS. For now I am setting my slave at EC2. I have checked AWS doc for the information but could not find the exact answer to my question.
However I did found a blog post which have POC for doing it http://www.ruempler.eu/2013/07/07/replicating-aws-rds-mysql-databases-to-external-slaves/
But the problem that I facing is I am getting error
ERROR: Got error reading packet from server: Slave can not handle replication events with the checksum that master is configured to log
I tried to set binlog_checksum = none at RDS but RDS is not letting me change its config file.
Please suggest me folks!!

You can use AWS DMS (Data migration service) for this purpose. It will support replication between any 2 MySQL DBs.
Please refer our blog:
https://medium.com/tensult/cross-account-and-cross-region-rds-mysql-db-replication-part-1-55d307c7ae65

The question is quite old, but I bumped into it while searching for similar functionality. Amazon supports both replication from an external master and replicating to an external slave these days:
Replication from external master:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.External.Repl.html
Replication to external slave:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Exporting.NonRDSRepl.html
Hope this helps future searchers.

It does not appear to be possible as of now (December, 2017).
Looking at #walter-heck's second link above, it is actually (another) explanation of "... replication between an external master instance and a DB instance on Amazon RDS".
It does not appear you can setup an external replica which connects to a RDS running as master.
AWS does offer this service, of course, however each replica must be within RDS.
With all the service offerings AWS has, one would think this would be possible. However, it may not work well with the AWS business model, because you don't pay based on external replicas - you pay based on RDS size.

Related

Is it possible to create a multi source read replica in RDS

We use RDS MySQL with a micro service architecture. Each service has its own database and we have been slowly moving them into their own instances for load management and whatnot.
We have a replica still attached to the primary instance (where most of the databases still reside) but it is missing the databases that are on their own instances. We would like to have a single read replica that sources from all of the instances so that we can run sanity checks on the data without needing to move data between instances.
Does RDS support a multi source read replica? Or will we need to manage our own MySQL install in order to accomplish this?
As far as I know, you will have to operate MySQL yourself on EC2 to get the multi-source replication feature. You may like to contact your AWS support representative to confirm this.
AWS RDS does not support multi-source replication. Configuring replication from an external master is limited because you have to configure it using a stored procedure provided by AWS. It does not have any support for configuring multiple replication channels. Each replica has exactly one master.
AWS Aurora 2.x (API-compatible with MySQL 5.7) also does not support multi-source replication. As of Aurora 2.07.x, they list multi-source replication among features of MySQL 5.7 they do not support. See https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.2070.html
AWS Aurora 1.x (API-compatible with MySQL 5.6) has something they call multi-master cluster, where all the nodes in a cluster can be writers. I have not used this, and I don't know how reliable it is. See https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html for details.
It's weird that they seem to have lost functionality between Aurora 1.x and 2.x. My understanding is that they sort of "started over" with Aurora 2.x, and some features haven't been implemented in the new version yet.
This is my understanding as of December 2019. Of course future versions may add such features.

larger size db export from rackspace

I am planing to migrate my Db from rackspace to AWS. The current db has around 50GB of size.
So how can i export this Db from rackspace without downtime.Or any other solutions like direct migration from rackspace to AWS RDS
Amazon provides multiple options in the RDS docs. Have you read them?
My preference would be to set up replication between your Rackspace instance and a new RDS instance. This will minimize your downtime: when you're ready you shut down your applications, reconfigure them to use the new database, and you're done.
I recommend planning for at least three attempts, since replication can be tricky the first time you set it up. Even if you get the replication right on the first try, I strongly suggest that you bring up a test environment and do a complete regression test of your app, before repeating the replication for your production cutover.
Yes, You can easily achieve migration without any outage using DMS services given by Amazon. I used DMS for migration from Company Hosted Environment to RDS.

Amazon RDS two way replication

I have two rds which have the same structure, each db serves one of two apps. Some of tables are using by first app some by other. I want to set up two ways read/write replication between two rds. I can do it with stand alone mysql, set table replication (https://dev.mysql.com/doc/refman/5.7/en/replication-rules-table-options.html) but can not find any option to do so for rds
This is is probably what you'd call a Really Bad Idea™.
RDS does allow you to configure an RDS instance as a slave of another machine.
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/mysql_rds_set_external_master.html
Of course, on the same page...
Warning
Do not use mysql.rds_set_external_master to manage replication between two Amazon RDS DB instances.
...however, that appears to be because that's not how you configure an RDS instance to be a replica of another instance. When you're configuring a read-only replica, you don't use this -- RDS manages all of the replication configuration for you.
mysql.rds_set_external_master() is a stored procedure that allows you to execute CHANGE MASTER TO... since, in RDS, you lack the SUPER privilege and would otherwise be unable to do this.
The feature is designed for hot migrations from a non-RDS MySQL server to RDS, by replicating the events from the external master into RDS during the transition.
...however, if there is a way to do what you are trying to do with RDS, this would be it. Each instance would be set to use the other as its master.
The two would need to have network connectivity, which means they'd need to be in the same region and same VPC, or you'd have to handle the peering or tunnel configuration yourself to establish that network path.
This is almost certainly an unsupported configuration, but again, if there is a way to accomplish it, this would be the way. "Unsupported" doesn't mean it won't work, but only that AWS support will not likely be able to provide assistance if it doesn't.
Did I mention this might not be a good idea?

How to disable innodb_doublewrite for MySQL at Amazon RDS?

Please can anyone help me to disable "innodb_doublewrite" for my MySQL database hosted at Amazon RDS. I need this as we need to quickly update around 15 Million rows.
I know there is a startup option for this:
--skip-innodb_doublewrite
But how to use it?
Apart from that, Amazon RDS Parameters Group does not show the option of "innodb_doublewrite" for editing. Amazon does not also allow direct editing of my.cnf file.
I can access the MySQL through my Linux Server. But don't know exactly how to use the startup option for Amazon RDS. Please can any one help me to disable this option?
AWS support confirmed the following as of August 2, 2015:
"innodb_doublewrite can't be modified in RDS MySQL instances"
RDS is a managed database service that provides some abstractions to managing a database directly on EC2 but in exchange you lose some flexibility including what options you are able to apply to your database instance.
All start up parameters that would normally be specified in my.cnf should instead be applied via the RDS Parameter Groups but, as you mention in your question, innodb_doublewrite is not one of the configurable parameters.
If the data you are updating is not likely to be updated during normal operation you could always attempt to make the update on a read slave (SET GLOBAL READ_ONLY=0 first) and then promote the read replica and point your application at this instance.

How can I replicate the test scenario in AWS RDS?

I am exploring AWS RDS, I have migrated the MySQL db to RDS dbinstance.
Now I want to test the Amazon RDS - Multi-AZ Deployments For Enhanced Availability & Reliability feature.
How can I replicate the test scenario where the primary Database failure doesnot cause any harm to the secondary server.
I have refferred to this link.
http://aws.typepad.com/aws/2010/05/amazon-rds-multi-az-deployment.html
Thanks
You can use the RebootDBInstance API to force a fail over to the other AZ. Just set the ForceFailover parameter to true
Of course, you can also use the web console to Reboot your DB instance, as described here.
--Seb