We have a percona cluster of 3 servers setup. We have 1 server not in the cluster that is our DR server which is setup in a master/slave replication from our main SQL server in the cluster for having an offsite current backup of the DB. This is setup and working however, I need to change the IP address of the DR server that is the slave to the master MYSQL server in the percona cluster.
How can I accomplish this? Also to note this environment is not yet in use so any disruption won’t be critical if needed. I think changing the IP on the DR box is all I need to do but not sure what else needs to happen. Please let me know if any other details are needed. Any help is appreciated.
@jasonfe , if you need to change the replica’s IP, then just stop mysql, change the ip, start mysql, start replication. That’s it. If you created a replication user within the PXC using a specific IP, then you’ll need to update that GRANT, but otherwise, that’s it. The
source|master doesn’t care about the replica’s IP other than for permissions.
@matthewb So on my slave server run these commands?
systemctl stop mysql
Change Ip address/mask/gateway
systemctl start mysql
Start slave; (run in mysql)
We did create a replication user within PXC I believe using an IP. So to update GRANT from master SQL server to DR server? Run this command with new IP?
grant replication client, replication slave on . to replicator’@’[ipaddress] identified by ‘[password]’;
Does all of that look correct?
Yes, that does. Be sure to DROP the old IP user too.