In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to realize the snapshot technology of the server". In the daily operation, I believe that many people have doubts about how to realize the snapshot technology of the server. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to realize the snapshot technology of the server"! Next, please follow the editor to study!
What is snapshot technology?
SNIA (Storage Networking Industry Association) defines a Snapshot as a fully available copy of a specified set of data that includes an image of the corresponding data at a point in time (the point in time at which the copy begins). A snapshot can be either a copy of the data it represents or a copy of the data.
The role of snapshots
The main function of snapshot is to backup and restore online data. When the storage device has an application failure or file corruption, you can quickly recover the data and restore the data to the state of an available point in time. Another function of snapshot is to provide another data access channel for storage users. when the original data is processed by online application, users can access snapshot data and test with snapshot. Snapshot becomes an indispensable function for all storage systems, regardless of the high, middle and low end, as long as they are applied to online systems.
How to implement snapshots
At present, there are two main technologies to realize snapshots, one is Copy On First Write,COFW on first write, sometimes referred to as copy on write (Copy On Write,COW). That is, when the data is written to a storage location for the first time, the original content is read out and written to another location (the storage space reserved for the snapshot, which we call the snapshot space in this article), and then the data is written to the storage device. The next write to this location will no longer perform a write-time copy operation. This kind of technology is often used for the first time in computer-related technologies, and its basic principles are more or less the same, but the objects oriented are different and the applicable situations are different.
We can know from the execution process of COW that this implementation needs to complete one read operation (read the data of the original location) and two write operations (the original location and the write snapshot space) when writing to a storage location for the first time. If the writes are frequent, then this method will consume IO time very much. Therefore, it can be inferred that the snapshot implementation technology in this way is an ideal choice if it is expected that most of the Ipicuro on a volume will be read-based and write-less, because it takes less time to complete the snapshot. In addition, if an application is prone to write hotspots, that is, it only writes to a limited range of data, then the snapshot implementation of COW is also an ideal choice. Because its data changes are limited to one range, multiple write operations to the same data will occur only once. The following figure is a schematic diagram copied while writing:
But the shortcomings of this approach are also very obvious. If writes are too scattered and frequent, the overhead caused by COW is not negligible and sometimes even unacceptable. Therefore, in the application, it is necessary to comprehensively evaluate the usage scenarios of the application system to determine whether the snapshot in this way is applicable or not.
Another technology in snapshot implementation is I _ Redirect O redirection. The read and write operations are redirected to another storage space. During the generation of a snapshot, all write operations will be redirected to another media, and whether read operations require read redirection depends on whether the read location has been redirected since the last snapshot. Read redirection must be performed at the location where there has been write redirection, otherwise there is no need for read redirection. When a snapshot is to be created, the data corresponding to all the redirected write data in the source media since the last snapshot is copied to generate a snapshot at this point in time, and then the redirected write data is written back to the appropriate location in the source media, thus completing a snapshot generation process. The following figure shows the execution of the IO redirection.
Judging from the above process, the key performance impact is the four Istroke O operations (one read source media, one write snapshot data, one read snapshot media, and one write source media) when the snapshot is generated, and the other is redirected computing work. Although it seems that there are a lot of Iripple O operations when the snapshot is finally generated, considering that this operation only happens when the snapshot is generated, especially when the snapshot is generated, it can be sorted to make the reading and writing of the media better, so that the impact is very small. For the current computing power, the redirected computing operation will not become a performance bottleneck. Therefore, this snapshot implementation has little impact during non-snapshot execution. Therefore, this method is more suitable for Write-Intensive (write-intensive) type of storage system. The following figure is a schematic diagram of the snapshot generation process:
SNIA describes the implementation of snapshots into three categories: mirror separation (split mirror), change block (changed block) and concurrency (concurrent). The essence of the latter two in implementation is copy on write and redirection of Iripple O. For split mirror, because of its flexibility and overhead, it is not practical in the actual storage system.
Implementation level of snapshot
The storage structure of a computer is a stack structure similar to that of TCP/IP. The stack includes hardware and software. Different layers in the stack provide services to the upper layer while making use of the interfaces of the lower layer (as shown in the following figure). Therefore, in implementation, snapshots can be implemented on different stack layers. But the effects and characteristics of different layers are different.
Generally speaking, it is not suitable to implement snapshot function in the application layer. Because different applications are very different, the cost of implementing snapshots for different applications is too high. However, implementing snapshots in the application layer is not useless. For example, a typical example of implementing snapshots in the application layer is the snapshot function in vmWare virtualization software. It's just that this snapshot function is not realistic in the storage system.
Secondly, the implementation of snapshot and application in the file system layer also has the same disadvantage, that is, the snapshot function needs to be implemented for different file systems, which is also very expensive. The file systems that implement the functions of snapshots are basically file systems that are implemented by dedicated systems for a particular function. Implementing snapshots at this level lacks flexibility and scalability. This typical example is ZFS.
The more suitable layer to implement the snapshot function should be the volume management layer and the physical layer. Neither of these layers is related to specific applications and file systems. A typical example here is Linux's LVM. On the other hand, there are usually many kinds of snapshots at the hardware level, and the snapshots implemented at this level are generally dedicated systems, and the advantage is that the performance is the best in all ways. However, the snapshot implemented at this level also has an inevitable disadvantage, that is, it cannot understand the upper application logic because it is not associated with specific applications and file systems. it is impossible to guarantee that every snapshot is in a state of data consistency. However, this disadvantage can be reduced or resolved in other ways, such as refreshing the data before generating the snapshot, or checking the consistency of the file system when the snapshot is restored.
At this point, the study on "how to implement the snapshot technology of the server" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Control node: [default] vnc_enabled= false [spic]
© 2024 shulou.com SLNews company. All rights reserved.