We had a lot of problems using solr.home so save yourself some stress and just keep your directories how solr likes them by default.
Example:
- /example/solr/collection1/conf/schema.xml
- /example/solr/collection1/conf/solrconfig.xml
- /example/solr/collection1/core.properties
- /example/start.jar
To get your configuration into Zookeeper, get familiar with solr's zkcli.sh script. You want to use this to manage your solr configs. It will create/update the files in ZK under the /configs
node.
./zkcli.sh -cmd upconfig -confdir /example/solr/collection1/conf -confname collection1 -z 127.0.0.1
After running the upconfig cmd above, the files in /example/solr/collection1/conf
will be uploaded to ZK under /configs/collection1
.
Also need to link your config to your collection (creates a node under the /collections
node in ZK)
# only need to link the config once
./zkcli.sh -cmd linkconfig -collection collection1 -confname collection1 -z 127.0.0.1
Then you can just start solr like this:
java -DzkHost=127.0.0.1 -jar start.jar
The other servers in your cloud will now get the configuration from zookeeper! Some more info in a pretty good blog post here: SolrCloud Cluster (Single Collection) Deployment
Note: 127.0.0.1 is a comma delimited list of your ZK servers and collection1 is your collection