Elastisearch provides the river module to obtain data from other data sources. This function exists as a plug-in. The 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)
It can be seen that most data sources have been covered, especially relational databases that provide unified jdbc-river for data operations.
The source code of elasticsearch-river-jdbc is: github.com/jprante/elasticsearch-river-jdbc. this project provides detailed documents. The following uses SQL Server as an example to describe how to use it.
First, install elasticsearch-river-jdbc and run the following command in the elasticsearch directory:
./Bin/plugin -- install jdbc -- url Scheme
Then, install the JDBC library of SQLServer. The link is Microsoft JDBC Driver. Copy 'sqljdbc4. jar' to the lib folder in the installation directory of elasticsearch.
Considering the elasticsearch cluster, the preceding two steps must be performed on each node.
Last but not least, create a river in elasticsearch so that elasticsearch can automatically obtain data from SQLServer.
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": "10 m ",
"Strategy": "simple ",
"Index": "myinventory ",
"Type": "product ",
"Bulk_size": 100,
"Max_retries": 5,
"Max_retries_wait": "30 s ",
"Max_bulk_requests": 5,
"Bulk_flush_interval": "5 s"
}
}