0

我在向solrconfig.xml添加一些自定义时遇到了一些问题,我想做的是使用core.properties文件为ReplicationHandler设置masterUrl 。有趣的是,如果我手动将 url 粘贴到 solrconfig.xml 上,它就像一个魅力。我是否缺少core.properties上的一些配置?

这是文件:

solrconfig.xml

<requestHandler name="/replication" class="solr.ReplicationHandler" >
      <lst name="slave">

          <str name="masterUrl">${master_host}</str>

          <!--Interval in which the slave should poll master .Format is HH:mm:ss . If this is absent slave does not poll automatically.
           But a fetchindex can be triggered from the admin or the http API -->
          <str name="pollInterval">00:00:10</str>
          <str name="httpConnTimeout">5000</str>
          <str name="httpReadTimeout">10000</str>

       </lst>
  </requestHandler>

核心属性

name=locations
master_host=http://master:8983/solr/locations-master/replication

这是我得到的错误:

slave_1   | 2020-01-23 20:20:23.821 WARN  (indexFetcher-20-thread-1) [   ] o.a.s.h.IndexFetcher Master at: http://master:8983/solr/locations-master is not available. Index fetch failed by exception: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://master:8983/solr/locations-master: Expected mime type application/octet-stream but got text/html. <html>
slave_1   | <head>
slave_1   | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
slave_1   | <title>Error 404 Not Found</title>
slave_1   | </head>
slave_1   | <body><h2>HTTP ERROR 404</h2>
slave_1   | <p>Problem accessing /solr/locations-master/replication. Reason:
slave_1   | <pre>    Not Found</pre></p>
slave_1   | </body>
slave_1   | </html>

谢谢!

编辑:我正在运行太阳能的 solr:8.4.1-slim 图像

4

1 回答 1

0

在 core.properties 中,当我在创建它时设置的名称是位置主机时,我将核心的名称设置为位置。我从 core.properties 中删除了 name=locations 并且它开始工作:^)

于 2020-01-23T21:07:49.447 回答