Hi all,

We've just updated to SOLR 4.0 production and Zookeeper 3.3.6 from SOLR 4.0 
development version circa November 2011.  We keep 6 months of data online in 
our primary cluster, and archive off old stuff to a slower disk archive 
cluster.   We used to remove SOLR cores with the following code, but everything 
has changed in Zookeeper now.

Old code to remove cores from Zookeeper:


curl 
http://127.0.0.1:8080/solr/admin/cores?action=UNLOAD&core=${SHARD}<http://127.0.0.1:8080/solr/admin/cores?action=UNLOAD&core=$%7bSHARD%7d>

        echo "Removing indexes from all Zookeeper hosts"
        for (( i=0; i<${#ZK_HOSTS[*]}; i++ ))
        do
                $JAVA -cp 
.:/apps/zookeeper-3.3.5/zookeeper-3.3.5.jar:/apps/zookeeper-3.3.5/lib/jline-0.9.94.jar:/apps/zookeeper-3.3.5/lib/log4j-1.2.15.jar
 org.apache.zookeeper.ZooKeeperMain -server ${ZK_HOSTS[$i]} delete 
/collections/polecat/shards/solrenglish:8080_solr_$SHARD/$HOSTNAME:8080_solr_$SHARD
                $JAVA -cp 
.:/apps/zookeeper-3.3.5/zookeeper-3.3.5.jar:/apps/zookeeper-3.3.5/lib/jline-0.9.94.jar:/apps/zookeeper-3.3.5/lib/log4j-1.2.15.jar
 org.apache.zookeeper.ZooKeeperMain -server ${ZK_HOSTS[$i]} delete 
/collections/polecat/shards/solrenglish:8080_solr_$SHARD
        Done

curl http://solrmaster01:8080/solr/admin/cores?action=RELOAD&core=master

Now that we have migrated, I have tried removing cores from Zookeeper by 
removing the stuff for the unloaded core in "leaders" and "leader_elect", but 
for some reason SOLR keeps sending the requests to the shard, and I end up with 
the "no servers hosting shard" error.

Does anyone know how to remove a SOLR core from a SOLR server and have 
Zookeeper updated, and have distributed queries still work?   The only thing I 
know how to do now is stop tomcat, stop zookeeper, clear out the data directory 
and then restart both.   This isn't really ideal for a process I'd like to have 
running each night, and surely it is something others have it.  I've tried 
google searching, and what I find is references to the bug where solr notifies 
zookeeper on core unloads which is marked as fixed, and people talking about 
how it doesn't work but if your run reloads on each core, it will work.  (also 
doesn't work when I do it)

Regards,

Gilles Comeau

Reply via email to