user2694306
user2694306

Reputation: 4050

MariaDB and Elasticsearch

I have been using elasticsearch with MySQL without any problems recently. My server was recently migrated over from MySQL to MariaDB and now the JDBC river just seems to freeze up with even the most basic syncs. Does anyone know if they are compatible?

Here is a sample code:

PUT /_river/my_jdbc_river/_meta
{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "jdbc:mysql://HOST/DATABASE",
        "user": "username",
        "password": "password",
        "sql" : "select * from table"
    }
}

It just hangs on the following:

[2014-05-19 16:11:49,080][INFO ][cluster.metadata         ] [Wade Wilson] [_river] update_mapping [my_jdbc_river] (dynamic)
[2014-05-19 16:11:49,082][INFO ][org.xbib.elasticsearch.river.jdbc.JDBCRiver] [Wade Wilson] [jdbc][my_jdbc_river] starting JDBC river: URL [jdbc:mysql://HOST/DATABASE], strategy [simple], index/type [jdbc/jdbc]
[2014-05-19 16:11:49,083][INFO ][org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverMouth] waiting for cluster state YELLOW
[2014-05-19 16:11:49,083][INFO ][org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverMouth] ... cluster state ok
[2014-05-19 16:11:49,094][INFO ][cluster.metadata         ] [Wade Wilson] [_river] update_mapping [my_jdbc_river] (dynamic)
[2014-05-19 16:11:49,113][INFO ][cluster.metadata         ] [Wade Wilson] [_river] update_mapping [my_jdbc_river] (dynamic)

Upvotes: 0

Views: 3613

Answers (2)

Nam Nguyen
Nam Nguyen

Reputation: 2498

Download mariadb-java-client-1.1.7.jar at https://downloads.mariadb.org/client-java/1.1/

them move mariadb-java-client-1.1.7.jar into /your_path_to_elasticsearch/plugins like below:

> [root@SpaceConnection elasticsearch-1.3.4]# ll plugins/jdbc/
> -rw-r--r-- 1 root root 280826 Oct 16 22:03 elasticsearch-river-jdbc-1.3.4.0.jar
> -rw-r--r-- 1 root root    380 Oct 16 22:03 log4j2.xml
> -rw-r--r-- 1 root root    234 Oct 16 22:03 log4j.properties
> -rw-r--r-- 1 root root 230704 Mar 29  2014 mariadb-java-client-1.1.7.jar

then run bin/elasticsearch

[2014-10-16 23:34:41,712][INFO ][node                     ] [Apache Kid] version[1.3.4], pid[15632], build[a70f3cc/2014-09-30T09:07:17Z]
[2014-10-16 23:34:41,712][INFO ][node                     ] [Apache Kid] initializing ...
[2014-10-16 23:34:41,734][INFO ][plugins                  ] [Apache Kid] loaded [jdbc-1.3.4.0-e13884c], sites []
OpenJDK Server VM warning: You have loaded library /var/www/html/bibi.baonam/elasticsearch-1.3.4/lib/sigar/libsigar-x86-linux.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
[2014-10-16 23:34:45,060][INFO ][node                     ] [Apache Kid] initialized
[2014-10-16 23:34:45,060][INFO ][node                     ] [Apache Kid] starting ...
[2014-10-16 23:34:45,195][INFO ][transport                ] [Apache Kid] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/118.69.197.136:9300]}
[2014-10-16 23:34:45,225][INFO ][discovery                ] [Apache Kid] elasticsearch/rn5hDK2YTCKsC53RKt5MMg
[2014-10-16 23:34:48,244][INFO ][cluster.service          ] [Apache Kid] new_master [Apache Kid][rn5hDK2YTCKsC53RKt5MMg][SpaceConnection][inet[/118.69.197.136:9300]], reason: zen-disco-join (elected_as_master)
[2014-10-16 23:34:48,286][INFO ][http                     ] [Apache Kid] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/118.69.197.136:9200]}
[2014-10-16 23:34:48,288][INFO ][node                     ] [Apache Kid] started
[2014-10-16 23:34:49,087][INFO ][gateway                  ] [Apache Kid] recovered [2] indices into cluster_state

Note at line 3: [2014-10-16 23:34:41,734][INFO ][plugins ] [Apache Kid] loaded [jdbc-1.3.4.0-e13884c], sites []

Of course, you must install step by step at https://github.com/jprante/elasticsearch-river-jdbc#how-to-start-the-jdbc-river before

Upvotes: 0

user3678044
user3678044

Reputation: 11

Download MariaDB's "connector":

https://mariadb.com/kb/en/about-the-mariadb-java-client/

Upvotes: 1

Related Questions