Hi,everyone
I had some trouble synchronizing data with logstash(with input-jdbc) between MySQL and elasticsearch.When data start sync,i can see it will keep rolling over and over again,even the condition is false.
I made the full sync first,when i made the incremental sync,it happens.
And i set muiltple-table sync,one configure file per table.I have to say that not all of these tables will happen,only some of them.
And here's one of my configuration
comment.conf:
input {
stdin {
}
jdbc {
jdbc_connection_string => "jdbc:mysql://172.21.0.24:3306/mena"
jdbc_user => "u"
jdbc_password => "p"
jdbc_driver_library => "/application/logstash-5.3.0/mysql-connector-java-5.1.40.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "/application/logstash-5.3.0/mysql/comment.sql"
last_run_metadata_path => "/application/logstash-5.3.0/conf.d/.logstash_jdbc_last_run-comment"
schedule => "* * * * *"
type => "comment"
}
}
output {
elasticsearch {
hosts => ["172.21.0.26:9280","172.21.0.27:9280"]
index => "mena"
document_type => "comment"
document_id => "%{id}"
}
stdout {
codec => json_lines
}
}
comment.sql:
select * from comment where es_timestamp >= :sql_last_value
BTW,the type of column "es_timestamp":
es_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
Did I do sth wrong? or i haven't made myself clear yet,please just tell me.
Thanks to you guys.