我有两台服务器,一台运行 apache zookeeper,一台运行 Solr。启动 zookeeper 时,我可以在服务器一(通过 bin/zkCli.sh)上连接到它,但不能通过带有 solr 的服务器二。Zookeeper 是通过 启动的supervisor
,但我也尝试过在bind/zkServer.sh
没有改进的情况下启动它。在查看 tomcat 日志(Solr 正在登录)时,我得到:
WARNING: Overseer cannot talk to ZK
Jun 04, 2013 3:26:52 PM org.apache.solr.cloud.Overseer$ClusterStateUpdater amILeader
WARNING:
org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /overseer_elect/leader
at org.apache.zookeeper.KeeperException.create(KeeperException.java:127)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1151)
at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:253)
at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:250)
at org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:65)
at org.apache.solr.common.cloud.SolrZkClient.getData(SolrZkClient.java:250)
at org.apache.solr.cloud.Overseer$ClusterStateUpdater.amILeader(Overseer.java:199)
at org.apache.solr.cloud.Overseer$ClusterStateUpdater.run(Overseer.java:122)
at java.lang.Thread.run(Thread.java:722)
...
Jun 04, 2013 3:31:04 PM org.apache.zookeeper.ClientCnxn$SendThread logStartConnect
INFO: Opening socket connection to server XXX.XXX.XXX.XXX/XXX.XXX.XXX.XXX:2181. Will not attempt to authenticate using SASL (unknown error)
Jun 04, 2013 3:31:04 PM org.apache.zookeeper.ClientCnxn$SendThread run
INFO: Client session timed out, have not heard from server in 46974ms for sessionid 0x13f0f5a570c0006, closing socket connection and attempting reconnect
Jun 04, 2013 3:31:05 PM org.apache.zookeeper.ClientCnxn$SendThread logStartConnect
INFO: Opening socket connection to server XXX.XXX.XXX.XXXXXX.XXX.XXX.XXX.75:2181. Will not attempt to authenticate using SASL (unknown error)
Jun 04, 2013 3:32:01 PM org.apache.zookeeper.ClientCnxn$SendThread run
INFO: Client session timed out, have not heard from server in 56627ms for sessionid 0x13f0f5a570c0006, closing socket connection and attempting reconnect
如何设置zookeeper,使其可以被服务器2上的solr访问?
附加信息:netstat -l
在服务器一上使用,我得到以下信息:
tcp6 0 0 [::]:2181 [::]:* LISTEN
即它只监听tcp6,而不是tcp。