简体   繁体   English

如何使用Elasticsearch从索引同步数据库

[英]How to Synchronize the DB from Index Using Elasticsearch

I have an use case where an Elasticsearch index and a MySQL Database should be remain synchronized and meet the following conditions. 我有一个用例,其中Elasticsearch索引和MySQL数据库应保持同步并满足以下条件。

1) Whenever I insert/update/delete in Elasticsearch index it should be synchronized with the Database(MySQL). 1)每当我在Elasticsearch索引中插入/更新/删除时,都应与数据库(MySQL)同步。

2) This synchronization should be done instantly. 2)此同步应立即完成。

3) For the Elasticsearch Index I am doing insert/update/delete at any time with any number of requests. 3)对于Elasticsearch Index,我可以随时对任意数量的请求进行插入/更新/删除。

How can I do this using Elasticsearch? 如何使用Elasticsearch做到这一点?

Thanks!! 谢谢!!

Check this out - Listener for ES 签出-ES的侦听器

So this is essentially a listener which gets invoked when the index gets updated / deleted . 因此,从本质上讲,这是一个在更新/删除索引时调用的侦听器。 So override the method postCreate ,postIndex and postDelete and accordingly update the MySQl DB 因此,覆盖方法postCreate,postIndex和postDelete并相应地更新MySQl DB

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

相关问题 如何在Elasticsearch中使用Java API在单个索引(db)中创建多个类型(表) - How to Create more than one type(table) in single Index(db) using Java API in Elasticsearch 如何在Elasticsearch中从索引获取索引ID - How to get index ids from an index in elasticsearch Java:如何同步对数据库的访问? - java: How to synchronize access to db? 相同的应用程序部署在两个不同的服务器中,但是从数据库中获取相同的数据。 如何同步数据库数据 - Same application deployed in two different servers but fetching same data from DB. How to synchronize DB data 使用java将数据从Dynamo DB推送到elasticsearch - Push data from Dynamo DB to elasticsearch using java 使用Kotlin的RxJava-如何同步2种异步方法,从Java重构 - RxJava using Kotlin - how to synchronize 2 asynchronous methods, refactor from Java 如何擦除ElasticSearch索引? - How to erase ElasticSearch index? 如何聚合来自相同索引但来自多种类型的ElasticSearch文档? - How to aggregate ElasticSearch documents from same index but from multiple types? 如何使用SAML同步会话? - How to Synchronize session using SAML? 如何使用term_vector在elasticsearch中索引新文档? - How to index new document in elasticsearch using term_vector?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM