我有一张20GB数据表,其中有5000万行。需要使用logstash jdbc输入插件迁移到ElasticSearch。我已经尝试了所有基本的实现,但需要帮助才能批量迁移数据,即一次只能处理10,000行。我不知道如何以及在何处指定此计数以及下次运行logstash时如何更新它。请帮我解决这个问题Logstash JDBC输入插件:以批量计数从mysql迁移数据
这是我有:
input {
jdbc {
jdbc_driver_library => "mysql-connector-java-5.1.12-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost/db"
jdbc_validate_connection => true
jdbc_user => "root"
jdbc_password => "root"
clean_run => true
record_last_run => true
use_column_value => true
jdbc_paging_enabled => true
jdbc_page_size => 5
tracking_column => id
statement => "select * from employee"
}
}
在此先感谢。
这有帮助吗? https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_dealing_with_large_result_sets – Val
谢谢瓦尔,请给我举一些例子,说明如何实现它。 – Chitra
有一篇优秀的博客文章,提供了从A到Z的示例:https://www.elastic.co/blog/logstash-jdbc-input-plugin – Val