In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
In the last article, we talked about the replacement and upgrade of the application data disk of the WSFC upper file server. in fact, we can apply this replacement method in many scenarios: first, expansion replacement, which is what we demonstrated in the previous article; second, bad replacement, when the file server is good, copy the data out, and one day suddenly the cluster data disk breaks down and is inserted directly into the new disk. To restore the contents of the backup, click repair disk.
So based on the content mentioned in the previous article, this article will look at a scenario, for SQL Server clustering applications, how to completely replace the clustered disk array.
A SQL cluster has quorum disks, DTC disks, data disks, and even log disks. We assume that these disks are all from the same storage array. What should we do if we want to switch them all to another new storage array?
First of all, according to the repair and replacement methods mentioned in our last article, you can follow the following process
The new array allocates LUN to cluster nodes
Cluster nodes identify storage disks, online, initialize, partition, assign temporary drive letters of non-original cluster disks
First, add the witness disk and directly change the witness disk to the new disk
Offline SQL cluster application, which stops the SQL service to release any open handles on the SQL data file
To copy the full directory contents of the original SQL data disk to the new data disk, you can use Explorer or Xcopy,RoboCopy copy. If the database file permissions are set, it can be processed here.
Record the existing DTC application configuration, delete, and rebuild the new DTC application based on the new disk as is
Click SQL to apply the existing data disk, right-click repair, and select a new data disk
Online SQL application
The original SQL data disk is automatically deleted from the SQL cluster application and from the cluster available disk
According to Lao Wang's research, there are several methods for disk replacement of SQL clusters in addition to this method.
New replacement: do not use repair replacement, use the new disk to the SQL resource group, and manually modify the drive letter. Disadvantages: a little bit complicated, need to understand the cluster disk replacement process, if not careful operation error will cause the application can not be online
Backup and recovery: some friends on the Internet have introduced a method to back up the MDF,LDF for the database in advance, and then add a new disk, delete the original disk, and add a restore database. Disadvantages: if there are too many databases, you will need to perform multiple database backups. If there are not many databases, it may be applicable, but the recovery of database permissions should be taken into account.
Reinstall replacement: directly rebuild a cluster, and then restore from the backed up database files, the disadvantage: if there are many database instances, reinstallation will be very time-consuming. If there is only one database instance, it may be applicable, but you still need to consider the recovery of database permissions.
Tool replacement: there are some third-party tools that can help us restore and migrate databases in batches between two clusters, or between two SQL instances, or from files to databases, while ensuring the recovery of database permissions, but operators need to be familiar with third-party tools
Based on the consideration, we decided to adopt the most familiar and safe way of repair and replacement.
Environment introduction
DNS&iscsi
Lan:10.0.0.2 255.0.0.0
Iscsi:30.0.0.2 255.0.0.0
08node1
MGMET:10.0.0.3 255.0.0.0 DNS 10.0.0.2
ISCSI:30.0.0.3 255.0.0.0
CLUS:18.0.0.3 255.0.0.0
08node2
MGMET:10.0.0.4 255.0.0.0 DNS 10.0.0.2
ISCSI:30.0.0.4 255.0.0.0
CLUS:18.0.0.4 255.0.0.0
Currently, the SQL cluster has been configured with DTC and SQL applications.
Verify that SQL Server failover, and queries, work properly
The time node comes to the second step
Each node gets the newly allocated storage and has completed the partition formatting
The newly allocated S O X are the new witness disk, the new DTC disk, and the new data disk.
The data in the witness disk and DTC disk can be rebuilt, so there is no need to consider the drive letter problem.
Add a new array witness disk, DTC disk is available to the cluster
Click Cluster name-more actions-configure Cluster Arbitration Settings
Before selecting the witness storage, uncheck the old storage and check the new witness disk as the witness.
After the configuration, you can see that the cluster witness disk has automatically become a new array disk, and the original witness disk has been moved to the cluster available storage. At this time, it no longer works and can be selected to be removed from the cluster available storage.
The witness disk replacement here is very simple, because the function of the witness disk is to help one party survive when the partition occurs, to store the copy of the cluster database, and each node has the copy of the cluster database. the new witness disk is nothing more than adding it to re-synchronize the latest copy of the cluster database with each node.
In the actual witness disk replacement process, following the normal steps, there is usually no downtime, because it is almost instantaneous. After 2012, there will be dynamic arbitration, let alone downtime. If it is found that the replacement witness disk process has an unexpected outage before 2012, you can use compulsory arbitration to start the cluster service.
Next, we need to deal with DTC and SQL,SQL cluster applications, but what is different about other cluster applications is that it may be used anytime and anywhere, and there is a handle to open its files, so we need offline SQL cluster applications to copy files and deal with DTC. This is also the disadvantage of this scheme, if we use backup replacement, tool replacement, we will not face this problem. The downtime of this process depends on the database copy time.
Offline SQL cluster applications, downtime begins
If you find that the SQL old data disk is not visible in this step, you can put the SQL old data disk online separately in order to copy files, and all handles connected to the SQL cluster application have been closed
Copy the entire old data directory to the new data disk. If you have permission settings for the database file, you can use xcopy,robocopy to process it here.
Record the existing DTC application configuration, then delete, rebuild
Here, for DTC applications, we can choose this method of direct reconstruction, or if it is not convenient for you to rebuild, repair and replace, or add and replace, there is no irreplaceable data in the DTC application itself, but only for distributed coordination among SQL nodes. So we have no problem with direct reconstruction.
Finally, replace the data disk of the SQL application with repair, right-click on the SQL application cluster disk 5-more actions-repair
The cluster disk 5 state here must be offline before you can use the repair.
Select a new data disk to copy the completed data
Like file server replacement, the repair wizard directly helps us to bring the old cluster disk information to the new cluster disk, confirming that the drive letter is the old drive letter.
Online SQL cluster application
Verify that the failover can be performed normally
Verify that the database query can be performed normally
At this point, we have completed all storage replacements for SQL cluster applications.
The advantage of using this replacement method is that we don't have to backup and restore data one by one, and we don't have to go to the problem of care permission, because we copy all the files intact.
The disadvantage is that SQL applications have a long downtime, mainly the time to copy database directories offline. In the actual environment, there may be some more flexible ways, such as freezing the SQL write handle before leaving work, then copying the file, directly replacing Witness, DTC, and then repairing SQL after work.
The above are two articles about cluster replacement storage brought by Lao Wang, hoping to bring benefits to interested friends.
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.