Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andmos/fdcefff7e4c03445148e to your computer and use it in GitHub Desktop.
Save andmos/fdcefff7e4c03445148e to your computer and use it in GitHub Desktop.
Updating a SolrCloud schema in a live enviroment

Updating a SolrCloud schema in a live enviroment

I can guarantee this will happen to you at some point: You find out that you need to add some more feilds in a Solr schema becouse you want to index some more data from you're documents. Does that mean taking down the live nodes, changing the schema and then start them up again? Thankfully, no. With the help of Zookeeper and the Solr schema REST API we can do this live without any pain.

###The API calls:

First of, let's update the new config to the zookeeper:

	./zkcli.sh -zkhost myZookeeper:2181 -cmd upconfig -confname myConfig -confdir /path/to/my/conf/

Then just reload the core (I do this on the shard leader out of habit):

	curl http://mySolrNode:8983/solr/admin/cores?action=reload&core=myCore

This trick have saved me many times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment