我一直在尝试在具有约500万个文档的服务器上配置solr-DIH,但它无法正常工作,但在我的本地主机上有100000个文档时效果很好。这可能是什么问题?
这是我得到的日志
Exception while processing: product_master document : SolrInputDocument[]:org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT cs_product_id,title FROM product_master Processing Document # 1
16:10:56
SEVERE
DataImporter
Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT cs_product_id,title
我的数据配置在这里
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://www.mysite.com/mydb" user="myusername" password="mypwd" batchSize="-1"/>
<document>
<entity name="product_master" pk="cs_product_id"
query="SELECT cs_product_id,title FROM product_master"
deltaImportQuery=" SELECT cs_product_id,title FROM product_master WHERE cs_product_id = '${dataimporter.delta.cs_product_id}'"
deltaQuery=" SELECT cs_product_id FROM product_master WHERE update_timestamp > '${dataimporter.last_index_time}'">
<field column="cs_product_id" name="cs_product_id"/>
<field column="title" name="title"/>
</entity>
</document>
</dataConfig>
最佳答案
应该没有什么区别,所以我建议您执行以下操作:
设置为调试DIH组件的日志级别
使用确切的连接URL,确切的用户名和密码,使用简单的main方法创建一个简单的类,该类对该数据库做一些琐碎的事情
我认为,使用上述两个技巧之一,您将会明白这一点(我猜这与Solr无关)