Saturday, November 20, 2021

RDS Mysql start and stop replica

 Mysql commands to stop and start the replica are different from the normal mysql replica command, 

To stop RDS Mysql replica use the below command:

CALL mysql.rds_stop_replication;



Start RDS Replication :


CALL mysql.rds_start_replication;


Kill Running Processes:


CALL mysql.rds_kill(processID);


Skip Replication Error :

CALL mysql.rds_skip_repl_error;


Check number of hours binary logs are retained


  CALL mysql.rds_show_configuration;



Set retention for binary logs:


CALL mysql.rds_set_configuration(name,value);







Enadble Read_only RDS Mysql

In a mysql replica , when there is a need to enable slave as Read only so that no user can modify data, this is done by updating parameter read_only to On.



However when we try to enables the same in RDS from the command line this is the error:



To enable Read_only mode in an RDS replica, we need to change the db parameter group as shown below. Change this parameter in your PG to enable read_only mode (the below one is default PG and hence won't change).



Post making the changes the Replica should be in Read only mode