On 6/20/2014 1:24 PM, John Smodic wrote:
I have the following situation using SolrCloud:
deleteCollection foo - Could not find collection:foo
createCollection foo - Error CREATEing SolrCore 'foo_shard1_replica1':
Could not create a new core in solr/foo_shard1_replica1/as another core is
already defined there
unload Corefoo_shard1_replica1, delete index, delete dir - No such core
exists 'foo_shard1_replica1'
My clusterstate.json is empty:
get /clusterstate.json
{}
However, the /solr directory of my server does have the directory
foo_shard1_replica1
How can I delete this phantom core / collection without manually deleting
the directory and restarting my servers?
If the zookeeper database has no mention at all of the foo collection,
then it should be completely safe to just delete or rename the
directory, and you probably won't even need to restart Solr.
Because the core directory most likely does not have a conf directory,
you can't just CREATE and then UNLOAD the core with the
deleteInstanceDir option. What you MIGHT be able to do for deleting it
with HTTP calls is this:
Temporarily create a new collection with a different name that has one
shard, with being the name of an existing configuration stored in
zookeeper, ideally whichever config was being used for foo:
http://server:port/solr/admin/collections?action=CREATEname=barnumShards=1collection.configName=
Use CoreAdmin to create the foo_shard1_replica1 core as a replica of the
shard in the new collection:
http://server:port/solr/admin/cores?action=CREATEname=foo_shard1_replica1collection=barshard=shard1
If this CoreAdmin action works, then you can delete the new collection
entirely:
http://server:port/solr/admin/collections?action=DELETEname=bar
I have no idea whether this will actually work, but it's the best idea
that I have.
Thanks,
Shawn