Change settings in ZooKeeper
If you want to change ZooKeeper settings and don't have installed ZooNavigator, you can use the zkCli.sh, a ZooKeeper command-line tool. The utility is installed along with ZooKeeper on the Master server to the PACKAGE_DIR/zookeeper/bin directory during the IA Cloud setup.
To connect to ZooKeeper, log in via SSH to the Master server and run the following commands as WFUSER:
$ cd /opt/workfusion/zookeeper/bin
$ ./zkCli.sh -server {server_name}
Here, {server_name} is the host and the port of ZooKeeper on the Master server:
- For the non-HA mode, the default
{server_name}islocalhost:2181. - For the HA mode,
{server_name}is the connection string that consists of three addresses and ports of all ZooKeeper instances, separated with a comma.
note
The following examples are for the non-HA mode only.
To view the existing records in a specific node, run the following command:
$ ./zkCli.sh -server localhost:2181 ls /<path to the node with the required records> # for example ./zkCli.sh -server localhost:2181 ls /configTo create a new node, run the following command:
$ ./zkCli.sh -server localhost:2181 create /<name of the node> "<data to be placed in the node>" # for example ./zkCli.sh -server localhost:2181 create /config/test "test data for config test"To view a specific node, run the following command:
$ ./zkCli.sh -server localhost:2181 get /<name of the node> # for example ./zkCli.sh -server localhost:2181 get /config/testTo change a node, run the following command:
$ ./zkCli.sh -server localhost:2181 set /<name of the node> "<new data>" # for example ./zkCli.sh -server localhost:2181 set /config/test "updated 1.1.1"To delete a node, run the following command:
$ ./zkCli.sh -server localhost:2181 delete /<name of the node> # for example ./zkCli.sh -server localhost:2181 delete /config/test
Starting from v.10.2, you can set jvm.parameters with zkCli.sh:
[zk: localhost:2181(CONNECTED) 1] create “/config/worker-management-service/bep.wms.worker.execute/jvm.parameters” “ -Dlogging.logstash.endpoint=HOST:4570"
org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -Dlogging.logstash.endpoint=HOST:4570
warning
Remember to mandatorily place space before the -D value to avoid errors. For example, " -Dlogging.logstash.endpoint=HOST:4570".