2014-06-17 101 views
0

如何將運行在Jetty 6上的Solr集合與外部ZooKeeper連接起來?使用Maven啓動ZooKeeper SolrCloud

從我學會如何從命令行solr的開始,並將其與動物園管理員

的java -DnumShards = 2 -Dbootstrap_confdir =。/ solr的/ collection1/CONF -Dcollection.configName = myconf連接教程-DzkHost = localhost:2181 -jar start.jar

但我在哪裏可以定義這些參數,當我開始與maven solr。我想我必須以某種方式將它們添加到我的jetty.xml或web.xml中。但我不知道如何。

回答

0

最後,我找到了解決辦法

我不得不把它添加到我的碼頭-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>