我对Solr中的核心和集合配置感到困惑 .
我只使用过核心,因此我知道核心的两个主要配置是conf / schema.xml和conf / solrconfig.xml
现在我使用solrcloud并认为我想在这些核心上使用集合 . 我有一个简单的两个碎片,两个副本设置就像这里:http://wiki.apache.org/solr/SolrCloud .
我希望能够创建一个新的核心或集合(如果可以的话,通过集合api),所有节点都在自己的实例上创建这个核心,并共享相同的schema.xml和solrconfig.xml .
谢谢你的帮助
1 回答
得到了我的答案:
启动Zookeeper:
java -Dbootstrap_confdir=./solr/foobar/conf -Dhost=127.0.0.1:9983 -Dcollection.configName=myconf -DzkRun -DnumShards=2 -jar start.jar
创建集合:
http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=foobar&numShards=2&replicationFactor=2
现在每个核心都有foobar集合,每个实例都有一个名为foobar_shard1_replica1,foobar_shard2_replica1,foobar_shard1_replica2或foobar_shard2_replica2的核心 .
要将编辑同步到配置,您可以在指定的confdir中编辑文件,然后:
使用zkcli upconfig命令重新加载配置(我在cloud-scripts目录中有我的):
sudo ./zkcli.sh -cmd upconfig -zkhost 127.0.0.1:9983 -confdir ../solr/foobar/conf -confname myconf
使用以下方式重新加载集合:
http://127.0.0.1:8983/solr/admin/collections?action=RELOAD&name=test
相关链接:http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collections_API https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files https://cwiki.apache.org/confluence/display/solr/Command+Line+Utilities