Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the underlying storage principle of Elasticsearch?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

What this article shares with you is about the underlying storage principle of Elasticsearch. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. The data is first written into the jvm memory of es, where the data is not visible to the outside world.

two。 By default, the data of jvm is written to the os cache of the underlying lunces every 1 s, and the data can be queried once it is written to os cache. So es can do near real-time search.

3. By default, data is flush from os cache to disk every 30 minutes, becoming segment file one by one.

At this point, someone may ask whether the data is lost if the node is down. In order to solve this problem, es defaults to generate translog logs every 5 seconds to be persisted to disk for data recovery during node restart (you can understand it as binlog in mysql) 4 Magi Translog is also written to os cache by default. When translog reaches a certain value, it will trigger the commit operation and generate disk files. 5 Primary shard will be synchronized to other replica shard after a successful write.

6. When both the primary shard and replica shard nodes are written, the orchestrating node will return the response that the data was successfully written to the client.

Es will perform regular merge operations and merge segment file. When we delete index data, we do not physically delete the index data, but mark the data and delete logically. When we merge segment, we will physically delete the files whose tags are deleted.

Finally, I will paste a picture for you to understand: the original creator of this picture, Zhonghua Shishan, please notify as soon as possible if there is any infringement.

These are the underlying storage principles of Elasticsearch, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report