Why won't the pipeline contents for the nc command work?

I am trying to get zookeeper stat from shell using nc,

call nc localhost 2181then enter: stat .

but echo "stat" | nc localhost 2181returns nothing.

why?

+4
source share
2 answers

Asked the same question in the Zookeeper mailbox list and received the following:

Most likely you are using the wrong "nc" command.

: P "nc", . debian- netcat-openbsd netcat-, netcat CentOS ( , ), , .

-

, nc nc.openbsd, nc.traditional,

echo "stat" | nc.traditional 10.18.10.30 2181

.

+4

, -q nc .

echo "ruok" | nc -q 2 localhost 2181 Ubuntu. , -w -q OpenBSD.

+4

Source: https://habr.com/ru/post/1527436/


All Articles