Generate Solr collection configuration using instance directories

You must create a collection configuration prior to creating a Solr collection. The configuration files for a Solr collection are stored in a directory called instance directories. Learn how to create the directory and make it available to Solr by uploading the contents to Zookeeper.

In this case, configuration files for a collection are contained in a directory called an instance directory. An instance directory is a named set of configuration files. You can generate an instance directory template locally, edit the configuration, and then upload the directory to ZooKeeper as a named configuration set. You can then reference this named configuration set when creating a collection.
  1. If you are using Kerberos, kinit as a user with permission to create the collection configuration:
    kinit solradmin@EXAMPLE.COM

    Replace EXAMPLE.COM with your Kerberos realm name.

  2. To generate a template instance directory, run the following command:
    solrctl instancedir --generate $HOME/solr_configs
  3. Customize the collection by directly editing the solrconfig.xml and schema.xml files created in $HOME/solr_configs/conf.
  4. After completing the configuration, make it available to Solr by running the following command, which uploads the contents of the instance directory to ZooKeeper:
    solrctl config --upload [***COLLECTION_NAME***] $HOME/solr_configs
    For example:
    solrctl config --upload weblogs $HOME/solr_configs
  5. Use the solrctl utility to verify that your instance directory uploaded successfully and is available to ZooKeeper. List the uploaded instance directories as follows:
    solrctl instancedir --list

    If you used the --create command to create a collection named weblogs, the --list command should return weblogs.