简体   繁体   English

更新,添加或删除数据后,如何使用ES + Logstash + MySQL进行实时索引更新?

[英]How can I reach real-time index updating using ES + Logstash + MySQL when data was updated, added or deleted?

I have MySQL DB with one table without joins with ~100 millions of rows . 我有一个只有一个表的MySQL DB,没有约1亿行的联接。 These items can be updated or removed and also new records are saved into MySQL DB periodically eg every minute. 这些项目可以更新或删除,新记录也定期(例如每分钟)保存到MySQL DB中 How can I reach updating indexes in Elasticsearch 如何在Elasticsearch中达到更新索引

when data is updated/changed/deleted in MySQL DB?

Actualizing data is must have for me it's very important to stay up to date with MySQL. 对我来说,实现数据是必须的,与MySQL保持最新非常重要。 Is it possible? 可能吗? Thanks. 谢谢。

Also I have tried the solution with schedule => "* * * * *" and updated_at > :sql_last_value but it is very slow. 我也尝试过使用schedule => "* * * * *" and updated_at > :sql_last_value的解决方案,但是它非常慢。

不知道您所说的“非常慢”是什么意思,但是如果它与采样频率有关,则表达式: schedule => "/2 * * * * *"将执行您在语句变量in中定义的查询.config文件每两秒钟。

Thanks for the reply to all, I've found the solution for me thanks to Aaron Mildenstein who helped me on discuss.elastic.co. 感谢所有人的答复,感谢Aaron Mildenstein帮助我在Discussion.elastic.co上找到了解决方案。 See the thread here. 在这里查看线程。

The answer: 答案:

In order to achieve this, you will need a separate process that monitors binlog transactions and initiates updates to the Elasticsearch end of things. 为了实现这一点,您将需要一个单独的过程来监视二进制日志事务并启动对Elasticsearch末尾的更新。 Elastic does not currently offer any tools that do this, so you'll have to find one that someone open sourced, or write your own. Elastic当前不提供执行此操作的任何工具,因此您必须找到别人开源的工具,或者编写自己的工具。

To parse binlogs I used this lib: https://github.com/siddontang/go-mysql-elasticsearch 为了解析二进制日志,我使用了这个库: https : //github.com/siddontang/go-mysql-elasticsearch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在MySQL表中添加新行时实时检查 - How to check in real-time if new row was added to MySQL table 如何使用 node.js、socket.io 和 mysql 显示实时数据? - how to show real-time data using node.js, socket.io and mysql? 如何使用 MySQL 数据和 PHP 在网页上绘制实时控制图? - How to plot real-time control charts on a web page using MySQL data and PHP? 如何使用Java代码将Sql Server的数据(行)实时复制到MySql中? - How to Copy Data (Rows) of Sql Server into MySql in Real-time Using Java Code? 如何从 MySQL 数据库实时更新 LibreOffice Calc 单元格? - How can I update LibreOffice Calc cells in real-time from a MySQL database? 我在使用 python 将实时数据拉入 mysql 数据库时抓取实时数据时遇到错误(TypeError: not enough arguments for format string) - I'm getting an error when scraping real-time data while pulling it into mysql database with python (TypeError: not enough arguments for format string) 实时MySQL监控 - Real-time MySQL monitoring 使用c实时mysql插入查询 - real-time mysql insert query using c 如何在不占用资源的情况下提供实时通知? - How can I provide real-time notifications without tying up resources? 实时记录MySQL慢查询 - Log MySQL slow query in real-time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM