Configures a MySQL DB instance to be a Read Replica of an instance of MySQL running external to Amazon RDS.
CALL mysql.rds_set_external_master ( host_name , host_port , replication_user_name , replication_user_password , mysql_binary_log_file_name , mysql_binary_log_file_location , ssl_encryption );
The host name or IP address of the MySQL instance running external to Amazon RDS that will become the replication master.
The port used by the MySQL instance running external to Amazon RDS to be configured as the replication master. If your network configuration includes SSH port replication that converts the port number, specify the port number that is exposed by SSH.
The ID of a user with REPLICATION CLIENT and REPLICATION SLAVE permissions on the MySQL instance running external to Amazon RDS. We recommend that you provide an account that is used solely for replication with the external instance.
The password of the user ID specified in
The name of the binary log on the replication master contains the replication information.
The location in the
mysql_binary_log_file_namebinary log at which replication will start reading the replication information.
This option is not currently implemented. The default is 0.
mysql.rds_set_external_master procedure must be run by the master user.
It must be run on the MySQL DB instance to be configured as the Read Replica of a MySQL instance running external
to Amazon RDS.
Before you run
mysql.rds_set_external_master, you must configure the instance of MySQL running external
to Amazon RDS to be a replication master. To connect to the MySQL instance running external to Amazon RDS,
you must specify
replication_user_password values that indicate a replication user that has
REPLICATION CLIENT and
REPLICATION SLAVE permissions on the external instance of MySQL.
To configure an external instance of MySQL as a replication master
Using the MySQL client of your choice, connect to the external instance of MySQL and create a user account to be used for replication. The following is an example:Copy
CREATE USER 'repl_user'@'mydomain.com' IDENTIFIED BY 'SomePassW0rd'
On the external instance of MySQL, grant
REPLICATION SLAVEprivileges to your replication user. The following example grants
REPLICATION SLAVEprivileges on all databases for the 'repl_user' user for your domain:Copy
GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO 'repl_user'@'mydomain.com' IDENTIFIED BY 'SomePassW0rd'
For more information, see Replication with a MySQL or MariaDB Instance Running External to Amazon RDS.
We recommend that you use Read Replicas to manage replication between two Amazon RDS DB instances when possible, and only use this and other replication-related stored procedures to enable more complex replication topologies between Amazon RDS DB instances. These stored procedures are primarily offered to enable replication with MySQL instances running external to Amazon RDS. For information about managing replication between Amazon RDS DB instances, see Working with PostgreSQL, MySQL, and MariaDB Read Replicas.
mysql.rds_set_external_master to configure an Amazon RDS DB
instance as a Read Replica, you can call mysql.rds_start_replication on the replica to start the replication process.
You can call mysql.rds_reset_external_master to remove the Read Replica
mysql.rds_set_external_master is called, Amazon RDS records
the time, user, and an action of "set master" in the
mysql.rds_set_external_master procedure is available in these
versions of Amazon RDS MySQL:
MySQL 5.5 version 5.5.33 and later
MySQL 5.6 version 5.6.13 and later
MySQL 5.7 version 5.7.10 and later
When run on a MySQL DB instance, the following example configures the DB instance to be a Read Replica of an instance of MySQL running external to Amazon RDS.
call mysql.rds_set_external_master( 'Externaldb.some.com', 3306, 'repl_user'@'mydomain.com', 'SomePassW0rd', 'mysql-bin-changelog.0777', 120, 0);