【问题标题】:Error when creating Collection with SolrCloud and Zookeeper使用 SolrCloud 和 Zookeeper 创建集合时出错
【发布时间】:2016-08-21 21:53:13
【问题描述】:

我正在尝试使用 Vagrant 测试 SolrCloud。我让 Zookeeper 在一个盒子上运行,而 Solr 在另一个盒子上运行。这些盒子位于专用网络上(我可以从每个盒子 ssh 进入其中一个)。

当我尝试通过 Solr CLI 创建一个集合时,它会超时,我想它是在尝试与 Zookeeper 通信时。

Zookeeper 正在按预期运行。我使用以下命令在前台模式下启动它:

sudo bin/zkServer.sh start-foreground

我的 zoo.cfg 文件:

tickTime=2000
dataDir=/var/lib/zookeeper/1
clientPort=2181
server.1=localhost:2888:3888

然后我在云模式下启动 Solr:

 bin/solr start -c -z 172.28.128.3:2181

在这一点上,一切似乎都很好。 Solr 日志中没有显示任何不良信息,Zookeeper 的控制台中也没有出现任何警告消息。

然后我尝试使用以下命令创建一个集合:

  bin/solr create -c mycollection -d data_driven_schema_configs

然后我开始在 Solr 日志中看到很多错误,并且 Zookeeper 中出现了很多重复的消息:

这两个 Solr 错误反复出现:

 java.io.IOException: Xid out of order. Got Xid 1299 with err 0
 expected Xid 1298 for a packet with details: clientPath:null
 serverPath:null finished:false header:: 1298,14  replyHeader:: 0,0,-4 
 request:: org.apache.zookeeper.MultiTransactionRecord@95acc4f3
 response:: org.apache.zookeeper.MultiResponse@0

 There was a problem trying to register as the leader:org.apache.solr.common.SolrException: 
 Could not register as the leader because creating the ephemeral registration 
 node in ZooKeeper failed

这是来自 Zookeeper 的:

[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory@251] - Accepted socket connection from /172.28.128.4:54548
2016-08-21 21:33:39,137 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@770] - Client attempting to renew session 0x156aefeba2d0004 at /172.28.128.4:54548
2016-08-21 21:33:39,145 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1580] - Established session 0x156aefeba2d0004 with negotiated timeout 15000 for client /172.28.128.4:54548
2016-08-21 21:33:39,147 - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@593] - Dropping packet at server of type 14
2016-08-21 21:33:39,154 - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@634] - EndOfStreamException: Unable to read additional data from client sessionid 0x156aefeba2d0004, likely client has closed socket
2016-08-21 21:33:39,155 - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1435] - Closed socket connection for client /172.28.128.4:54548 which had sessionid 0x156aefeba2d0004
2016-08-21 21:33:40,698 - INFO

我不明白这里发生了什么。我觉得关键在于那个 Solr 错误:

Could not register as the leader because creating the ephemeral registration node in ZooKeeper failed

但是在搜索该错误时,我找不到任何有用的东西。谁能解释一下这里发生了什么?

【问题讨论】:

    标签: solr apache-zookeeper solrcloud


    【解决方案1】:

    将 solr 配置文件上传到 zookeeper 并尝试 check here

    $  sh zkcli.sh -cmd upconfig -zkhost  <host:port> -confname <name for configset> -solrhome <solrhome> -confdir <path to directory with configset>
    

    【讨论】:

    • 感谢您的回复。文档建议命令 bin/solr create -c mycollection -d data_driven_schema_configs 应该将配置文件上传到 Zookeeper 作为集合创建过程的一部分。这不正确吗?您给出的命令似乎正在运行(至少 Zookeeper 中没有出现错误),但是没有创建名为 /configs/mycollection 的文件夹...
    【解决方案2】:

    这里的问题是我使用的 Zookeeper (3.3.6) 版本与当前版本的 Solr (6.1.0) 不兼容。

    Solr 试图使用该版本 Zookeeper 没有的功能,因此失败了。

    升级到 Zookeeper 3.4.8 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2016-08-23
      • 2015-01-24
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      • 2014-08-07
      • 1970-01-01
      • 2015-09-12
      • 1970-01-01
      相关资源
      最近更新 更多