Zookeeper Administrator's Guide How to Start and Stop Zookeeper in Linux
Based on the type of zookeeper package you have installed, start and stop differs.
Method 1 – Separate Zookeeper package
In this example the package is extracted inside /apps/zookeeper
Start Zookeeper : #/apps/zookeeper/bin/zkCli.sh start
Check if its listening : #echo “ruok” | nc localhost 2181 ; echo
Note: If you have not enabled 4lw commands, the above “ruok” will not work. Check how to enable 4lw commands.
Stop Zookeeper : #/apps/zookeeper/bin/zkCli.sh stop
Method 2 – Zookeeper which comes with Kafka package.
In this example the package is extracted inside /apps/kafka. Navigate to /apps/kafka and run the below command.
Start Zookeeper : #/bin/zookeeper-server-start.sh -daemon /apps/kafka/config/zookeeper.properties
Note:using -daemon switch above, telling to start the process in the background.
Check if its listening : #echo “ruok” | nc localhost 2181 ; echo
Note: If you have not enabled 4lw commands, the above “ruok” will not work. Check how to enable 4lw commands.
Start Zookeeper : #/apps/kafka/bin/zookeeper-server-stop.sh