In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what to do about virtual machine data loss caused by server power outage". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn the article "what to do if the virtual machine data is lost when the server is powered off".
Description of virtual machine data loss
Due to a sudden power outage of the server, a VPS (that is, the Xen Server virtual machine) in the Xen Server server is unavailable and the virtual disk file is lost. The hardware environment is that the Dell 720 server wears an H710P raid card, the RAID 10 is composed of four Seagate 2T STAT hard drives, the upper environment is the Xen Server version 6.2 operating system, the virtual machine is the Windows Server 2003 system, the 10G system disk + 5G data disk is two virtual machine disks, and the upper layer is the Web server (ASP + SQL 2005 website architecture).
Analyze the cause of the failure
In order to ensure the security of the customer's original data, we must first connect the customer's data disk to the recovery environment server to prepare for mirrored backup of the data. in this step, it is necessary to prepare more storage space than the total capacity of the customer's hard disk to mirror the data in the form of underlying sectors.
In the case analysis of the underlying data, it is found that the disk of the virtual machine in the Xen Server server is stored in the structure of LVM, that is, the virtual disk of each virtual machine is a LV, and the mode of the virtual disk is reduced mode. The relevant information of LVM is recorded in Xen Server. Looking at the relevant information of LVM under "/ etc/lvm/backup/frombtye.com", it is found that there is no damaged virtual disk information, so it can be concluded that the information of LVM has been updated. Then analyze the bottom layer to see if we can find the unupdated LVM information, and sure enough, we found the unupdated LVM information at the bottom. As shown below:
The data area of the virtual disk is found according to the unupdated LVM information, and it is found that the data in that area has been corrupted. After analysis, it is found that the ultimate reason for the unavailability of the virtual machine is that the virtual disk of the virtual machine is destroyed, resulting in the loss of operating system and data in the virtual machine. The occurrence of this situation is likely to be caused by the malicious programs left behind by the virtual machine after the network attack or hack intrusion. After carefully checking this area, it is found that although a lot of data in this area has been corrupted, a lot of page fragments of the database have been found. So you can try to piece together the page fragments of many databases into a usable database.
Develop a data recovery plan:
1. Implementation plan 1
According to the structure of the RAR package, you can find the data start location of many compressed packages, and the file name of this RAR is recorded in the first sector of the RAR package file. Therefore, according to knowing from the customer that the file name of the compressed package of the backup database matches the file name of the location of the compressed package found at present, the starting location of the compressed package of the backup database can be found. After finding the location of the compressed package, carefully analyze the data in this area, and then restore the data in this area and rename it to a compressed file in RAR format. Then try to extract the package and find that the decompression reported an error.
The error is shown in the following figure:
Careful analysis of the recovered compressed package found that some of the data was corrupted, so an error was reported during decompression. Try using RAR's repair tool to see if you can ignore the error and extract some of the data. As a result, only part of the code of the website was extracted after the repair was completed, and there was no backup file of the database. Therefore, you can judge that the backup file of the data is corrupted in the RAR package.
The following is the extracted part of the website code.
2. Implementation plan 2
Since the database is not recovered by the scheme, the second scheme is adopted to recover the data. According to the structure of the SQL Server database, go to the starting position of the underlying analysis database. In the structure of the database, page 9 will record the database name of the database. So after getting the name of the database from the customer, analyze the underlying layer to find the starting location of the database. Because the database page number and file number are recorded in each page of the database, you can write a program based on these characteristics to scan the data that matches the database page.
Then reassemble the scanned fragments into a complete MDF file in order, and then check whether the whole MDF file is complete by the MDF check program. The rebuilt MDF file is as follows:
Validate data
After testing there is no problem, then build the database environment, and attach the reorganized database to the built database environment. Then query whether the relevant table data is normal, and query whether the latest data exists. The screenshot is as follows:
Summary of virtual machine data recovery:
Because the database needs to be combined with the website code to better verify the integrity of the database. The customer gets the website code from the developer to set up the environment, and then sends the restored database to the user. After verification by the user, there is no problem with the database, the database is successfully restored by spelling database fragments, and the whole data is restored successfully.
The above is all the contents of the article "what to do about the loss of virtual machine data caused by the power outage of the server". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to 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.
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
© 2024 shulou.com SLNews company. All rights reserved.