2181
:
xxxxxxxxxx
$ netstat -l | grep 2181
xxxxxxxxxx
tcp6 0 0 [::]:2181 [::]:* LISTEN
xxxxxxxxxx
$ netstat -ape | grep 2181
xxxxxxxxxx
$ netstat -ape | awk '{if ($5 == "localhost:2181") print $4, $9;}'
zoo.cfg
" file:xxxxxxxxxx
4lw.commands.whitelist=*
zookeeper.4lw.commands.whitelist
nc
command:
xxxxxxxxxx
$ echo "srvr" | nc localhost 2181
xxxxxxxxxx
Zookeeper version: 3.6.1-390fe37ea45dee01bf87dc1c042b5e3dcce88653, built on 05/03/2019 12:07 GMT
Latency min/avg/max: 0/0/0
Received: 3
Sent: 2
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: standalone
Node count: 5
xxxxxxxxxx
$ echo "stat" | nc localhost 2181
xxxxxxxxxx
Zookeeper version: 3.6.1-390fe37ea45dee01bf87dc1c042b5e3dcce88653, built on 05/03/2019 12:07 GMT
Clients:
/127.0.0.1:37924[0](queued=0,recved=1,sent=0)
Latency min/avg/max: 0/0/0
Received: 4
Sent: 3
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: standalone
Node count: 5
xxxxxxxxxx
$ echo "cons" | nc localhost 2181
xxxxxxxxxx
/127.0.0.1:37926[0](queued=0,recved=1,sent=0)
telnet
command to connect to the client port and execute the command srvr
:
xxxxxxxxxx
$ telnet localhost 2181
xxxxxxxxxx
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
srvr
Zookeeper version: 3.6.1-390fe37ea45dee01bf87dc1c042b5e3dcce88653, built on 05/03/2019 12:07 GMT
Latency min/avg/max: 0/0/0
Received: 7
Sent: 6
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: standalone
Node count: 5
Connection closed by foreign host.