You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by "Cassandra Targett (Confluence)" <co...@apache.org> on 2013/09/19 19:08:00 UTC

[CONF] Apache Solr Reference Guide > Using ZooKeeper to Manage Configuration Files

Space: Apache Solr Reference Guide (https://cwiki.apache.org/confluence/display/solr)
Page: Using ZooKeeper to Manage Configuration Files (https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files)

Change Comment:
---------------------------------------------------------------------
solr-4718: add solr.xml to ZK

Edited by Cassandra Targett:
---------------------------------------------------------------------
With SolrCloud your configuration files (particularly {{solrconfig.xml}} and {{schema.xml}}) are kept in ZooKeeper. These files are uploaded when you first start Solr in SolrCloud mode.

h2. Startup Bootstrap Parameters

There are two different ways you can use system properties to upload your initial configuration files to ZooKeeper the first time you start Solr. Remember that these are meant to be used only on first startup or when overwriting configuration files. Every time you start Solr with these system properties, any current configuration files in ZooKeeper may be overwritten when {{conf.set}} names match.

The first way is to look at {{solr.xml}} and upload the {{conf}} for each core found. The {{config set}} name will be the collection name for that core, and collections will use the {{config set}} that has a matching name. One parameter is used with this approach, {{bootstrap_conf}}. If you pass {{\-Dbootstrap_conf=true}} on startup, each core you have configured will have its configuration files automatically uploaded and linked to the collection containing the core. 

An alternate approach is to upload the given directory as a {{config set}} with the given name. No linking of collection to {{config set}} is done. However, if only one {{conf.set}} exists, a collection will autolink to it. Two parameters are used with this approach:

|| Parameter ||Default value ||Description ||
| {{bootstrap_confdir}} | No default | If you pass {{\-bootstrap_confdir=<directory>}} on startup, that  specific directory  of configuration files will be uploaded to ZooKeeper  with a {{conf.set}} name defined by the system property below, {{collection.configName}}. |
| {{collection.configName}} | Defaults to {{configuration1}} | Determines the name of the {{conf.set}} pointed to by {{bootstrap_confdir}}. |

Using the [ZooKeeper Command Line Interface (zkCLI)|solr:Command Line Utilities], you can download and re-upload these configuration files.

{note}
It's important to keep these files under version control.
{note}

h2. Managing Your SolrCloud Configuration Files

To update or change your SolrCloud configuration files:

# Download the latest configuration files from ZooKeeper, using the source control checkout process.
# Make your changes.
# Commit your changed file to source control.
# Push the changes back to ZooKeeper.
# Reload the collection so that the changes will be in effect.

There are some scripts available with the ZooKeeper Command Line Utility to help manage changes to configuration files, discussed in the section on [solr:Command Line Utilities].

{note}
By default, {{solr.xml}} is not one of the Solr configuration files managed by ZooKeeper. If you would like to keep your {{solr.xml}} in ZooKeeper, starting with Solr 4.5 you can push it to ZooKeeper with the {{zkcli.sh}} utility (using the {{putfile}} command). See the section [Command Line Utilities] for more information.
{note}
{scrollbar}


Stop watching space: https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=solr
Change email notification preferences: https://cwiki.apache.org/confluence/users/editmyemailsettings.action