我以前已经成功运行过zookeeper和kafka多次,并且我相信我的安装和配置是正确的。
我所做的唯一更改是对zookeeper配置文件的>
dataDir=/Users/garynackenson/Downloads/kafka_2.12-2.0.0/data/zookeeper
我为此创建了目录。
现在,当我运行zookeeper而不是将信息绑定到端口0.0.0.0/0.0.0.0:2181
我在下面收到错误消息,并且kafka失败,端口9092使用中出错(我重新启动了计算机,并以各种方式检查了一下,以了解端口9092未在使用中
下面来自zoopkeeper的最后一条消息,看起来不正确
INFO Established session 0x10000025c8a0001 with negotiated timeout 6000 for client /127.0.0.1:49977 (org.apache.zookeeper.server.ZooKeeperServer)
当Zookeeper以这种方式启动时,kafka失败,出现9092使用错误(请参阅下文)–我重新启动并检查我是否未使用端口9092。
org.apache.kafka.common.KafkaException: Socket server failed to bind to 0.0.0.0:9092: Address already in use.
过了一会儿,我看到了动物园管理员有一个不同的问题:
INFO Closed socket connection for client /0:0:0:0:0:0:0:1:49986 which had sessionid 0x100000b679d0000 (org.apache.zookeeper.server.NIOServerCnxn)
我再次跑了动物园管理员,看到了更多绑定到2081 4条消息的“正常”
[2018-10-03 18:25:08,064] INFO binding to port 0.0.0.0/0.0.0.0:2181 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-10-03 18:25:09,055] INFO Accepted socket connection from /127.0.0.1:50014 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-10-03 18:25:09,062] INFO Client attempting to renew session 0x10000025c8a0001 at /127.0.0.1:50014 (org.apache.zookeeper.server.ZooKeeperServer)
[2018-10-03 18:25:09,066] INFO Established session 0x10000025c8a0001 with negotiated timeout 6000 for client /127.0.0.1:50014 (org.apache.zookeeper.server.ZooKeeperServer)
但是kafka每次仍然失败
有时我启动Zookeeper时也会收到以下消息
[2018-10-03 18:10:36,097] INFO Got user-level KeeperException when processing sessionid:0x10000025c8a0001 type:delete cxid:0x47 zxid:0x179 txntype:-1 reqpath:n/a Error Path:/admin/preferred_replica_election Error:KeeperErrorCode = NoNode for /admin/preferred_replica_election (org.apache.zookeeper.server.PrepRequestProcessor)