Solr核心模式更新:主/从设置

huangapple go评论77阅读模式
英文:

Solr core Schema update : Master/slave setup

问题

在Solr核心中升级模式(在主从设置中)的推荐步骤是什么?我想要向我的模式中添加2个新字段。

我是否可以在主节点中更新模式,而不会影响到复制过程?然后最终在从节点中升级模式。向Solr模式中添加字段的推荐步骤是什么。

英文:

What is the recommended procedure to upgrade a schema in solr core (In a master slave setup). I am looking to add 2 new fileds to my schema.

Can i update the schema in my master, without any issues in my replication. (And then eventually upgrade the schema in slaves). What is the recommended procedure to add fields in solr schema.

答案1

得分: 1

只要您已经将主节点配置为将配置文件复制到从节点,您只需更新主节点上的文件,一切都应该会自动处理。

请参阅下面的confFiles参数。

<requestHandler name="/replication" class="solr.ReplicationHandler">
  <lst name="master">
    <str name="replicateAfter">commit</str>
    <str name="backupAfter">optimize</str>
    <str name="confFiles">schema.xml,stopwords.txt,elevate.xml</str>
  </lst>
</requestHandler>

您还可以使用此功能为从节点拥有一个中央的solrconfig(例如solrconfig_slave.xml),然后将其复制到从节点,名称与实际名称相同(solrconfig.xml):

<str name="confFiles">solrconfig_slave.xml:solrconfig.xml,....</str>

只要您配置正确,只需更新主节点的schema.xml,重新加载核心(以使Solr注意到更改),它将在下一次提交时复制到客户端。

英文:

As long as you've configured your master node to replicate the configuration files to the slave nodes, you only have to update the files on the master and everything should be handled automagically for you.

See the confFiles parameter below.

&lt;requestHandler name=&quot;/replication&quot; class=&quot;solr.ReplicationHandler&quot;&gt;
  &lt;lst name=&quot;master&quot;&gt;
    &lt;str name=&quot;replicateAfter&quot;&gt;commit&lt;/str&gt;
    &lt;str name=&quot;backupAfter&quot;&gt;optimize&lt;/str&gt;
    &lt;str name=&quot;confFiles&quot;&gt;schema.xml,stopwords.txt,elevate.xml&lt;/str&gt;
  &lt;/lst&gt;
&lt;/requestHandler&gt;

You can also use this feature to have a central solrconfig (for example solrconfig_slave.xml) for your slaves, which is then replicated to your slaves under the actual name (solrconfig.xml) :

&lt;str name=&quot;confFiles&quot;&gt;solrconfig_slave.xml:solrconfig.xml,....&lt;/str&gt;

As long as you have this configured, you should be able to just update your master schema.xml, reload the core (to make Solr notice the changes) and it'll be replicated to your client on the next commit.

huangapple
  • 本文由 发表于 2020年8月22日 00:25:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/63526605.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定