简体   繁体   English

Zookeeper 拒绝来自旧客户端的 Kafka 连接

[英]Zookeeper refuses Kafka connection from an old client

I have a cluster configuration using Kubernetes on GCE, I have a pod for zookeeper and other for Kafka;我有一个在 GCE 上使用 Kubernetes 的集群配置,我有一个用于 zookeeper 的 pod 和其他用于 Kafka 的 pod; it was working normally until Zookeeper get crashed and restarted, and it start refusing connections from the kafka pod:它一直正常工作,直到 Zookeeper 崩溃并重新启动,它开始拒绝来自 kafka pod 的连接:

Refusing session request for client /10.4.4.58:52260 as it has seen zxid 0x1962630拒绝客户端/10.4.4.58:52260会话请求,因为它看到了zxid 0x1962630

The complete refusal log is here:完整的拒绝日志在这里:

2017-08-21 20:05:32,013 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /10.4.4.58:52260
2017-08-21 20:05:32,013 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@882] - Connection request from old client /10.4.4.58:52260; will be dropped if server is in r-o mode
2017-08-21 20:05:32,013 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@901] - Refusing session request for client /10.4.4.58:52260 as it has seen zxid 0x1962630 our last zxid is 0xab client must try another server
2017-08-21 20:05:32,013 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1008] - Closed socket connection for client /10.4.4.58:52260 (no session established for client)

Because the kafka maintain a zookeeper session which remember the last zxid it has seen.因为 kafka 维护一个动物园管理员会话,它记住它看到的最后一个 zxid。 So when the zookeeper sevice go down and come again, the zk's zxid begin from a smaller value.所以当zookeeper服务下来又来的时候,zk的zxid从一个较小的值开始。 and ZKserver think the kafka has seen a bigger zxid, so it refuse it.而ZKserver认为kafka看到了更大的zxid,所以拒绝了。

Have a try to restart the kafka.尝试重新启动 kafka。

For the record, I had this problem and all my kafka were off.作为记录,我遇到了这个问题,我所有的 kafka 都关闭了。
But, my kafka-manager was still up and listening on zookeepers.但是,我的 kafka 经理仍在倾听动物园管理员的声音。 Turning it off resolved the issue.关闭它解决了问题。

Related to the answer from @GuangshengZuo.... Steps与@GuangshengZuo 的回答有关.... 步骤

  1. Stop any residual zookeeper instances - zookeeper-server-stop.bat停止任何剩余的 zookeeper 实例 - zookeeper-server-stop.bat
  2. Start a fresh zookeeper- zookeeper-server-start.bat .\\config\\zookeeper.properties This will do启动一个新的zookeeper zookeeper-server-start.bat .\\config\\zookeeper.properties这样就可以了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM