SingleStore DB

Changing an IP Address

This topic describes how to change an IP addresses for one or more hosts in a SingleStore DB cluster.

SingleStore Tools

  1. Ensure you have a restorable backup of your cluster.

  2. Shut down SingleStore DB.

    sdb-admin stop-node --all
    

    Note: If fixing a cluster after one or more IP addresses were changed, perform a kill -9 PID on each host for each node.

    ps -aux | grep memsqld
    

    Locate the PID in the result of the command above.

    sudo kill -9 PID
    
  3. Re-IP the desired host(s).

  4. For each Child Aggregator, update the master-aggregator line in the memsql.cnf file to point to the new Master Aggregator. As the default path includes the version of SingleStore DB, which changes depending on which version you are on, this file resides in: /path/to/node-directory/memsql.cnf

  5. For each Child Aggregator, rename the data directory (such as data-bak). This will allow the Child Aggregator to contact the Master Aggregator and re-replicate. As the default path includes the version of SingleStore DB, which changes depending on which version you are on, this file resides in: /path/to/node-directory/memsql.cnf.

  6. Restart SingleStore DB.

    sdb-admin start-node --all
    
  7. Remove and re-add the leaf nodes from the Master Aggregator.

    For those databases using unlimited storage

    As databases that are using unlimited storage will refuse to attach orphan databases, the required ADD LEAF and  REMOVE LEAF commands for leaf nodes will fail to attach unlimited storage partitions. Therefore, each database using unlimited storage must first be detached before each leaf node can be removed and re-added to the cluster.

    Warning

    Failing to perform the following steps will take the cluster offline and will result in the loss of master partitions (data).

    1. First, detach all unlimited storage databases using the following SQL.

      DETACH DATABASE <database> AT MILESTONE “detached”;
    2. Next, for each leaf node in the cluster, remove and re-add the leaf node from the Master Aggregator using the following SQL.

      REMOVE LEAF '<old-ip>':port FORCE;
      
      ADD LEAF root@'<new-ip>':port;
    3. Finally, attach all unlimited storage databases using the following SQL.

      ATTACH DATABASE <database> ON <object-store-settings> AT MILESTONE “detached”;

    For those databases not using unlimited storage

    1. For each leaf in the cluster, remove and re-add the leaf from the Master Aggregator via the following SQL.

      REMOVE LEAF '<old-ip>':port FORCE;
      ADD LEAF root@'<new-ip>':port;
  8. On the SingleStore DB Toolbox host, re-register hosts with the new IP for SingleStore DB Toolbox. Note that this has no impact on the cluster itself, just the cluster management tools.

    sdb-admin stop-node --memsql-id
    
    sdb-toolbox-config unregister-host --host <host-IP-or-name>
    
    sdb-toolbox-config register-host --host <host-IP-or-name>
    
    sdb-admin start-node --memsql-id
    
  9. Confirm that all nodes are now up and running.

    sdb-admin list-nodes