參考:http://www.javashuo.com/article/p-zrsmulrt-es.htmljava
https://kafka.apache.org/quickstartlinux
關閉zookeeper bin/zookeeper-server-stop.sh
apache
關閉kafka bin/kafka-server-stop.sh
segmentfault
[2018-04-08 11:20:32,999] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn) java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
上面問題說明沒法鏈接到zookeeper服務中,緣由是沒有啓動zk,或者啓動zk後又關閉了socket
一、單獨在一個linux終端運行bin/zookeeper-server-start.sh config/zookeeper.properties
啓動zk,再開一個linux終端啓動kakfa服務,而後再開一個linux終端建立topicui
二、使用守護進程啓動zk和kafka.net
bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
code
bin/kafka-server-start.sh -daemon config/server.properties
server