0
votes

How can I connect my Solr collection that runs on a Jetty 6 with an external ZooKeeper?

from the tutorial I learned how to start solr from the command line and connect it with ZooKeeper

java -DnumShards=2 -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DzkHost=localhost:2181 -jar start.jar

but where can I define these parameters when I start solr with maven. I quess I have to add them somehow at my jetty.xml or web.xml. But I couln't figure out how.

1

1 Answers

0
votes

Finally I found a solution

I had to add this to my jetty-web.xml

  <Call name="setProperty" class="java.lang.System">
    <Arg type="String">zkHost</Arg>
    <Arg type="String">padthai:2181,couscous:2181</Arg>
  </Call>
  <!-- only the first node has to use the followings to populate zookeeper -->
  <Call name="setProperty" class="java.lang.System">
    <Arg type="String">bootstrap_conf</Arg>
    <Arg type="String">true</Arg>
  </Call>
  <Call name="setProperty" class="java.lang.System">
    <Arg type="String">numShards</Arg>
    <Arg type="String">2</Arg>
  </Call>