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

Big*_*her 1 apache-kafka kubernetes apache-zookeeper

我在GCE上使用Kubernetes进行了集群配置,我为Zookeeper和Kafka提供了一个pod。在Zookeeper崩溃并重新启动之前,它一直工作正常,并且开始拒绝来自kafka pod的连接:

拒绝对客户端的会话请求/10.4.4.58:52260,因为它已经看到 zxid 0x1962630

完整的拒绝日志在这里:

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)
Run Code Online (Sandbox Code Playgroud)

Gua*_*Zuo 5

因为kafka维护一个zookeeper会话,该会话会记住它所看到的最后一个zxid​​。因此,当动物园管理员的服务下降并再次出现时,zk的zxid从较小的值开始。ZKserver认为kafka看到了更大的zxid,因此拒绝了它。

尝试重新启动kafka。