Amazon Relational Database Service (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud. With Amazon RDS, you can MySQL in minutes with cost-efficient and re-sizable hardware capacity. In this webinar, we'll discuss how to get the most out of the service, including techniques for migrating data in and out.
13. mysql> GRANT SELECT,REPLICATION USER,REPLICATION CLIENT ON *.* TO repluser@‘<RDS
Endpoint>' IDENTIFIED BY ‘<password>';
Create replication user on the master
Record the “File” and the “Position” in the backup
$ mysqldump --databases sampledb --master-data=2 --single-transaction
-r sampledbdump.sql -u mysqluser –p mysqluserpassword
--
-- Position to start replication or point-in-time recovery from
--
-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin-changelog.000031', MASTER_LOG_POS=107;
14. Configure replication target
mysql> call mysql.rds_set_external_master(‘<master
server>',3306,‘<replicationuser>',‘<password>','mysql-bin-changelog.000031',107,0);
mysql> call mysql.rds_start_replication;
Configure the replication target and start replication
Stop the app pointing at the source. Stop replication after target catches up
mysql> call mysql.rds_stop_replication;
Promote target Amazon RDS database instance
mysql> call mysql.rds_reset_external_master;
Point the app at the target Amazon RDS database instance
15. AWS Region
App
Dump Data
Staging server
scp & load
MasterSlave
mysql> call mysql.rds_set_configuration('binlog retention hours', 48);
19. [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log:
‘Client requested master to start replication from impossible position;
29. mysql> CREATE EVENT ‘evt_dump_innodb_cache’
ON SCHEDULE EVERY 1 HOUR STARTS ‘2014-11-06 01:00:00’
DO BEGIN
CALL mysql.rds_innodb_buffer_pool_dump_now();
END