删除索引的Collection API(更多参见https://cwiki.apache.org/confluence/display/solr/Collections+API)
http://IP:PORT/solr/admin/collections?action=DELETEREPLICA&collection=IndexName&shard=shardX&replica=core_nodeX
shardX和core_nodeX来源于solr接口
http://IP:PORT/solr/zookeeper?detail=true&path=%2Fcollections%2FIndexName%2Fstate.json&_=1451891955901
把一个分片分为两个:
http://127.0.0.1:8983/solr/admin/collections?action=SPLITSHARD&collection={indexName}&shard=shard1
将一个分片删除:
http://127.0.0.1:8983/solr/admin/collections?action=DELETESHARD&collection={indexName}&shard=shard1_0
报错:
<response><lst name="responseHeader"><int name="status">400</int><int name="QTime">388</int></lst><str name="Operation deleteshard caused exception:">org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: The slice: shard1_0 is currently active. Only non-active (or custom-hashed) slices can be deleted.</str><lst name="exception"><str name="msg">The slice: shard1_0 is currently active. Only non-active (or custom-hashed) slices can be deleted.</str><int name="rspCode">400</int></lst><lst name="error"><str name="msg">The slice: shard1_0 is currently active. Only non-active (or custom-hashed) slices can be deleted.</str><int name="code">400</int></lst></response>