Configure secondary node for new IP
How to reconfigure secondary node when the IP address has changed?
Overview: This article explains how to reconfigure secondary node in the Ezeelogin cluster setup when its IP address has been changed.
Method 1: Update cluster with the new IP
Step 1(A): 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 1(B): Log in to the secondary server and run the update script using the new secondary IP address. Ensure that the Ezeelogin version matches the one used on the primary node, and replace both the secondary and primary IP addresses accordingly.
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:
root@secondary:~# 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 1(C): 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 2(A): Login to the primary node and execute the following command to grant access to the new secondary node.
root@primary:~# php /usr/local/ezlogin/grant_host.php new_secondary_ip
Step 2(B): Edit the replication.conf file on the primary server and update it with the new secondary IP address:
root@primary:~# vim /usr/local/etc/ezlogin/replication.conf
remote_ip=new_secondary_ip
remote_dbhost=new_secondary_ip
remote_dbport=3306
Step 2(C): Update the remote_ip value in the database by running the command below, replacing it with the new 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