【问题标题】:Indexing Postgresql data into ElasticSearch — can't connect to localhost/127.0.0.1:9300将 Postgresql 数据索引到 ElasticSearch — 无法连接到 localhost/127.0.0.1:9300
【发布时间】: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无关,所以我已经删除了这些标签。

标签: indexing elasticsearch


【解决方案1】:

也许我可以帮你

节点不可用 #616

https://github.com/jprante/elasticsearch-jdbc/issues/616

您必须从源项目更改 pom.xml 并重新构建它。这是说明:

git 克隆https://github.com/jprante/elasticsearch-jdbc.git cd elasticsearch-jdbc 编辑 pom.xml => 将“elasticsearch.version”更改为 1.7.1 制作包装 光盘库 将文件 elasticsearch-jdbc-1.7.0.1-uberjar.jar 复制到您的部署目录希望这有帮助。

【讨论】:

    猜你喜欢
    • 2020-11-19
    • 1970-01-01
    • 1970-01-01
    • 2021-04-16
    • 2018-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-15
    相关资源
    最近更新 更多