Solr 数据导入 - 从数据库导入时出现 InvalidConnectionAttributeException

标签 solr dataimporthandler

我正在尝试将 Solr 实例配置为从数据库导入。到目前为止,我已经按照 Apache Documentation 中的描述配置了所有内容。 ,但始终出现此错误:

 Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server 
time zone value 'EDT' is unrecognized or represents more than one time zone.
You must configure either the server or JDBC driver (via the serverTimezone 
configuration property) to use a more specifc time zone value if you want to 
utilize time zone support.

尽管我在 init.d 脚本中启用了 SOLR_TIMEZONE="UTC" 并验证了 -Duser.timezone=UTC 存在于 的结果中,但还是出现了这种情况PS auxWW | grep solr.

这是我的 DataImportHandler 配置:

<dataConfig>
    <dataSource type = "JdbcDataSource"
                driver = "com.mysql.jdbc.Driver"
                url = "jdbc:mysql://10.0.0.141:3306/dev"
                user = "dev"
                password = "local_user" />
    <document>
        <entity name = 'id' query = "select * from index_document;" />
    </document>
</dataConfig>

并且它在 Solr 管理数据导入屏幕中可见。奇怪的是我正在导入的数据库表中没有日期。

最佳答案

解决方案是将 url 更改为

url = "jdbc:mysql://10.0.0.141:3306/dev?serverTimezone=UTC"

关于Solr 数据导入 - 从数据库导入时出现 InvalidConnectionAttributeException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40116979/

相关文章:

lucene - Solr DIH -- 如何处理已删除的文档?

solr - 将 RF 从 1 增加到 3 会导致数据丢失

mongodb - 我可以使用 Solr 而不是 MongoDB 吗?

arrays - Solr 查询过滤文档,数组中至少有一个值(指定值除外)

solr - Solar ScriptTransformer 向多值字段添加附加值的语法是什么?

java - Solr 数据导入请求处理程序异常

hadoop - 使用 Solr 和 Hadoop 进行文本挖掘

solr - 无法下载配置

search - Solr 不会搜索属于嵌套实体的字段