jprante / elasticsearch-jdbc

JDBC importer for Elasticsearch
Apache License 2.0
2.84k stars 710 forks source link

Importer main null error ? #759

Open wistala opened 8 years ago

wistala commented 8 years ago

[11:00:21,911][INFO ][org.xbib.elasticsearch.helper.client.BaseTransportClient][main] creating transport client on Linux Java HotSpot(TM) 64-Bit Server VM Oracle Corporation 1.8.0_66-b17 25.66-b17 with effective settings {cluster.name=elasticsearch, max_actions_per_request=20000, max_concurrent_requests=10} [11:00:21,951][INFO ][org.elasticsearch.plugins][main] [Fagin] loaded [helper], sites [] [11:00:22,780][INFO ][org.xbib.elasticsearch.helper.client.BulkTransportClient][main] trying to connect to [localhost/127.0.0.1:9300] [11:00:22,954][INFO ][org.xbib.elasticsearch.helper.client.BulkTransportClient][main] connected to [{Izci-1}{oYXsd1gES4K2KAQEuupQiw}{172.18.27.202}{localhost/127.0.0.1:9300}] [11:00:22,973][INFO ][importer.jdbc ][main] index name = myoracle, concrete index name = myoracle [11:00:22,982][ERROR][importer ][main] null java.lang.NullPointerException at org.xbib.tools.Importer.createIndex(Importer.java:282) ~[elasticsearch-jdbc-2.1.1.0-uberjar.jar:?] at org.xbib.tools.JDBCImporter.prepare(JDBCImporter.java:88) ~[elasticsearch-jdbc-2.1.1.0-uberjar.jar:?] at org.xbib.tools.Importer.run(Importer.java:121) [elasticsearch-jdbc-2.1.1.0-uberjar.jar:?] at org.xbib.tools.Runner.main(Runner.java:28) [elasticsearch-jdbc-2.1.1.0-uberjar.jar:?]

this is the error log in my log file that i had encountered so what is the problem ? i could'nt understood the problem

thank you

jprante commented 8 years ago

I know the error message is weak.

Please use elasticsearch.cluster and elasticsearch.host setting to define the host name to connect to, also elasticsearch.port for the port. Example:

        "elasticsearch" : {
             "cluster" : "elasticsearch",
             "host" : "localhost",
             "port" : 9300
        }
wistala commented 8 years ago

i was already using this values in sh file :

!/bin/sh

This example is a template to connect to Oracle

The JDBC URL and SQL must be replaced by working ones.

DIR="$( cd "$( dirname "${BASHSOURCE[0]}" )" && pwd )" bin=${DIR}/../bin lib=${DIR}/../lib echo ' { "type" : "jdbc", "jdbc" : { "url" : "****", "connection_properties" : { "oracle.jdbc.TcpNoDelay" : false, "useFetchSizeWithLongColumn" : false, "oracle.net.CONNECTTIMEOUT" : 10000, "oracle.jdbc.ReadTimeout" : 50000 }, "user" : "IZCI", "password" : "******_", "sql" : "select * from HESAPLAR", "index" : "deneme", "type" : "deneme", "elasticsearch" : { "cluster" : "izci1", "host" : "localhost", "port" : 9300 }, "max_bulk_actions" : 20000, "max_concurrent_bulk_requests" : 10, "index_settings" : { "index" : { "number_of_shards" : 1, "number_ofreplica" : 0 } } } } ' | java \ -cp "${lib}/" \ -Dlog4j.configurationFile=${bin}/log4j2.xml \ org.xbib.tools.Runner \ org.xbib.tools.JDBCImporter