Terracotta Ehcache 10.7 | Terracotta Server Administration Guide | Config Tool | Performing configuration changes
 
Performing configuration changes
Retrieving cluster configuration using get command
Syntax:
get -connect-to <hostname[:port]> [-runtime]
-setting <[namespace:]setting>,<[namespace:]setting>...
Parameters:
*-connect-to <hostname[:port]>
The node to connect to
*-setting <[namespace:]setting>,<[namespace:]setting>...
List of settings to get
*-runtime
Get the runtime value of the setting
Note:
namespace determines the scope of the update. The format can be stripe.<stripeId>.node.<nodeId>: to apply a change only on a specific node, or stripe.<stripeId>: to apply a change only on the nodes on a stripe, or no namespace to apply a change on all nodes of the cluster.
The namespace depends on the setting: some settings can only be applied cluster-wide, some per node or per stripe.
Examples:
1. Get the value of a setting from a cluster:
> config-tool.sh get -connect-to 10.0.0.1 -setting offheap-resources.foo
offheap-resources=foo:512MB
2. Get the values of some offheap resources on a cluster:
> config-tool.sh get -connect-to 10.0.0.1 -setting offheap-resources.foo -setting offheap-resources.bar
offheap-resources.foo=512MB
offheap-resources.bar=128MB
3. Get the values of all the offheap resources on a cluster:
> config-tool.sh get -connect-to 10.0.0.1 -setting offheap-resources
offheap-resources=foo:512MB,bar:128MB,baz:64MB
Updating settings with set command
Syntax:
set -connect-to <hostname[:port]> -setting <[namespace:]setting=value>,<[namespace:]setting=value>...
Parameters:
*-connect-to <hostname[:port]>
The node to connect to
*-setting <[namespace:]setting=value>,<[namespace:]setting=value>…​
List of settings with their values to be set
Examples:
1. Set some settings on a cluster:
> config-tool.sh set -connect-to 10.0.0.1 -setting offheap-resources.foo=512MB
2. Set offheap-resource bar to 512MB and foo to 1GB in the cluster:
> config-tool.sh set -connect-to 10.0.0.1 -setting offheap-resources.foo=1GB -setting offheap-resources.bar=512MB
Note:
The CLI supports several -setting <setting> parameters, to set or unset several settings at once. They together form a "change-set" which is either applied fully or not applied at all.
Removing settings with the unset command
Syntax:
unset -connect-to <hostname[:port]> -setting <[namespace:]setting>,<[namespace:]setting>...
Parameters:
*-connect-to <hostname[:port]>
The node to connect to
*-setting <[namespace:]setting>,<[namespace:]setting>...
List of settings to be unset
Examples:
1. Remove logger-overrides from a node:
> config-tool.sh unset -connect-to 10.0.0.1 -setting stripe.1.node.1:logger-overrides
2. Remove backup-dir from a cluster:
> config-tool.sh unset -connect-to 10.0.0.1 -setting backup-dir
Exporting cluster configuration
Syntax:
export -connect-to <hostname[:port]> [-output-file <config-file>] [-include-defaults] [-runtime]
Parameters:
*-connect-to <hostname[:port]>
The target cluster to export
*-output-file <config-file>
The output config file. If this option is not specified, the configuration is displayed on the console.
*-include-defaults
Include the settings having system default values as well. Default: false
*-runtime
Export the runtime config instead of the on-disk config. Default: false
Examples:
1. Export the configuration of a single stripe cluster containing two nodes, and display it on the console:
> config-tool.sh export -connect-to 10.0.0.1

cluster-name=my-cluster
failover-priority=consistency:3
authc=file
ssl-tls=true

stripe.1.node.1.hostname=1.company.internal
stripe.1.node.1.name=node-1
stripe.1.node.1.audit-log-dir=%H/terracotta/audit
stripe.1.node.1.security-dir=%H/terracotta/security
stripe.1.node.2.hostname=2.company.internal
stripe.1.node.2.name=node-2
stripe.1.node.2.port=9510
stripe.1.node.2.group-port=9530
stripe.1.node.2.audit-log-dir=%H/terracotta/audit
stripe.1.node.2.security-dir=%H/terracotta/security
2. Export the configuration of a cluster containing node with address 10.0.0.1, and save it in a file:
> config-tool.sh export -connect-to 10.0.0.1 -output-file=/path/to/destination/config-file
Importing cluster configuration
The cluster configuration in config file format can be imported on to running nodes of an unconfigured cluster to define its topology and configuration.
Syntax:
> import -config-file <config-file> [-node <hostname[:port]>]
Parameters:
*-config-file <config-file>
The config file to import the configuration from
*-node <hostname[:port]>
Node to connect to