Configsets

Configsets are a set of configuration files used in a Solr installation: solrconfig.xml, the schema, and resources like language files, synonyms.txt, and others.

Such configuration, configsets, can be named and then referenced by collections or cores, allowing you to share them to avoid duplication.

Solr ships with two example configsets located in server/solr/configsets, which can be used as a base for your own. These example configsets are named _default and sample_techproducts_configs.

Configsets in User-Managed Clusters or Single-Node Installations

If you are using Solr in a user-managed cluster or a single-node installation, configsets are managed on the filesystem.

Each Solr core can have it’s very own configset located beneath it in a <instance_dir>/conf/ dir. Here, it is not named or shared and the word configset isn’t found. In Solr’s early years, this was the only way it was configured.

To create a named configset, add a new directory under the configset base directory. The configset will be identified by the name of this directory. Then add a conf/ directory containing the configuration you want to share. The structure should look something like this:

/<configSetBaseDir>
    /configset1
        /conf
            /managed-schema.xml
            /solrconfig.xml
    /configset2
        /conf
            /managed-schema.xml
            /solrconfig.xml

The default base directory is $SOLR_HOME/configsets. This path can be configured with the configSetBaseDir parameter in solr.xml (see Configuring solr.xml for details).

To create a new core using a configset, pass configSet as one of the core properties. For example, if you do this via the CoreAdmin API:

  • V1 API

  • V2 API

curl http://localhost:8983/admin/cores?action=CREATE&name=mycore&instanceDir=path/to/instance&configSet=configset2
curl -v -X POST -H 'Content-type: application/json' -d '{
  "create":[{
    "name": "mycore",
    "instanceDir": "path/to/instance",
    "configSet": "configSet2"}]}'
    http://localhost:8983/api/cores

Configsets in SolrCloud Clusters

In SolrCloud, it’s critical to understand that configsets are stored in ZooKeeper and not the file system. Solr’s _default configset is uploaded to ZooKeeper on initialization. This and a couple of example configsets remain on the file system but Solr does not use them unless they are used with a new collection.

When you create a collection in SolrCloud, you can specify a named configset. If you don’t, then the _default will be copied and given a unique name for use by the new collection.

A configset can be uploaded to ZooKeeper either via the Configsets API or more directly via bin/solr zk upconfig. The Configsets API has some other operations as well, and likewise, so does the CLI.

To upload a file to a configset already stored on ZooKeeper, you can use bin/solr zk cp.

By default, ZooKeeper’s file size limit is 1MB. If your files are larger than this, you’ll need to either increase the ZooKeeper file size limit or store them on the filesystem of every node in a cluster.

Forbidden File Types

Solr does not accept all file types when uploading or downloading configSets. By default the excluded file types are:

  • class

  • java

  • jar

  • tgz

  • zip

  • tar

  • gz

However, users can impose stricter or looser limits on their systems by providing a comma separated list of file types (without the preceding dot, e.g. jar,class,csv), to either of the following settings:

  • System Property: -DsolrConfigSetForbiddenFileTypes

  • Environment Variable: SOLR_CONFIG_SET_FORBIDDEN_FILE_TYPES