简体   繁体   English

Solr - Collections API超时

[英]Solr - Collections API timeouts

I've got a setup with 3x zoo keeper's and 4x solrcloud node's. 我有一个3x动物园饲养员和4x solrcloud节点的设置。

This is all working, all nodes are seeing each other and I initially had a default collection. 这一切都正常,所有节点都相互看到,我最初有一个默认集合。

From there, I used the collections API to create a new collection which successfully completed and all it's successfully sharded across 2 nodes, with the other 2 being used for replica's. 从那里开始,我使用集合API创建了一个新的集合,该集合已成功完成,并且它在2个节点上成功分片,另外2个用于副本。 I can also successfully save documents to that collection. 我也可以成功地将文档保存到该集合中。 Browsing the solr web GUI on any of the boxes all works, no speed issues. 在任何一个盒子上浏览solr web GUI都可以正常工作,没有速度问题。

However, anytime I try to use the collections API I get timeouts. 但是,无论何时我尝试使用集合API,我都会收到超时。 Creating a new collection, reloading one of the existing collections, deleting a collection... all of them timeout. 创建一个新集合,重新加载一个现有集合,删除一个集合......所有这些集合都超时。

Any thoughts on why would be much appreciated 任何关于为什么会被赞赏的想法

Cheers 干杯

Such timeout can occur when Solr is not able to obtain cluster state. 当Solr无法获得群集状态时,可能会发生此类超时。 If following call is results in timeout, then this is the case 如果跟随调用导致超时,则情况就是这样

http://solr-hostname:8983/solr/admin/collections?action=CLUSTERSTATUS&wt=json

This may be caused by incorrect entries present in /clusterstate.json 这可能是由/clusterstate.json存在的错误条目引起的

To fix this: 解决这个问题:

  • get clusterstate from ZooKeeper by calling 通过调用从ZooKeeper获取clusterslate

     zkcli.sh -zkhost localhost:2181 -cmd get /clusterstate.json > clusterstate.json 
  • edit extracted clusterstate.json file and remove sections with wrong IPs or not existing hosts 编辑提取的clusterstate.json文件并删除具有错误IP或不是现有主机的部分
  • clear the clusterstate in ZooKeeper by calling 通过调用清除ZooKeeper中的clusterslate

     zkcli.sh -zkhost localhost:2181 -cmd clear /clusterstate.json 
  • save corrected state in ZooKeeper by sending updated JSON file 通过发送更新的JSON文件来保存ZooKeeper中的更正状态

     zkcli.sh -zkhost localhost:2181 -cmd putfile /clusterstate.json ./clusterstate.json` 
  • restart Solr instances 重启Solr实例

After that, if your clusterstate shows correct info, you should no longer have timeouts when accessing Collections API. 之后,如果您的clusterstate显示正确的信息,则访问Collections API时不应再有超时。

Note 注意

Be careful when editing clusterstate JSON, limit your changes only to removing not existing hosts/replicas/shards. 编辑clusterstate JSON时要小心,仅将更改限制为删除不存在的主机/副本/分片。

I also had timeout issues with the collections API. 我也遇到了集合API的超时问题。 To fix this problem, I added the server's IP address to the solr.xml file that you find in /var/solr/data/solr.xml. 为解决此问题,我将服务器的IP地址添加到您在/var/solr/data/solr.xml中找到的solr.xml文件中。 My setup consists of 3 Ubuntu servers that run ZooKeeper (3.4.6) and SolrCloud (5.2.1) on each server. 我的设置包括3台Ubuntu服务器,它们在每台服务器上运行ZooKeeper(3.4.6)和SolrCloud(5.2.1)。

I have also faced similar issue: 我也遇到过类似的问题:

Solr process 24214 running on port 8983
Failed to get system information from http://localhost:8983/solr/ due to: org.apache.solr.client.solrj.SolrServerException: clusterstatus the collection time out:180s
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:537)
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:471)
    at org.apache.solr.util.SolrCLI$StatusTool.getCloudStatus(SolrCLI.java:721)
    at org.apache.solr.util.SolrCLI$StatusTool.reportStatus(SolrCLI.java:704)
    at org.apache.solr.util.SolrCLI$StatusTool.runTool(SolrCLI.java:662)
    at org.apache.solr.util.SolrCLI.main(SolrCLI.java:215)

So to solve this issue I have followed given instruction and resolved it.: 所以为了解决这个问题,我遵循了指令并解决了它:

  • Stop all Solr instances 停止所有Solr实例
  • Stop all Zookeeper instances 停止所有Zookeeper实例
  • Start all Zookeeper instances 启动所有Zookeeper实例
  • Start Solr instances one at a time. 一次启动一个Solr实例。

结束了Zoo Keeper配置不匹配

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM