Apache Solr - 无法访问管理页面

时间:2013-04-26 06:59:34

标签: apache solr

在mac snow leopard上,我使用brew安装了Apache Solr 4.2.0并使用以下命令触发了服务器,

Usage: $ solr path/to/config/dir

当我尝试使用以下链接访问浏览器中的管理页面时,如下所示发生SolrCore初始化失败的页面,

http://localhost:8983/solr/admin

collection1: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load config for solrconfig.xml 

该页面也有消息,

There are no SolrCores running.
Using the Solr Admin UI currently requires at least one SolrCore.

非常感谢有关此方面的任何帮助。

2 个答案:

答案 0 :(得分:0)

在Solr配置目录的根目录中,有一个名为solr.xml的文件。此文件配置Solr核心。该文件可能包含:

  <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}" hostContext="${hostContext:}" zkClientTimeout="${zkClientTimeout:15000}">
    <core default="true" name="auction" instanceDir="auctionConfigDir" />
  </cores>

重点是将instanceDir="auctionConfigDir"与实际path/to/config/dir相匹配。如果Solr找不到配置文件的位置,它将无法启动核心。

答案 1 :(得分:0)

sudo vim /opt/solr-4.8.1/example/etc/jetty.xml 变化

<!-- This connector is currently being used for Solr because it
      showed better performance than nio.SelectChannelConnector
      for typical Solr requests.  -->
<Call name="addConnector">
  <Arg>
      <New class="org.eclipse.jetty.server.bio.SocketConnector">
        <Set name="host">127.0.0.1</Set>
        <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
        <Set name="maxIdleTime">50000</Set>
        <Set name="lowResourceMaxIdleTime">1500</Set>
        <Set name="statsOn">false</Set>
      </New>
  </Arg>
</Call>

<!-- This connector is currently being used for Solr because it
      showed better performance than nio.SelectChannelConnector
      for typical Solr requests.  -->
<Call name="addConnector">
  <Arg>
      <New class="org.eclipse.jetty.server.bio.SocketConnector">
        <Set name="host">0.0.0.0</Set>
        <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
        <Set name="maxIdleTime">50000</Set>
        <Set name="lowResourceMaxIdleTime">1500</Set>
        <Set name="statsOn">false</Set>
      </New>
  </Arg>
</Call>

然后      sudo service solrd restart