JDBC importer

Hi,
Please help me.
Can someone help me in executing below points 4,5 and 6 for JDBC driver.

System details:
Centos 6.7 64 bit
Elastcseach 2.1.1
Marvel 2.1.1
Kibana 4.3.1
I have Sense editor

1.download the JDBC importer distribution

a. wget http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.1.1.2/elasticsearch-jdbc-2.1.1.2-dist.zip

 Completed

2.unpack

unzip elasticsearch-jdbc-2.1.1.2-dist.zip

 Completed

3.go to the unpacked directory (we call it $JDBC_IMPORTER_HOME) cd elasticsearch-jdbc-2.1.1.2

 Completed

4.if you do not find the JDBC driver jar in the lib directory, download
it from your vendor's site and put the driver jar into the lib folder

I download mysql connector-java-5.0.8
and pasted into the /lib directory. Is it true?

5.modify script in the bin directory to your needs (Elasticsearch cluster address)

 Can you please elaborate this point.

6.run script with a command that starts org.xbib.tools.JDBCImporter with the lib directory on the classpath

 Can you please elaborate this point.

You can also get help at the JDBC importer issues at https://github.com/jprante/elasticsearch-jdbc/issues

-> 4. Yes

-> 5. There are JDBC importer scripts in the bin directory that can be copied/modified.

-> 6. In the JDBC importer scripts, you see examples how it works.

Thank you.
I downloaded JDBC driver 2.1.1.2 and mysql connector 5.0.8.
I put mysql connector file in lib directory. Is it enough to change script in bin directory? I didn't understand clearly. What else should I do?

I have mysql database.
I want to move data to elasticsearch from mysql. How can I do? Also is logstash necessary for that?

Please read docs at https://github.com/jprante/elasticsearch-jdbc to get things running and ask questions about JDBC importer at https://github.com/jprante/elasticsearch-jdbc/issues

You have free choice between JDBC importer and Logstash, whatever you prefer.

I'm facing the same problem but in the future we have to migrate our data from mysql to elasticsearch so I created a small program which reads data from mysql into POJOs then I use ES REST API to index these documents. It works well and it's also applicable to make some performance investigations.

Ok I understand you. I read. Thank you.

Last question:

Can I use the sense editor for jdbc driver?
What should I write the following code to the beginning?

.....???
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/admin_ihale",
"user" : "admin_ihale",
"password" : "admin_ihale",
"sql" : "select *, id as _id from tbl_ihale"
}
}

You can not use Sense Editor for JDBC importer. Use your favorite text editor to write the script that contains the JSON importer definition. Run JDBC importer from the command line.

Ok thank you so much

Hi ,
Can you explain to me how it works in the bin folder of the script? Do I have to change all of these script files? Which should I change script files?

** /usr/share/elasticsearch/elasticsearch-jdbc-2.1.1.2/bin directory:**

mysql-delete-document.sh
mysql-geo-points.sh
mysql-geo-shapes.sh
mysql-ignore-null-values.sh
mysql-metawiki.sh
mysql-schedule.sh
mysql-schedule-acknowledge.sh
mysql-simple-example.bat
mysql-state-example.sh
mysql-wikimedia-example.sh
oracle-connection-properties.sh
postgresql-geo.sh
postgresql-simple-example.sh

I have mysql db and I want to move the data into the elasticsearch.
According to my data I didn't changed the script files in the bin folder according to my data.

The scripts are examples. You do not change the scripts. I don't know your use case but I'm confident you can create a new custom script for yourself by studying the existing examples.

ok thank you

Hi,

Can you please inform me,Where to install JDBC plugin in elasticsearch and How it is work?.
I follow the JDBC link but i could not understand exactly..

You don't install it IN Elasticsearch.
You just install it.

It runs on its own.