6

I am trying to set up a solrCloud with external zookeeper ensemble of 3 servers and a replicated solr on 2 servers.

Assumed that an external zookeeper should be independent from other storages I can't find out how to set the -solrhome parameter. Is the zookeeper supposed to read data from the worker nodes?

How do you upload the config and link it with target collection?

Solver42
  • 156
  • 2
  • 9

2 Answers2

9

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

Kit Menke
  • 7,046
  • 1
  • 32
  • 54
  • Tanks! But I thought that start.jar was for Jetty. Used cli script to upload config to zookeeper: -confname collection1_conf and start solr in cloud mode using $JAVA_OPTS -Dbootstrap_conf=true, -Dcollection.configName=collection1, -DnumShards=1, -Dbootstrap_confdir=/directory/to/collection1/conf. This makes a copy of the conf with the name collection1. Why did I upload and link the configuration then? What system properties should be used? Excluded -DzkRun since I have external zookeeper. Do I need -jar start.jar? – Solver42 Jan 29 '15 at 09:00
  • Yep start.jar is for jetty, are you using a different server for solr? If you use bootstrap_confdir, then that will automatically upload your configuration to ZK. You should only need to use bootstrap_confdir argument once. The reason I recommended using zkcli is because you will want to use that anyway to do updates. – Kit Menke Jan 29 '15 at 15:50
  • Oh, forgot to tell you. I'm using JBoss EAP 6.3 and most tutorials, including my book, only explains how to use Jetty. I still don't get it, do I need to use three scripts: upconfig, linkconfig and bootstrap AND have bootstrap parameters when I start the first JBoss to run solr in cloud mode? – Solver42 Feb 02 '15 at 09:12
  • The first time you start the server use either bootstrap OR upconfig+linkconfig. If you want to update your config, use upconfig. – Kit Menke Feb 09 '15 at 21:49
2

You can specify the root of the Solr configuration as part of your Zookeeper connection string: -zkhost host1,host2,hostN/solr