I am inside docker and I have installed zookeeper and trying to test it using telnet But it is not working

$ telnet localhost 2181
Trying ::1...
telnet: Unable to connect to remote host: Connection refused

I tried these also

telnet 2181
telnet 2181

But same error.

netstat status

# netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

Please help.


Verify zookeeper is actually running, via

ps aux | grep -i zookeeper

If it is, then it may not be bound to or So check which IP address it's actually bound to,

netstat -tlpn

Then try to telnet to it using that address.

  • Just now I found even telnet locahost is not working. Has same error.
    – Avinash
    Feb 3 '17 at 3:53
  • Simply using telnet localhost would attempt to connect to a local server process listening port 23. Most servers/containers I know don't enable telnet servers by default since it's insecure.
    – TLin
    Feb 3 '17 at 4:02
  • Any idea how to fix it.
    – Avinash
    Feb 3 '17 at 4:25
  • Can you update your post with the output of netstat -tlpn
    – TLin
    Feb 3 '17 at 5:02
  • I have updated.
    – Avinash
    Feb 3 '17 at 5:35

check your ubuntu system log with this command

sudo gedit /var/log/syslog

and if you will see this error "execv( /usr/sbin/tcpd ) failed: No such file or directory" then run this command

sudo apt-get install tcpd

it will solve your problem (if not then you need to search your system error on google)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.