Skip to main content
Version: 10.3.3

Change settings in ZooKeeper

If you want to change ZooKeeper settings and don't have ZooNavigator installed, you can use zkCli.sh, the ZooKeeper command-line tool. The utility is installed along with ZooKeeper on the Master server to the PACKAGE_DIR/zookeeper/bin directory during the Work.AI 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} is localhost: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 /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 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/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
  • To set jvm.parameters, execute the following:

    [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
    caution

    Remember to add space before the -D value to avoid errors. For example, " -Dlogging.logstash.endpoint=HOST:4570".

info

Starting from Work.AI v10.3.3, the workfusion.properties file for advanced Control Tower configuration is not supported. You can manage the properties that used be in the file through ZooKeeper. The node name is config/control-tower/.