14

I have an Ubuntu-12.04 VM running on my laptop.I have installed zookeeper on it using the command

sudo apt-get install zookeeper

Now for traditional Ubuntu programs I check the version using --version command line option. For example

gcc --version

gives the version of gcc as 4.6.3 (for e.g)

Similarly how do I find out the version of zookeeper? First of all it doesn't have a binary called zookeeper. It does have a binary called zooinspector which does not respond to `--version.

I am very new to zookeeper. Any help would be appreciated.

1

1 Answer 1

29

First you need to have a running Zookeeper server-instance.

Open a terminal, and start the Zookeeper server:

/usr/share/zookeeper/bin/zkServer.sh start-foreground

Note: Zookeeper will not start unless it can write to it's datadir and logfile.

Open another terminal, and replace zkserver1 with the hostname\ip eg. 127.0.0.1 :

echo ruok | nc zkserver1 2181
echo status | nc zkserver1 2181

First line should respond with imok Second line should respond with Zookeeper version + more.

3
  • Is it OK to run this on prod server, while another instance of Zk is running? Commented May 13, 2015 at 11:31
  • 3
    @ivanbalashow You shouldn't need to start another instance, so go straight to echo ... should be fine. If Zookeeper is installed through apt, you can also run apt-cache policy zookeeper to see it's version. Commented May 14, 2015 at 19:20
  • 1
    Thanks , echo status | nc <zookeeper-server> 2181 worked for me. Commented Jul 3, 2015 at 10:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .