索引失败。 回滚所有更改。 (Solr的DataImport)(Indexing failed

2019-09-21 06:32发布

当我尝试运行domain.com:8080/solr/dataimport?command=full-import ,我得到的错误Indexing failed. Rolled back all changes. Indexing failed. Rolled back all changes.

有没有其他错误消息错误什么的时候通知我吗? 有什么建议么?

数据-config.xml中

 <dataConfig>

    <dataSource 
        name="mysql"
        driver="com.mysql.jdbc.Driver" 
        url="jdbc:mysql://localhost/databasename" 
        user="myusername" 
        password="mypassword" />

    <document>

        <entity 
            name="posts" 
            datasource="mysql"
            query="select id, title, description from posts"
            deltaQuery="select id, title, description from posts where updated_at > '${dataimporter.last_index_time}'">\
        </entity>
        <field column="id" name="id" indexed="true" stored="true" />
        <field column="title" name="title" indexed="true" stored="true" />
        <field column="description" name="description" indexed="true" stored="true" />

    </document>

</dataConfig>

产量

<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">0</int>
  </lst>
    <lst name="initArgs">
    <lst name="defaults">
    <str name="config">/usr/local/solr/conf/data-config.xml</str>
  </lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
  <str name="Time Elapsed">0:0:12.227</str>
  <str name="Total Requests made to DataSource">0</str>
  <str name="Total Rows Fetched">0</str>
  <str name="Total Documents Processed">0</str>
  <str name="Total Documents Skipped">0</str>
  <str name="Full Dump Started">2012-08-16 14:50:07</str>
  <str name="">Indexing failed. Rolled back all changes.</str>
  <str name="Rolledback">2012-08-16 14:50:08</str>
</lst>
<str name="WARNING">
  This response format is experimental. It is likely to change in the future.
</str>
</response>

日志

Aug 16, 2012 3:15:28 PM org.apache.solr.common.SolrException log
  SEVERE: Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: com.mysql.jdbc.Driver Processing Document # 1
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:264)
    at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:375)
    at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:445)
    at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:426)
  Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: com.mysql.jdbc.Driver Processing Document # 1
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:621)
    at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:327)
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:225)
    ... 3 more

Answer 1:

关于什么地方出了错的所有信息都在日志​​文件(通常是:catalina.out中)



Answer 2:

它看起来像你对我缺少Solr的MySQL驱动程序。



Answer 3:

或者,如果你有Solr的mysql的连接器,它不能找到它。 请确保它在正确的lib目录( solr/yourdb/lib和/或example/lib ),或把它放在什么地方访问,并添加:

{lib dir="path/to/lib/dir/containing/mysql-connecter/" regex="mysql-connector-java-\d.*\.jar" }

你solrconfig.xml中的文件。

我把它放在上层Solr的-4.X /距离/文件夹,并把

{lib dir="../../../../dist/" regex="mysql-connector-java-\d.*\.jar"}

Solr中的config.xml



文章来源: Indexing failed. Rolled back all changes. (Solr DataImport)