1. Home
  2. Docs
  3. ClusterControl
  4. Administration
  5. Migrating IP Address or Hostname

Migrating IP Address or Hostname

ClusterControl relies on a proper IP address or hostname configuration. To migrate to a new set of IP address or hostname, follow these instruction steps:

1) Update the old IP address/hostname occurrences in the following files:

  • CMON configuration file: /etc/cmon.cnf and /etc/cmon.d/cmon_N.cnf (hostname and mysql_hostname values)
  • HAProxy configuration file (if installed): /etc/haproxy/haproxy.cfg

This section does not cover the IP address migration of your database nodes. The easiest solution would be to remove the database cluster from ClusterControl UI → Delete Cluster and import it again by using ClusterControl UI → Import deployment dialog.

2) Revoke ‘cmon’ user privileges for old hosts on ClusterControl node and all managed database nodes:

mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'cmon'@'{old ClusterControl IP address or hostname}';

3) Grant cmon user with the new IP address or hostname on the ClusterControl node and all managed database nodes:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'cmon'@'{new ClusterControl IP address or hostname}' IDENTIFIED BY '{mysql password}' WITH GRANT OPTION;

Or, instead of revoke and re-grant, you can just simply update the MySQL user table:

mysql> UPDATE mysql.user SET host='{new IP address}' WHERE host='{old IP address}';

4) Restart CMON service to apply the changes:

systemctl restart cmon
service cmon restart

Examine the output of the CMON log file to verify the IP migration status. The CMON Controller should report errors and shut down if it could not connect to the specified database hosts or the CMON database. Once the CMON Controller is started, you can remove the old IP addresses or hostnames from the managed host list at ClusterControl UI → Manage → Hosts.

Was this article helpful to you? Yes No