Aurora serverless: Unable to connect for replication - mysql

I'm stuck trying to connect my Aurora serverless MySQL server to a Master MySQL server in the same VPC.
I checked everything to make it work, even extended the SecurityGroup from both the Master and the Aurora server to accept all connections from the VPC, still, I get a 2003 error from the Slave (Aurora):
error connecting to master 'user_repl#vpc_ip1:3306' - retry-time: 60 retries: 1
I even tried with the local name ip-{local-ip-vpc}.eu-west-3.compute.internal without any luck.
Trying to connect from another EC2 instances in the same VPC to that master, with the "user_repl" works fine, so it's not a problem of bind-address, security group on the master, passwodr or anything like that.
I wonder if Aurora serverless can replicate a master server and become slave, but if that wasn't the case, I would expect another error than just an "error connecting".
What is causing this issue?
Thank you in advance.

It turns out that AWS Aurora MySQL Serverless can not do replication like we do on a MySQL server.
In order to enable replication, you'll need to use AWS Database Migration Service (DMS) where you set up a source endpoint, a target endpoint, a replication server, and enable replication between the source and the target.
I just tested it on my end and it works fine. It's a bit more work - and different than a standard replication - but it works exactly the same in the end.

Related

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

AWS RDS connection from external client extremely slow

I am currently connecting to an RDS instance (MariaDB) without an issue from within the configured VPC.
I am also connecting to the RDS instance from local clients (external to the VPC) with no connectivity issues but have serious issues with SQL execution speeds. It can take up to 20 times longer to execute a query remotely vs locally (an EC2 on same VPC).
I have the Security Group for the RDS instance setup to allow the external IPs as incoming rules and the RDS instance is listening on a non-default port (not 3306).
I cannot think of anything I should be doing differently on the network side of things and I have set skip-name-resolve=1, yet the speed is ridiculous.
It has no preference in terms of what the SQL query may be (SELECT, UPDATE, DELETE), they all execute slow.
Server RDS is MariaDb 10.1.19 on a db.t2.medium instance.
Client connection is via MySQL .NET Connector and connection string:
Server=<ip>;Port=<port>;Database=<dbname>;User ID=<dbuser>;Pooling=true;CharSet=utf8;Password=<dbpass>
Client has no connectivity or speed issues when DB in not an RDS (local MySQL).
I have seen various network related issues popping up now and then (connection stream dropped) but nothing serious apart from that, just very slow.
Any pointers on how to at least determine where the problem is?
The scenario I am trying to achieve (with acceptable speeds) is described here (albeit vague in their instructions):
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Scenarios.html#USER_VPC.Scenario4

Replication Between MySQL and AWS RDS MySQL : GTID Flag Issue

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.

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?

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.