【问题标题】:Starting ZooKeeper SolrCloud with Maven使用 Maven 启动 ZooKeeper SolrCloud
【发布时间】:2014-08-07 12:26:18
【问题描述】:

如何将在 Jetty 6 上运行的 Solr 集合与外部 ZooKeeper 连接起来?

从教程中我学会了如何从命令行启动 solr 并将其与 ZooKeeper 连接

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

但是当我用 maven 启动 solr 时,我在哪里可以定义这些参数。我想我必须以某种方式在我的 jetty.xml 或 web.xml 中添加它们。但我不知道怎么做。

【问题讨论】:

    标签: solr jetty apache-zookeeper


    【解决方案1】:

    终于找到了解决办法

    我必须将它添加到我的 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-15
      • 2012-08-29
      • 2012-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-23
      相关资源
      最近更新 更多