Kafka对侦听器配置没有反应

时间:2017-12-20 12:31:50

标签: apache-kafka

使用kafka config:

# The address the socket server listens on. It will get the value returned from
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://:9092

Netstat给了我这个:

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::9999                 :::*                    LISTEN

一切都是默认的,kafka版本是kafka_2.11-0.11.0.2。 我希望kafka能够收听端口9092

1 个答案:

答案 0 :(得分:0)

端口9999是JMX,kafka因其他原因无法启动。

我在我的系统上这样做了:

sudo -u kafka /opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties

当然可以:

java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

这意味着我没有运行zookeeper,然后是zookeper日志:

Exception causing close of session 0x0 due to java.io.IOException: ZooKeeperServer not running

现在我需要在其他节点上启动zookeeper。最后卡夫卡已经开始了。

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::9092                 :::*                    LISTEN