Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't run zookeeper

i am new to the kafka world, i want to start zookeeper then when i type this

bin/zookeeper-server-start.sh config/zookeeper.properties

I got the following error

ERROR Unexpected exception, exiting abnormally  (org.apache.zookeeper.server.ZooKeeperServerMain)
java.net.BindException: Address already in use

ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.net.BindException: Address already in use

Then i tried netstat -nlp|grep 2181 but there is no process running

tcp        0      0 0.0.0.0:2181            0.0.0.0:*               LISTEN      -  

Some light please

like image 372
user3623460 Avatar asked Apr 08 '17 12:04

user3623460


2 Answers

For this case, You need to see if zookeeper is running or not

use below command

sudo lsof -i :2181

You will get

COMMAND   PID      USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java     1005 zookeeper   33u  IPv6  17209      0t0  TCP *:2181 (LISTEN)
java     1005 zookeeper   34u  IPv6 327225      0t0  TCP localhost:2181->localhost:43566 (ESTABLISHED)
java    22585      root   88u  IPv6 324552      0t0  TCP localhost:43566->localhost:2181 (ESTABLISHED) 

like statement. Now kill the zookeeper to start again.

sudo kill -9 1005

Then use below to start zookeeper

bin/zookeeper-server-start.sh config/zookeeper.properties
like image 67
Sanjay Kumar Das Avatar answered Sep 30 '22 17:09

Sanjay Kumar Das


First, stop the Zookeeper with the command below:

$ bin/zookeeper-server-stop.sh config/zookeeper.properties

Then, start it again and you should be good to go:

$ bin/zookeeper-server-start.sh config/zookeeper.properties
like image 21
Heisenberg Avatar answered Sep 30 '22 17:09

Heisenberg