身份验证失败zk会话超时问题

时间:2016-05-16 10:37:07

标签: go apache-kafka apache-zookeeper session-timeout zk

我正在使用 samuel的go-zookeeper 并遇到"身份验证失败:zk:会话已被服务器过期" 问题。遇到此问题后,它会重新尝试重新连接到zookeeper并成功连接。但问题是它再次出现"身份验证失败" 问题或无法注册消费者。此外,如果它确实成功连接并且经过身份验证,则消费者永远不会将消息视为"当前已注册的消费者:0" ,除非我手动重新启动客户端,否则此过程将继续。

可能是什么问题及其解决方案?

这是日志:

[Scheduler] 2016/05/15 04:49:20 structs.go:21: Recv loop terminated: err=read tcp 10.244.0.9:41810->10.0.30.4:2181: i/o timeout
[Scheduler] 2016/05/15 04:49:24 structs.go:21: Send loop terminated: err=<nil>
[Scheduler] 2016/05/15 04:49:26 structs.go:21: Connected to 10.0.30.4:2181
[Scheduler] 2016/05/15 04:49:53 structs.go:21: Authentication failed: read tcp 10.244.0.9:43854->10.0.30.4:2181: i/o timeout
[Scheduler] 2016/05/15 04:49:57 structs.go:21: Connected to 10.0.30.4:2181
[Scheduler] 2016/05/15 04:50:25 structs.go:21: Authentication failed: read tcp 10.244.0.9:43863->10.0.30.4:2181: i/o timeout
[Scheduler] 2016/05/15 04:50:32 structs.go:21: Connected to 10.0.30.4:2181
[Scheduler] 2016/05/15 04:51:06 structs.go:21: Authentication failed: read tcp 10.244.0.9:43873->10.0.30.4:2181: i/o timeout
[Scheduler] 2016/05/15 04:51:55 structs.go:21: Connected to 10.0.30.4:2181
[Scheduler] 2016/05/15 04:52:08 structs.go:21: Authentication failed: zk: session has been expired by the server
[Sarama] 2016/05/15 04:52:08 [controller/fa956f688354] Triggering rebalance due to consumer list change
[Scheduler] 2016/05/15 04:52:10 structs.go:21: Connected to 10.0.30.4:2181
[Scheduler] 2016/05/15 04:52:10 structs.go:21: Authenticated: id=95829041879007139, timeout=4000
[Sarama] 2016/05/15 04:52:10 [controller/fa956f688354] Currently registered consumers: 0
[Sarama] 2016/05/15 04:52:10 [controller/fa956f688354] topic :: Started topic consumer
[Sarama] 2016/05/15 04:52:10 [controller/fa956f688354] topic :: Stopped topic consumer
[Sarama] 2016/05/15 04:53:22 client/metadata fetching metadata for all topics from broker 10.0.30.4:9092
[Sarama] 2016/05/15 05:03:23 client/metadata fetching metadata for all topics from broker 10.0.30.4:9092
.
.
.
[Sarama] 2016/05/15 04:53:22 client/metadata fetching metadata for all topics from broker 10.0.30.4:9092

1 个答案:

答案 0 :(得分:0)

我没有使用过塞缪尔的动物园管理员。但是,您正在尝试连接到kafka服务器并与之建立连接。为实现这一目标,我使用了samara ,它易于使用且可靠。

Here一些例子。