Generate a Collection Configuration Using Instance Directories

A collection configuration is a necessary prerequisite of creating a collection. Learn how create one using instance directories.

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 instancedir --create <collectionName> $HOME/solr_configs
    For example:
    solrctl instancedir --create 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.