我正在尝试将我的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管理数据导入屏幕中可见。奇怪的是,我正在导入的db表中没有日期。
答案 0 :(得分:1)
解决方法是将url
更改为
url = "jdbc:mysql://10.0.0.141:3306/dev?serverTimezone=UTC"