Custom Search

Friday, March 6, 2015

OpenContrail ZooKeeper Client

a)
Find zookeeper Cli

#locate zkCli

b)
Find process ID of zookeeper

#sudo ps -aux | grep zoo

c)
Find port of zookeeper using process ID

#sudo netstat -tuplen | grep 3876
tcp6       0      0 :::2181                 :::*                    LISTEN      1000       14046       3876/java      
tcp6       0      0 :::33040                :::*                    LISTEN      1000       13626       3876/java

* Two instance (port 2181 and 33040) of zookeeper service are running

d)
Connect to zookeeper server

#cd /opt/stack/contrail/third_party/zookeeper-3.4.6/bin/
#./zkCli.sh -server 192.168.56.102:2181


* http://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html

e)
Get zookeeper Cli commands

[zk: 192.168.56.102:2181(CONNECTED) 0] help

f)
List path

[zk: 192.168.56.102:2181(CONNECTED) 13] ls /[svc-monitor, id, schema-transformer, fq-name-to-uuid, api-server, zookeeper]

* schema-transformer creates "/id"

[zk: 192.168.56.102:2181(CONNECTED) 13] ls /fq-name-to-uuid

[zk: 192.168.56.102:2181(CONNECTED) 13] ls /id

[zk: 192.168.56.102:2181(CONNECTED) 13] ls /schema-transformer

[zk: 192.168.56.102:2181(CONNECTED) 13] ls /svc-monitor

g)
Get data from path


* Get ID of default IPAM "default-network-ipam" in the "default-project" project.
[zk: 192.168.56.102:2181(CONNECTED) 36] get /fq-name-to-uuid/network_ipam:default-domain:default-project:default-network-ipam
0bee2fa4-766d-438f-9991-0fe4b34577b8

* Get ID of IPAM "ipam333" in the "admin" project.
[zk: 192.168.56.102:2181(CONNECTED) 37] get /fq-name-to-uuid/network_ipam:default-domain:admin:ipam333
1d54fc41-8697-4747-ab1f-f85ad53ac59d

h)
Set data


* Set ID of IPAM "ipam333" in the "admin" project.
[zk: 192.168.56.102:2181(CONNECTED) 44] set /fq-name-to-uuid/network_ipam:default-domain:admin:ipam333 1d54fc41-8697-4747-ab1f-f85ad53ac599




No comments:

Post a Comment