Change settings in ZooKeeper
If you want to change settings in ZooKeeper and don't have installed ZooNavigator, you can use the zkCli.sh (ZooKeeper CLI) tool. The utility is installed along with ZooKeeper on the INT server to the PACKAGE_DIR/zookeeper/bin directory during the IA Cloud setup.
To connect to ZooKeeper, log in to the INT server via SSH 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 INT 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