How to use upconfig & linkconfig scripts on external zookeeper
Asked Answered
P

2

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?

Pazit answered 9/1, 2015 at 9:30 Comment(0)
S
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

Selfabsorbed answered 26/1, 2015 at 22:26 Comment(4)
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?Pazit
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.Selfabsorbed
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?Pazit
The first time you start the server use either bootstrap OR upconfig+linkconfig. If you want to update your config, use upconfig.Selfabsorbed
M
2

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

Melanosis answered 17/5, 2016 at 21:24 Comment(2)
My Configurations are present in /range_audits . When I gave the zkhost : IP:2181/ranger_audits it still copied in /configs.Platysma
This is exactly what I need, specify the root dir on zookeeper.Dainedainty

© 2022 - 2024 — McMap. All rights reserved.