Create a test collection
Generate configuration files and upload the generated configuration to ZooKeeper, so that you can create a collection where you can index sample data.
-
Make sure that the
SOLR_ZK_ENSEMBLEenvironment variable is set in/etc/solr/conf/solr-env.sh.For example:cat /etc/solr/conf/solr-env.shexport SOLR_ZK_ENSEMBLE=zk01.example.com:2181,zk02.example.com:2181,zk03.example.com:2181/solrThis is automatically set on hosts with a Solr Server or Gateway role in Cloudera Manager.
-
If you are using Kerberos,
kinitas the user that has privileges to create the collection.For example:kinit solr@EXAMPLE.COMReplace solr@EXAMPLE.COM with your user name and Kerberos realm name respectively.
-
Generate configuration files for the collection:
solrctl instancedir --generate $HOME/test_collection_config -
Upload the configuration to ZooKeeper:
solrctl config --upload test_collection_config $HOME/test_collection_config - Create a new collection with two shards (specified by the
-sparameter) using the named configuration (specified by the-cparameter).solrctl collection --create test_collection -s 2 -c test_collection_config
