SOLR:There are no SolrCores running Error Message

喜欢而已 提交于 2019-12-06 07:23:15

问题


I m very new to SOLR.

I have added the following to the corresponding xml files. But when I try to open my server page that is http://localhost:8080/solr/#/ in my machine it comes up with a message saying that "There are no SolrCores running.Using the Solr Admin UI currently requires at least one SolrCore.".

solarconfig.xml: [the request handler]

 <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
       <lst name="defaults">
        <str name="config">C:/Solr/collection1/conf/data-config.xml</str>
    </lst>
  </requestHandler>

data-config.xml

<dataConfig>
  <dataSource type="JdbcDataSource" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://127.0.0.1:8080;databaseName=myDB" user="xxx" password="xxx" />
    <document>
      <entity name="sep" processor="SolrEntityProcessor" url="http://127.0.0.1:8080/solr/#/collection1" query="*:*"/>
      <entity name="Data" query="select id, firstname, lastname from tblPlayers">
        <field column="DocumentId" name="DocumentId" />
        <field column="Data" name="Data" />
      </entity>
    </document>
</dataConfig>

I guess the requestHandler just points to the data-config.xml, so is there anything wrong with my data-config.xml.

And which is the port that I ve to specify in the data-config.xml relating to the DB.

Thanks in advance.


回答1:


The error message has nothing to do with dataimport. it tells you that you need to have at least one core. It seems to me you're using a solr 4.x. If so, you can find a valid configuration in the download bundle (the core is called "collection1"). There's a multicore example too.

Regarding the dataimport, looking at the file it's not clear to me what you want to know with your question about database port...if you were wondering about where put database connection details well, the answer is the "url" attribute of the datasource element...you must specjfy a valid jdbc url, which is supposed to contain at least database address, port and / or alias.



来源:https://stackoverflow.com/questions/14620680/solrthere-are-no-solrcores-running-error-message

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