Create a test collection

  1. If you are using Kerberos, kinit as a user that has privileges to create the collection:
    kinit solr@[***EXAMPLE.COM***]

    Replace [***EXAMPLE.COM***] with your Kerberos realm name.

  2. If you are using Kerberos, create a JAAS configuration file in your home directory ($HOME/jaas.conf) as follows:
    Client { required
  3. Make sure that the SOLR_ZK_ENSEMBLE environment variable is set in /etc/solr/conf/
    For example:
    cat /etc/solr/conf/

    This is automatically set on hosts with a Solr Server or Gateway role in Cloudera Manager.

  4. Generate configuration files for the collection:
    solrctl instancedir --generate $HOME/test_collection_config
  5. Upload the configuration to ZooKeeper:
    • Security enabled:
      solrctl --jaas $HOME/jaas.conf instancedir --create test_collection_config $HOME/test_collection_config
    • Nonsecure:
      solrctl instancedir --create test_collection_config $HOME/test_collection_config
  6. Create a new collection with two shards (specified by the -s parameter) using the named configuration (specified by the -c parameter).
    solrctl collection --create test_collection -s 2 -c test_collection_config