ALTER NODE

While each node in a cluster resides on a specific host, the host itself can be part of multiple networks, both internal and external, and thus can be addressed by multiple hostnames and/or IP addresses. By extension, each node that resides on this type of host can also be addressed by multiple hostnames and/or IP addresses, both internal and external.

The ALTER NODE command can be used to set:

  • An external hostname or IP address with which to address a node.

  • An external port with which to connect to a node.

  • The internal host or port metadata of the leaf node in the cluster.

Syntax

ALTER NODE <host>:<port>
{ SET EXTERNAL_HOST=<external_host>, EXTERNAL_PORT=<external_port> |
SET [HOST=<internal_host>,] PORT=<internal_port>
}

Arguments

  • <host>: The node’s host (hostname or IP address).

  • <port>: The node’s port on the host.

  • <external_host>: The external host (hostname or IP address) with which to address the node.

  • <external_port>: The external port with which to connect to the node.

  • <internal_host>: New internal hostname or IP address for the node.

  • <internal_port>: New internal port on which the node listens for cluster traffic.

Remarks

  • If only updating the host, <port> and <external_port> can be the same value.

  • If only updating the port, <host> and <external_host> can be the same value.

  • The ALTER NODE command is used when the secondary cluster connects to the primary cluster during disaster recovery (DR) replication.

    • DR connections are made from nodes on the secondary cluster to nodes on the primary cluster.

    • The nodes on the secondary cluster use the external host and external port to make these connections.

    • If the host and/or port are not specified, the host and/or port are used that were initially defined when the leaf node was added to the cluster.

  • The SingleStore database user must have the CLUSTERprivilege to run the ALTER NODE command.

  • The ALTER NODE command returns an error if the external host (hostname or IP address) and/or port are already in use.

Update Internal Host or Port

SET HOST/PORT operates on the cluster metadata and it does not change the node's process host/port itself. You must update the node's configuration (in the memsql.cnf file) and restart the node to apply the updates.

Perform the following tasks to update the internal host or port of a node:

  1. Detach and then stop the leaf node. Run sdb-admin list-nodes to get the node's MemSQL ID.

    -- Detach the leaf node from the cluster
    DETACH LEAF '<host>':<port>;
    # Stop the node
    sdb-admin stop-node --memsql-id <node_memsql_id>
  2. Update the host/port configuration in the memsql.cnf file of the stopped leaf node.

  3. Run the ALTER NODE command to update the cluster metadata. For example:

    ALTER NODE '<host>':<port> SET HOST '<new_host>', PORT <new_port>;
  4. Start the leaf node.

    sdb-admin start-node --memsql-id <node_memsql_id>
  5. Attach the leaf node to the cluster, without rebalancing.

    ATTACH LEAF '<new_host>':<new_port> NO REBALANCE;
  6. Perform steps 1 to 5 for each target node to update, and then rebalance all databases.

    REBALANCE ALL DATABASES;

This workflow keeps all the database partitions on their existing leaves during host/port change and defers the data movement to a single rebalance operation.

Examples

ALTER NODE '127.0.0.1':3306 SET EXTERNAL_HOST='127.0.0.1', EXTERNAL_PORT=3316;
Query OK, 0 rows affected (7 ms)

To change the internal host or port of a node, follow the instructions in Update Internal Host or Port.

REPLICATE DATABASE

Last modified:

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK

Try Out This Notebook to See What’s Possible in SingleStore

Get access to other groundbreaking datasets and engage with our community for expert advice.