Create a Test Collection
-
If you are using Kerberos,
kinitas a user that has privileges to create the collection:kinit solr@EXAMPLE.COMReplace
EXAMPLE.COMwith your Kerberos realm name. - If you are using Kerberos, create a JAAS configuration file in
your home directory (
$HOME/jaas.conf) as follows:Client { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=false useTicketCache=true principal="solr@EXAMPLE.COM"; }; - 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.
-
Generate configuration files for the collection:
solrctl instancedir --generate $HOME/test_collection_config -
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
- Security
enabled:
- 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
