mysql - solr 数据导入处理程序在本地主机上工作,而不是在服务器上工作

标签 mysql solr vps dih

我一直在尝试在大约有 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 组件的日志级别设置为 DEBUG
  • 创建一个简单的类,其中包含一个简单的 main 方法,该方法使用准确的连接 URL、准确的用户名和密码对该数据库执行一些简单的操作

我认为通过上述两个技巧之一,您就会明白这一点(我猜,这与 Solr 无关)

关于mysql - solr 数据导入处理程序在本地主机上工作,而不是在服务器上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29645011/

相关文章:

Solr 多个字段的搜索查询

email - 邮件未发送到特定域

php mysql 从按钮中删除行

MySQL:根据列数选择多个表

php - 如何在 if 条件下使用数组

ruby-on-rails - 解决方案或 sphinx ?哪个更好?

solr - 将 Zookeeper 与 Solr 一起使用,但只有 2 台服务器

ssh - 在没有 ssh session 的服务器上运行应用程序

PHP shell_exec : how to copy a directory from one user to another (VPS on CentOs5)

php - 为什么我的查询没有定义该值?