Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete/remove Solr configuration from ZooKeeper using zkcli?

We have some old Solr configs in ZK and that we need to cleanup/delete.

The configs are at /configs/AAA, /configs/BBB, etc. (There are other configs under /configs as well.)

The Solr zkcli.sh script and docs provide no direction for deleting a config. The only thing that looks obvious is the "clear" parameter, but the docs and zkcli only give the example -cmd clear /solr. I thought ./zkcli -cmd clear /configs/AAA might work, but without being able to find much information on the internet, I'm leery of inadvertently deleting the wrong thing.

If I want to delete the old configs, do I use clear, and if so, is the path parameter /configs/?

Thanks

like image 216
user2029783 Avatar asked Feb 18 '15 17:02

user2029783


2 Answers

You missed the -z parameter which is mandatory (Zookeeper-3.4.8).

The correct command for deleting configset AAA on Solr (v.6.1.0) running on localhost with zookeeper on port 2181 is:

./server/scripts/cloud-scripts/zkcli.sh -cmd clear -z "localhost:2181" /configs/AAA

when in the root directory of Solr.

So to answer your question: Yes, you can use clear, and the path should be /configs/< name of configset >

Resources: https://cwiki.apache.org/confluence/display/solr/Command+Line+Utilities

like image 116
mbjorgan Avatar answered Sep 29 '22 19:09

mbjorgan


From within your zookeeper bin directory, start zkCli.sh, this will open zookeeper console.

Then fire the following command to delete a node/config:

rmr /configs
like image 41
Hussain Avatar answered Sep 29 '22 17:09

Hussain