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"
}
}