Performing cluster activation and topology changes
Activating a cluster using activate command
Here is the CLI to activate all the nodes of a cluster, in case the cluster is not yet CONFIGURED:
Syntax:
activate (-connect-to <hostname[:port]> | [-config-file <config-file>])
[-cluster-name <cluster-name>] [-license-file <license-file>]
[-restart-wait-time <restart-wait-time>] [-restart-delay <restart-delay>]
[-restrict]
Parameters:
-connect-to <hostname[:port]> Node to connect to
-cluster-name <cluster-name> Cluster name
-config-file Config file containing nodes to be activated
-license-file <license-file> License file
-restart-wait-time <restart-wait-time> Maximum time to wait for the nodes to restart. Default: 120s
-restart-delay <restart-delay> Delay before the server restarts itself. Default: 2s
-restrict Restrict the activation process to the node only
The activation process:
1. Validates the configuration consistency
2. Validates the license
3. Writes the validated cluster config inside the config directory of all nodes
4. Restarts the nodes
Once a cluster is activated, it becomes usable for Terracotta clients.
Adding nodes using the attach command
Here is the general CLI to attach/detach to update the topology:
Syntax:
attach (-to-cluster <hostname[:port]> -stripe <hostname[:port]> |
-to-stripe <hostname[:port]> -node <hostname[:port]>)
[-force] [-restart-wait-time <restart-wait-time>]
[-restart-delay <restart-delay>]
Parameters:
-stripe <hostname[:port]> Stripe to add
-to-cluster <hostname[:port]> Destination cluster
-node <hostname[:port]> Node to add
-to-stripe <hostname[:port]> Destination stripe
-restart-delay <restart-delay> Delay before the server restarts itself
-restart-wait-time <restart-wait-time> Maximum time to wait for the nodes to restart
-force Force the operation
Examples:
1. Attaching 2 UNCONFIGURED nodes to form a single stripe:
# We start an UNCONFIGURED node
> start-tc-server.sh -name=node-1 -y availability -hostname=10.0.0.1 -config-dir=/path/to/node-1-config-dir
# we start another UNCONFIGURED node
> start-tc-server.sh -name=node-2 -y availability -hostname=10.0.0.2 -config-dir=/path/to/node-2-config-dir
# we attach node 2 in the same stripe as node 1
> config-tool.sh attach -to-stripe 10.0.0.1 -node 10.0.0.2
2. Attaching a node to a stripe:
# Continuing from the previous example, we start a third UNCONFIGURED node
> start-tc-server.sh -name=node-3 -y availability -hostname=10.0.0.3 -config-dir=/path/to/node-3-config-dir
# we attach node 3 in the same stripe as node 1
> config-tool.sh attach -to-stripe 10.0.0.1 -node 10.0.0.3
3. Attaching a stripe to a cluster:
# Continuing from the previous example, we start 3 more UNCONFIGURED nodes
> start-tc-server.sh -name=node-4 -y availability -hostname=10.0.0.4 -config-dir=/path/to/node-4-config-dir
> start-tc-server.sh -name=node-5 -y availability -hostname=10.0.0.5 -config-dir=/path/to/node-5-config-dir
> start-tc-server.sh -name=node-6 -y availability -hostname=10.0.0.6 -config-dir=/path/to/node-6-config-dir
# we attach these nodes together to form a stripe
> config-tool.sh attach -to-stripe 10.0.0.4 -node 10.0.0.5
> config-tool.sh attach -to-stripe 10.0.0.4 -node 10.0.0.6
# we attach this stripe to the cluster formed in the previous example
> config-tool.sh attach -to-cluster 10.0.0.1 -stripe 10.0.0.4
Removing nodes using the detach command
Syntax:
> config-tool.sh detach (-from-cluster <hostname[:port]>
-stripe <hostname[:port]> | -from-stripe <hostname[:port]> -node <hostname[:port]>)
[-force] [-stop-wait-time <restart-wait-time>] [-stop-delay <stop-delay>]
Parameters:
-stripe <hostname[:port]> Stripe to remove
-from-cluster <hostname[:port]> Destination cluster
-node <hostname[:port]> Node to remove
-from-stripe <hostname[:port]> Destination stripe
-stop-delay <stop-delay> Delay before the server stops itself. Default: 2s
-stop-wait-time <stop-wait-time> Maximum time to wait for the nodes to stop. Default: 120s
-force Force the operation
Examples
1. Detaching a node from a stripe before cluster activation:
> config-tool.sh detach -from-stripe 10.0.0.1 -node 10.0.0.2
2. Detaching a stripe from a cluster before cluster activation:
> config-tool.sh detach -from-cluster 10.0.0.1 -stripe 10.0.0.4