问题
I've ran this query and it worked well.
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/test",
"user" : "myaccount",
"password" : "myaccount",
"sql" : "select * from orders"
}
}'
Everything seems to be indexed. However, when I changed a data from the Orders Table, the changes did not reflect the document in ElasticSearch. Is it possible to automatically sync updated/changed data?
回答1:
You need to add another parameter for schedule
to tell jdbc-river to pull data periodically.
Here is a reference to this.
回答2:
I'm using elastic search on Windows 7. I have a trouble with load river-jdbc to sync elasticsearch with mysql. I try loading all river-jdbc river but the result is :
Execution Error
[java.lang.NoClassDefFoundError:org/elasticsearch/rest/XcontentThrowableRestResponse], NoClassDefFoundError[org/elasticsearch/rest/XcontentThrowableRestResponse], ClassNotFoundExeption[org/elasticsearch/rest/XcontentThrowableRestResponse]
P/s: OS: Window 7, elasticsearch 1.2.1, mysql-connector-java-5.1.25-bin.jar
来源:https://stackoverflow.com/questions/24341441/automatically-syncing-elasticsearch-with-sql