Import data using REIVER-JDBC in Elasticsearch

Source: Internet
Author: User
Tags how to use sql server how to use sql

The river module is provided in Elastisearch to obtain data from other data sources, which exist as Plug-ins, and existing River Plug-ins include:

River Pluginsedit

1. Supported by Elasticsearch

CouchDB River Plugin

RABBITMQ River Plugin

Twitter River Plugin

Wikipedia River Plugin

2. Supported by the Community

ActiveMQ River Plugin (by Dominik Dorn)

Amazon SQS River Plugin (by Alex Bogdanovski)

CSV River Plugin (by Martin Bednar)

Dropbox River Plugin (by David Pilato)

FileSystem River Plugin (by David Pilato)

Git River Plugin (by Olivier Bazoud)

GitHub River Plugin (by Ubervu)

Hazelcast River Plugin (by Steve Samuel)

JDBC River Plugin (by J?rg Prante)

JMS River Plugin (by Steve Sarandos)

Kafka River Plugin (by Endgame Inc.)

LDAP River Plugin (by Tanguy Leroux)

MongoDB River Plugin (by Richard Louapre)

Neo4j River Plugin (by Steve Samuel)

Open Archives Initiative (OAI) River Plugin (by J?rg Prante)

Redis River Plugin (by Steve Samuel)

RSS River Plugin (by David Pilato)

Sofa River Plugin (by Adamlofts)

SOLR River Plugin (by Luca Cavanna)

St9 River Plugin (by Sunny Gleason)

Subversion River Plugin (by Pascal Lombard)

DynamoDB River Plugin (by Kevin Wang)

As can be seen, most of the data sources have been covered, especially for relational databases that provide a unified jdbc-river for data operations.

ELASTICSEARCH-RIVER-JDBC's source code is: GITHUB.COM/JPRANTE/ELASTICSEARCH-RIVER-JDBC, the project provides detailed documentation, and the following is a simple example of how to use SQL Server.

First, you need to install ELASTICSEARCH-RIVER-JDBC and execute it in the Elasticsearch directory:

./bin/plugin--install JDBC--url xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/ 1.1.0.1/elasticsearch-river-jdbc-1.1.0.1-plugin.zip

Then, install the JDBC Library for SQL Server, which is the link: Microsoft JDBC Driver. Copy the ' Sqljdbc4.jar ' to the Elasticsearch installation directory's Lib folder.

Given the Elasticsearch cluster, the above two steps need to be performed on each node.

The last and most critical step is to create a river in the Elasticsearch, allowing Elasticsearch to automatically fetch data from SQL Server.

Put/_river/mytest_river/_meta

{

' type ': ' JDBC ',

"JDBC": {

"Driver": "Com.microsoft.sqlserver.jdbc.SQLServerDriver",

"url": "Jdbc:sqlserver://mysqlservername;databasename=myproductdatabase",

"User": "admin", "password": "Password",

"SQL": "Select ProductID as _id, Categoryid,manufacturerid,mfname,producttitle,mfgpartnumber from Myproductstable ( NOLOCK) ",

"Poll": "10m",

"Strategy": "Simple",

"Index": "Myinventory",

' Type ': ' Product ',

"Bulk_size": 100,

"Max_retries": 5,

"Max_retries_wait": "30s",

"Max_bulk_requests": 5,

"Bulk_flush_interval": "5s"

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.