我正在使用samuel的GoZooKeeper,遇到了“身份验证失败: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条答案
按热度按时间whhtz7ly1#
我没用过塞缪尔的围棋。但是,您正在尝试连接到kafka服务器并与建立连接。为了实现这一点,我使用了萨马拉,这是易于使用和可靠的。
这里有一些例子。