Skip to content
This repository has been archived by the owner. It is now read-only.
A river for elasticsearch to automatically index mysql content using the replication feed.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Mysql River Plugin for ElasticSearch

The Mysql River plugin allows to hook into Mysql replication feed using the excellent python-mysql-replication and automatically index it into elasticsearch.

This plugin is based on the elasticsearch-river-couchdb plugin.


This river consists of two parts :

  • one is the elasticsearch plugin
  • the other one is a little webserver to serve an http stream of the mysql replication stream.

The river

To install this plugin, first build it using mvn clean package. Then, use the plugin binary distributed with elasticsearch /path/to/elasticsearch/bin/plugin -url file:./target/releases/elasticsearch-river-mysql-* -install mysql-river

Mysql replication stream

You first need to install dependencies :

  • easy_install pymysql
  • easy_install cherrypy
  • git clone git:// ; cd python-mysql-replication ; python install

Running the river

  • python http_stream/
  • /path/to/elasticsearch/bin/elasticsearch

Plugin activation and configuration

curl -XPUT 'localhost:9200/_river/mydb/_meta' -d '{ "type" : "mysql", "streamer" : { "host" : "localhost", "port" : 8080, }, "mysql" : { # Future usage to configure mysql access from the river. _ } }'

Editing the plugin

To edit the plugin using eclipse, run mvn eclipse:eclipse, then you can import the current directory as an existing project in eclipse.


Bulking is automatically done in order to speed up the indexing process. If within the specified bulk_timeout more changes are detected, changes will be bulked up to bulk_size before they are indexed.


This software is licensed under the Apache 2 license, quoted below.

Copyright 2009-2012 Shay Banon and ElasticSearch <>

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
You can’t perform that action at this time.