简体   繁体   English

Apache Solr - 无法访问管理页面

[英]Apache Solr - Unable to access admin page

On mac snow leopard, I have installed Apache Solr 4.2.0 using brew and triggered the server using the below commands,在 mac snow leopard 上,我使用 brew 安装了 Apache Solr 4.2.0 并使用以下命令触发了服务器,

Usage: $ solr path/to/config/dir

When I try to access the admin page in browser using below link and the page with SolrCore Initialization failure occurs as below,当我尝试使用以下链接访问浏览器中的管理页面时,出现 SolrCore 初始化失败的页面如下所示,

http://localhost:8983/solr/admin

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

The page also has message,该页面也有消息,

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

Any help regarding this is greatly appreciated.非常感谢您对此的任何帮助。

In the root for the Solr config directory, there is a file called solr.xml .在 Solr 配置目录的根目录中,有一个名为solr.xml的文件。 This file configures Solr cores.此文件配置 Solr 内核。 The file might contain:该文件可能包含:

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

The important point is to match instanceDir="auctionConfigDir" with the actual path/to/config/dir .重要的一点是将instanceDir="auctionConfigDir"与实际的path/to/config/dir匹配。 If Solr can't find the location of you configuration files, it wont be able to start a core.如果 Solr 找不到配置文件的位置,它将无法启动内核。

sudo vim /opt/solr-4.8.1/example/etc/jetty.xml change须藤 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>

to

<!-- 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>

then sudo service solrd restart然后 sudo service solrd restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM