Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update a configuration file on zookeeper?

I uploaded a configuration folder for Solr core to Apache zookeeper using zkClient. When I delete a file in my local configuration and update it to Zookeeper again, I can't see the change reflected in Solr admin page. Could somebody please explain how to update/delete files from zookeeper? Also where to find the physical files in zookeeper folder?

like image 317
KCMS Avatar asked Feb 16 '17 02:02

KCMS


1 Answers

In order to upload a modified file in zookeeper client, you need to:

  • remove the old file from Zookeeper and
  • upload the new one and
  • restart the Solr nodes (depending on the change, you could reload the collection instead).

For instance if you need to update solrconfig.xml, you can: a) clear old file on zookeeper (otherwise depending from the client version you'll get an error):

zkcli.sh --zkhost <ZK_HOST>:<ZK_PORT> -cmd clear /configs/<MY_COLLECTION>/solrconfig.xml

b) upload the updated file:

zkcli.sh --zkhost <ZK_HOST>:<ZK_PORT> -cmd putfile /configs/<MY_COLLECTION>/solrconfig.xml  /<MY_UPDATED_FILE_LOCAL_FOLDER>/solrconfig.xml

c) Restart the Solr nodes.

I believe your Solr files should be in /configs/<MY_COLLECTION>.

like image 150
AR1 Avatar answered Oct 24 '22 10:10

AR1