Friday, January 2, 2015

JDBC

  1. Introduction
    1. The Java Database Connection (JDBC) plugin allows to fetch data from JDBC sources for indexing into Elasticsearch
  2. Installation
    1. cd $ES_HOME
    2. ./bin/plugin --install jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.3.0.4/elasticsearch-river-jdbc-1.3.0.4-plugin.zip
    3. cd
    4. curl -o mysql-connector-java-5.1.28.zip -L 'http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.28.zip/from/http://cdn.mysql.com/'
    5. unzip mysql-connector-java-5.1.28.zip
    6. cd mysql-connector-java-5.1.28
    7. cp mysql-connector-java-5.1.28-bin.jar $ES_HOME/plugins/jdbc/
    8. start / restart ES
    9. create a JDBC river instance. For example,
      curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
          "type" : "jdbc",
          "jdbc" : {
              "url" : "jdbc:mysql://localhost:3306/test",
              "user" : "",
              "password" : "",
              "sql" : "select * from orders"
          }
      }'
  3. reference
    1. https://github.com/jprante/elasticsearch-river-jdbc

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.