Apache Solr - Unable to access admin page

依然范特西╮ 提交于 2020-01-16 01:05:32

问题


On mac snow leopard, I have installed Apache Solr 4.2.0 using brew and triggered the server using the below commands,

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,

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.


回答1:


In the root for the Solr config directory, there is a file called solr.xml. This file configures Solr cores. 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. If Solr can't find the location of you configuration files, it wont be able to start a core.




回答2:


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

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



来源:https://stackoverflow.com/questions/16230493/apache-solr-unable-to-access-admin-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!