Change settings in Zookeeper
If you want to change Zookeeper settings and don't have installed Zoonavigator, you may 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, 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.
The following examples are for the non-HA mode only.
To view the existing records in a specific node Zookeeper, 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 /config
To 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 the 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/test
To 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 with 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".