【发布时间】:2015-08-03 23:37:15
【问题描述】:
我正在尝试使用JDBC importer for Elasticsearch 将 PostgreSQL 数据库索引到 ElasticSearch。我正在按照section on PostgreSQL 的自述文件中列出的说明进行操作。这是我正在尝试运行的脚本:
bin=<path to elasticsearch-jdbc-1.7.0.1 /bin folder>
lib= <path to elasticsearch-jdbc-1.7.0.1 /lib folder>
echo '{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:postgresql://localhost:5432/<name of db>",
"user" : "<username>",
"password" : "<password>",
"sql" : "select *, id as _id from paragraphs",
"index" : "<name of index>"
}
}' | java \
-cp "${lib}/*" \
-Dlog4j.configurationFile=${bin}/log4j2.xml \
org.xbib.tools.Runner \
org.xbib.tools.JDBCImporter
但是这个脚本没有执行。我在日志中得到的错误是:
...some stuff...
[01:01:03,976][INFO ][BaseTransportClient ][pool-2-thread-1] trying to connect to [inet[localhost/127.0.0.1:9300]]
[01:01:04,257][WARN ][org.elasticsearch.transport.netty][elasticsearch[importer][transport_client_worker][T#1]{New I/O worker #1}] [importer] Message not fully read (response) for [0] handler future(org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler$1@4748ede7), error [false], resetting
[01:01:04,256][INFO ][org.elasticsearch.client.transport][pool-2-thread-1] [importer] failed to get node info for [#transport#-1][andrey-ThinkPad-T430][inet[localhost/127.0.0.1:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException: Failed to deserialize response of type [org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse]
Caused by: org.elasticsearch.transport.TransportSerializationException: Failed to deserialize response of type [org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse]
您能否告知造成此问题的原因以及如何解决?
【问题讨论】:
-
给出异常原因,我认为这是elasticsearch内部的东西,我认为这与jdbc或postgresql无关,所以我已经删除了这些标签。