logstash msyql schedule => "* * * * *" 同步shujuelasticsearch中 实现实时同步
Logstash | 作者 elastic_kevin123 | 发布于2017年07月14日 | 阅读数:9198
用 logstash-input-jdbc 将mysql 数据同步到elasticsearch中时候 设置schedule => "* * * * *" 只能一分钟更新一次,怎么可以实现mysql 与elasticsearch与mysql同步,MySQL 变化 立马同步数据到elasticsearch中
3 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: 王社英
elastic_kevin123
赞同来自:
stdin {
}
jdbc {
jdbc_connection_string => "jdbc:mysql://122.128.1.71:3306/fulltransation"
jdbc_user => "root"
jdbc_password => "abcd1234"
jdbc_driver_library => "/usr/local/Cellar/logstash/5.5.0/mysql/mysql-connector-java-5.1.42-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "/usr/local/Cellar/logstash/5.5.0/bin/logstash_jdbc_test/media.sql"
schedule => "* * * * *"
type => "MEDIA"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
}
output {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "deafult_index"
document_id => "%{id}"
}
stdout {
codec => json_lines
}
}
wyntergreg
赞同来自: