2013-05-16 83 views
2

首先,我创建了一个名为usercollection集合:Solrcloud删除收集错误?

http://xxxxx/solr/admin/collections?action=CREATE&name=usercollection&numShards=3&replicationFactor=3&maxShardsPerNode=3 

然后我发现不对劲,所以我将其删除。

http://xxxx/solr/admin/collections?action=DELETE&name=usercollection 

最后,我想再次创建集合。我发现了一些错误。

`May 16, 2013 8:32:23 PM org.apache.solr.cloud.OverseerCollectionProcessor run 
INFO: Overseer Collection Processor: Get the message id:/overseer/collection-queue- work/qn-0000000000 message:{ 
"operation":"createcollection", 
"numShards":"3", 
"maxShardsPerNode":"3", 
"createNodeSet":null, 
"name":"usercollection", 
"replicationFactor":"3"} 
May 16, 2013 8:32:23 PM org.apache.solr.common.SolrException log 
SEVERE: Collection createcollection of createcollection   failed:org.apache.solr.common.SolrException: collection already exists: usercollection 
    at org.apache.solr.cloud.OverseerCollectionProcessor.createCollection(OverseerCollectionProcessor.java:311) 
    at org.apache.solr.cloud.OverseerCollectionProcessor.processMessage(OverseerCollectionProcessor.java:160) 
    at org.apache.solr.cloud.OverseerCollectionProcessor.run(OverseerCollectionProcessor.java:112) 
    at java.lang.Thread.run(Thread.java:662)` 

因此,我认为集合API在删除时出错。因此,我怎样才能真正删除集合?

+0

哪个版本的Solr的你使用,你怎么让你的日志,当你去lete集合? – kamaci

回答

0

你需要更新你的zookeeper合奏中的clusterstate.json文件。您的云收集信息保存在那里。

2

删除了一个集合,你也应该提交后(您可以使用,如果浏览器做同样不卷曲)

curl http://localhost:8080/solr/update -H "Content-type: text/xml" --data-binary '<commit />' 

...这也是一个不错的想法告诉Solr的这个优化它的指数点:

curl http://localhost:8080/solr/update -H "Content-type: text/xml" --data-binary '<optimize />' 

来源http://www.alphadevx.com/a/365-Clearing-a-Solr-search-index

2

有同样的问题,并最终通过手动编辑,并使用在动物园管理员更新clusterstate.json解决与Solr一起提供的zkcli.sh。

  1. 下载clusterstate.json:

    zkcli.sh -z ZK-主机名-cmd GETFILE /clusterstate.json clusterstateLoca.json

  2. 编辑下载clusterstateLocal.json,取出已删除集合的节点,本地保存clusterstateLocal.json。

  3. 从ZK

    删除陈旧clusterstate.json

    zkcli.sh -z ZK-主机名-cmd明确/clusterstate.json

  4. 上传修改clusterstate.json到ZK:

    zkcli.sh -z ZK-主机名-cmd PUTFILE /clusterstate.json ./clusterstateLocal.json