Delete/remove Solr configuration from ZooKeeper using zkcli?
Asked Answered
B

2

16

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

Bijection answered 18/2, 2015 at 17:28 Comment(2)
No, and the Solr cloud folks said it is not supported yet.Bijection
Is there a solution for this yet?Maxwell
O
17

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

Outbreak answered 28/6, 2016 at 8:34 Comment(1)
By the way, it's also possible to clear a single file within a config set. e.g zkcli.sh -cmd clear -z localhost:2181 /configs/dummy/managed-schema.ogAplenty
B
6

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
Bladdernose answered 13/3, 2015 at 22:12 Comment(1)
In recent ZooKeeper versions, it seems to be deleteall instead of rmr now.Buoyant

© 2022 - 2024 — McMap. All rights reserved.