Changing an IP Address in a Rolling Fashion (no downtime for reads)
This topic describes how to change the IP addresses for one or more hosts in a SingleStoreDB cluster.
Part 1 - Change the IP of leaf nodes one availability group at a time
Shut down the node:
If it is a leaf, first remove the leaf entry by running either:
REMOVE LEAF '<IP of OLD leaf>':<port> FORCE;
or:
sdb-admin stop-node
Change the IP address.
Unregister the old leaf from
sdb-toolbox-config
:sdb-toolbox-config unregister-host --host <old_ip_address_here>
Register the new leaf to
sdb-toolbox-config
:sdb-toolbox-config register-host --host <new_ip_address_here>
Register the node to
sdb-admin
:sdb-admin register-node --memsql-config /path/to/memsql.cnf --host <new_ip_address_here>
Start the
memsql
service on the new leaf node:sdb-admin start-node --memsql-id <new_memsql_node_id>
Add the leaf node to the cluster:
ADD LEAF user[:'password']@'<new_ip_address_here>':<node_port>;sdb-admin start-node --all
Perform
REBALANCE
REBALANCE PARTITIONS ON db_name;
Part 2 - Change the IP of the Child Aggregator (one Child Aggregator at a time)
Remove the aggregator from the cluster:
REMOVE AGGREGATOR 'host':port;
Change the IP address of the host.
Unregister the old host from
sdb-toolbox-config
:sdb-toolbox-config unregister-host --host <old_ip_address_here>
Register the new host to
sdb-toolbox-config
:sdb-toolbox-config register-host --host <new_ip_address_here>
Register the node to
sdb-admin
:sdb-admin register-node --memsql-config /path/to/memsql.cnf --host <new_ip_address_here>
Add the node as an aggregator to cluster:
ADD AGGREGATOR user[:'password']@'<new_ip_address_here>':port;
Part 3 - PROMOTE one of the Child Aggregators to Master Aggregator
To promote a child aggregator to master aggregator, execute:
PROMOTE AGGREGATOR '<host>':<port> TO MASTER;
Part 4 - Change the old Master Aggregator IP
See the steps in Part 2. The process is the same as removing a child aggregator as now the original MA is currently a CA since we promoted an existing CA to master.
Part 5 - PROMOTE the previous Master Aggregator back to a Master Aggregator, if needed
To promote the original master aggregator back to a master aggregator if needed, execute:
PROMOTE AGGREGATOR '<new_ip_of_original_MA>':<port> TO MASTER;