# Elasticsearch JDBC importer is not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972>\
**Category:** Elasticsearch\
**Created:** [August 6, 2015, 1:30pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972 "2015-08-06T13:30:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![remram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remram/32/4077_2.png) [@remram](https://discuss.elastic.co/u/remram)\
**Post date:** [August 6, 2015, 1:30pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/1 "2015-08-06T13:30:22Z")

</div>

Hi all,  
I was trying to import my data with elasticsearch-jdbc importer from jprante. The execution seems to be successful. But when i look at my index. It's still empty.

This is my execution from the terminal:

```
echo '{"type":"jdbc","jdbc":{"url":"jdbc:mysql://my_domain.com:3306/my_db","user":"my_user_name","password":"my_password","ignore_null_values":true,"sql":"SELECT * FROM `es_data`","index":"my_index","type":"my_type","elasticsearch":{"cluster":"dev","host":"localhost","port":9200}}}' | java -cp "/opt/elasticsearch-jdbc/lib/*" -Dlog4j.configurationFile=/opt/elasticsearch-jdbc/bin/log4j2.xml org.xbib.tools.Runner org.xbib.tools.JDBCImporter

```

here in readable way:

```
echo '{
    "type":"jdbc",
    "jdbc":{
        "url":"jdbc:mysql://my_domain.com:3306/my_db",
        "user":"my_user_name",
        "password":"my_password",
        "ignore_null_values":true,
        "sql":"SELECT * FROM `es_data`",
        "index":"my_index",
        "type":"my_type",
        "elasticsearch":{
            "cluster":"dev",
            "host":"localhost",
            "port":9200
        }
    }
}' | java \
        -cp "/opt/elasticsearch-jdbc/lib/*" \
        -Dlog4j.configurationFile=/opt/elasticsearch-jdbc/bin/log4j2.xml \
        org.xbib.tools.Runner \
        org.xbib.tools.JDBCImporter

```

Do you have any idea or experience with this plugin? What is wrong with my configuration?

I'm using linux ubuntu and Elasticsearch version is 1.7.1 and latest version of this plugin 1.7.0.1

Thank you in advance for any help  
Cheers, Ramy

---

<div class="post-metadata">

**Author:** ![remram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remram/32/4077_2.png) [@remram](https://discuss.elastic.co/u/remram)\
**Post date:** [August 6, 2015, 3:21pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/2 "2015-08-06T15:21:51Z")

</div>

Now I was able to print out the error message to the console. This is very strange... because I'm executing my PHP code with curl to the same cluster and everything is fine. I'm getting this error only when I start to use the jdbc importer...

here is the error message:

```
17:00:40.430 [pool-2-thread-1] ERROR importer - error while getting next input: no cluster nodes available, check settings {cluster.name=dev, host.0=localhost, port=9200, sniff=false, autodiscover=false, name=importer, client.transport.ignore_cluster_name=false, client.transport.ping_timeout=5s, client.transport.nodes_sampler_interval=5s}
...
```

---

<div class="post-metadata">

**Author:** ![remram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remram/32/4077_2.png) [@remram](https://discuss.elastic.co/u/remram)\
**Post date:** [August 7, 2015, 10:25am UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/3 "2015-08-07T10:25:49Z")

</div>

Well I've found the solution for my problem. There were two troubles

1. Elasticsearch version: I was using version 1.7.1 and the JDBC Importer with version 1.7.0.1 is only supporting Elasticsearch version 1.7.0
2. Port number: I was using the port number 9200 for my curl calls and importer call. Now I'm using port 9200 for my curl calls and 9300 for the importer call

cheers, Ramy

---

<div class="post-metadata">

**Author:** ![Architha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/architha/32/92477_2.png) [@Architha](https://discuss.elastic.co/u/Architha)\
**Post date:** [February 17, 2016, 1:25pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/4 "2016-02-17T13:25:43Z")

</div>

Hi @remram

How can the JDBC importer work on Windows ? If you have any idea, please share .  
Thank you .

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 17, 2016, 1:27pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/5 "2016-02-17T13:27:37Z")

</div>

Please start your own thread. Your question is also very generic. The more details you can provide, the better answer you generally get.

---

<div class="post-metadata">

**Author:** ![Architha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/architha/32/92477_2.png) [@Architha](https://discuss.elastic.co/u/Architha)\
**Post date:** [February 17, 2016, 1:37pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/6 "2016-02-17T13:37:56Z")

</div>

Okay ! sure will start a thread. Thanks

---

<div class="post-metadata">

**Author:** ![skyfall](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@skyfall](https://discuss.elastic.co/u/skyfall)\
**Post date:** [January 11, 2017, 3:42am UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/7 "2017-01-11T03:42:12Z")

</div>

does elasticsearch-jdbc 2.3.4 support es 511？ i'm not sure

---

<div class="post-metadata">

**Author:** ![remram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remram/32/4077_2.png) [@remram](https://discuss.elastic.co/u/remram)\
**Post date:** [January 11, 2017, 7:46am UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/8 "2017-01-11T07:46:28Z")

</div>

No, Please take a look at the table for compatiblity  
[Compatiblity matrix](https://github.com/jprante/elasticsearch-jdbc#compatiblity-matrix)

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 11, 2017, 8:03am UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/9 "2017-01-11T08:03:57Z")

</div>

JDBC importer for 5.1.1 is still ongoing work.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:04pm UTC](https://discuss.elastic.co/t/elasticsearch-jdbc-importer-is-not-working/26972/10 "2017-07-05T22:04:19Z")

</div>


