Replication Between MySQL and AWS RDS MySQL : GTID Flag Issue - mysql

I am trying to set up a replication between MySQL running on an EC2 instance and AWS RDS MYSQL instance.
I am following this guide.
My master MYSQL db (running on EC2) has GTID mode turned on. My intended to be Slave(AWS RDS MYSQL) has GTID mode off, and apparently, there is no way to turn it on.
Due to this, when I start replication, I get following error on slave:
The slave IO thread stops because the master has ##GLOBAL.GTID_MODE ON and this server has ##GLOBAL.GTID_MODE OFF
I can't turn off my master's gtid mode. How can I make this replication work?

You can't enable the "gtid_mode=on" db parameter on the AWS rds at this moment. Please find the amazon forum reference below.
Ref:
https://forums.aws.amazon.com/thread.jspa?messageID=474345
I suggest you following the below reference documentation from AWS to achieve this.
Ref:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MariaDB.Procedural.Replication.GTID.html
You can use the internal functionality of the aws rds named 'mysql.rds_set_external_master_gtid'.
Alternatively, You can use binary log method for the replication. You will find the bin-log parameter in the DB Parameter group.

Related

How to encrypt a production unencrypted RDS Aurora MySQL 8 cluster

I have a running RDS Aurora MySQL 8.0.23 cluster running in production. The database is unencrypted and I need to enable encryption for it. As far as I understand, this is not possible to do directly. The procedure I am evaluating is:
Create a read replica on the current cluster.
Stop replication on replica and annotate binlog filename and
position.
Promote the read replica to a new encrypted cluster (maybe it
requires to do a snapshot before).
Set up back replication with the original cluster using binlog file
and position annotated before.
Wait until replication lag is zero.
Redirect production traffic to the new cluster.
Stop replication.
[Optional] Delete old cluster.
I have two issues with the above procedure:
Once created the replica, running commands like SHOW SLAVE STATUS
or SHOW REPLICA STATUS return empty set, so I can't annotate
binlog file and position. Please note that replication is enabled on
the original cluster (binlog_format is set to ROW).
It seems I can't promote the Aurora read replica to a new cluster,
the option is missing on the available actions. But according to the documentation it should be possible.
Has anyone have feedback about the issues above? What is the current up-to-date procedure to encrypt an Aurora MySQL cluster with minimum downtime and no data loss?

How to configure MySQL read replica in RDS from Slave server

We have a working MySQL Master-Slave replication in our Data center. We need to configure one read replica in AWS RDS from my slave server. How can I achieve this? I need the configuration like the following. Read replica should be configured fron Slave Server
Master --> Slave --> Read Replica [In RDS]
This document section seems just right for your requirement :
Replication with a MySQL or MariaDB Instance Running External to Amazon RDS
What required is some downtime to your DB. The steps consist of :
Make your DB read-only
Dump data to the RDS instance
Enable writing on your DB again
Create user with replication privileges on your DB
Start replicating your DB from RDS using the created user

Does MySQLFabric support mysql replication semi synchronous ( 5.7 version) when failover happens?

Semi synchronous Replication can be established in Mysql Server 5.7.
If in a cluster or HA group of 5.7 mysql servers is used in latest MySQL Fabric, when secondary becomes primary does the secondary automatically get the semi synchronous settings?
The reason for this is, for semi synchronous to happen, we need to manually set up settings on the master and its slaves. But when the master fails, do we need to do the same thing manually or through scripts?
Or does the Mysql fabric supports it?
You can install both the master and slave plugins to both machines and have both master and slave semi-sync permanently enabled.
When the master is demoted it will attempt to connect to the new master on the semi-sync thread.
It works pretty seamlessly.

Replicate subset of tables from AWS RDS mysql to another RDS/external mysql instance

The MySQL database that I am using is in an Amazon AWS RDS 5.6. Only 1 of the tables needs to be replicated. The slave can be another AWS RDS MySQL instance. Read replica tables replicates the entire database.
Can what I am describing be done manually or through other means?
On RDS MySQL Engine the replication ignore/do table/db options cannot be set. You could create a read replica, set read_only of the read replica to 0 and change the tables you dont need on the slave to BLACKHOLE.
You could also install you own mysql on a EC2 instance where you would have control over all options.

Amazon RDS MySQL replication

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.