Skip to Content

Configure secondary node for new IP

How to configure the secondary node when the IP address has changed?


Overview: This article will guide you through setting up a secondary node if its IP address has been changed to a new one.


Method 1: Update cluster with the new IP.

Step 1: Login to the primary node and run the command below to grant access to the secondary node.

root@primary:~# php /usr/local/ezlogin/grant_host.php new_secondary_ip

Step 2: Login to secondary server and run the update script with new secondary IP. Replace same Ezeeogin version of master node and secondary node IP.

root@secondary:~# sh ezlogin_7.xx.xx_phpxx.bin --  -secondary {new_secondary_ip} -othernode {primary_ip} -skipgeolite -auto -force -I_ACCEPT_EULA -skipbackup -update

example: sh ezlogin_7.39.0_php82.bin -- -secondary 192.168.56.222 -othernode 192.168.56.227 -skipgeolite -auto -force -I_ACCEPT_EULA -skipbackup -update

Step 3: Login to the primary node GUI and click on the cluster tab to view the updated secondary node IP.


Method 2: Update the IP from database.

Step 1: Login to the primary node and run the command below to grant access to the secondary node.

root@primary:~# php /usr/local/ezlogin/grant_host.php new_secondary_ip

Step 2: Edit replication.conf and update with the new secondary IP.

root@primary:~# vim /usr/local/etc/ezlogin/replication.conf

remote_ip=new_secondary_ip
remote_dbhost=new_secondary_ip
remote_dbport=3306

Step 3: Update remote_ip from database as well. Replace secondary node IP.

root@primary:~# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_settings set value='new_secondary_ip' where name='remote_ip'"

Step 4: Login to the primary node GUI and click on the cluster tab to view the updated secondary node IP.


Related Articles:

Install slave / secondary node for high availability in jump server

Cluster Explained