我正在尝试将 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/