WSFC SQL application disk array substitution

Source: Internet
Author: User
Tags failover file permissions robocopy

In the previous article, we talked about the WSFC upper-level file server application data disk replacement and upgrade, in fact, we can have a lot of scenarios to apply this replacement, first, the expansion of replacement, as we demonstrated in the previous article, the second, bad damage replacement, in advance file server good time, the data copied out, One day suddenly the cluster data disk is broken, insert the new disk directly, restore the contents of the backup, click on the repair Disk.


So, based on what was mentioned in the previous article, let's look at a scenario where a complete replacement of a clustered disk array should be done for a SQL Server cluster application.


A SQL cluster will have quorum disks, DTC disks, data disks, and even log disks, and we assume that all of these disks are from the same storage array, and now it's time to switch to another new storage array and what to do.


First, depending on the fix replacement method that we mentioned in the previous article, you can follow these process actions


  1. New array allocation LUN to cluster node

  2. Cluster nodes identify storage disks, online, initialize, partition, allocate non-original cluster disk temporary drive letter

  3. First add a witness disk, change the witness disk directly to a new disk

  4. Offline SQL cluster app, which stops the SQL service to free any open handles on the SQL data file

  5. Copy the entire contents of the original SQL data disk to the new data disk, you can use the Resource Manager, or use the xcopy,robocopy copy, if the database file permissions have been set, here can be processed

  6. Log existing DTC application configuration, delete, rebuild new DTC application as-is based on new disk

  7. Click on SQL to apply the existing data disk, right click on repair, select new data disk

  8. Online on-line SQL app

  9. The original SQL data disk is automatically removed from the SQL cluster application and removed from the cluster free disk


According to Lao Wang's research, the disk replacement for SQL cluster, in addition to this method, there are several methods


    1. New Replacement : Use the new disk to the SQL resource group and manually modify the drive letter without replacing it with a fix. Cons: A little bit more complex, need to understand the cluster disk replacement process, if careless operation error will cause the app not to come online

    2. Backup Recovery : Online also has a friend introduced a method, in advance for the database for Mdf,ldf backup, after the new disk, delete the original disk, additional restore database. Disadvantage: If you have too many databases, you will need to perform multiple database backups, which may apply if the database is not large, but take into account the recovery of database permissions

    3. Reload Replacement : Rebuild a cluster directly and restore from the backed-up database file, disadvantage: If you have a large number of database instances, reloading will be time-consuming. If there is only one DB instance, it may work, but you still need to consider the recovery of database permissions.

    4. Tool Replacement : There are third-party tools that can help us to batch restore the migrated database between two clusters, or two SQL instances, or from file to database, while maintaining database permissions, but requiring operators to be familiar with third-party tools


Based on consideration we decided to adopt the most familiar and secure replacement method


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


The current SQL cluster has been configured with DTC, and the SQL application

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/09/63bf8bf342347bd08266bb79b27d0145.png "title=" 2017-11-09_084427.png "alt=" 63bf8bf342347bd08266bb79b27d0145.png "/>

Verify that SQL Server failover, and queries are working correctly

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/09/b6e12b71e70e4620718460617a0da94a.png "title=" 2017-11-09_084455.png "alt=" B6e12b71e70e4620718460617a0da94a.png "/>

Time node comes second step


Each node is stored with the newly allocated storage, and the partition has been formatted

The newly assigned S O X are new witness disks, new DTC disks, new data disks, respectively

Where the data inside the witness disk and the DTC disk can be rebuilt, so there is no need to consider the drive letter problem

650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/09/b3e80768f84131297a42f079fd7cfbaf.png "title=" 2017-11-09_085151.png "alt=" B3e80768f84131297a42f079fd7cfbaf.png "/>


Add a new array witness disk, the DTC disk is a cluster free disk

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/09/423820aa9f3279cec328fd787207a0c1.png "title=" 2017-11-09_091255.png "alt=" 423820aa9f3279cec328fd787207a0c1.png "/>

Click the cluster name-more operations-Configure cluster quorum settings

650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/09/8b8b286b45e9ea8ecede1a746ffd6e81.png "title=" 2017-11-09_085557.png "alt=" 8b8b286b45e9ea8ecede1a746ffd6e81.png "/>

Uncheck the old storage before selecting the witness store, tick the new witness disk as a witness

650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/09/d932d281fd57ad18d2f6e98e69659c52.png "title=" 2017-11-09_085658.png "alt=" D932d281fd57ad18d2f6e98e69659c52.png "/>

Configuration completion you can see that the cluster witness disk has automatically become a new array disk, the original witness disk is moved to the cluster available storage, it has no effect, you can choose to remove from the cluster available storage.

650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/09/8f825c1b8a4c4e6be6b314d73fdda3d1.png "title=" 2017-11-09_085830.png "alt=" 8f825c1b8a4c4e6be6b314d73fdda3d1.png "/>

The witness disk substitution here is very simple, because the function of the witness disk is nothing more than to help one side to survive when a partition occurs, to store a copy of the cluster database, to have the cluster database copy of each node itself, and a new witness disk to be added to re-synchronize the latest cluster database copy with each node


In the actual witness disk replacement process, follow the normal steps, usually no downtime, because it is almost instantaneous, there is a dynamic quorum after 2012, not downtime, if before 2012, found that the replacement witness disk process unexpected downtime, you can use forced quorum to start the Cluster service.


Next we need to deal with the DTC and the Sql,sql cluster application can be different from other cluster applications is that it may be used anywhere, there is a handle to open its files, so we need an offline SQL cluster application to do the copying of files and processing DTC operations, which is the disadvantage of this scenario, If you replace the tool with a backup, you do not face this problem, and the process downtime depends on the database copy time.


Offline SQL cluster application, start of outage time

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/09/d4e492d5b655497fff99352b175685be.png "title=" 2017-11-09_090511.png "alt=" D4e492d5b655497fff99352b175685be.png "/>

In this step, if you find that the SQL old data disk is not visible, you can bring the SQL old data disk online to copy the file, all the handles connected to the SQL cluster application are closed

650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/09/268092a4fbc52146e4bd1657e644db9e.png "title=" 2017-11-09_090850.png "alt=" 268092a4fbc52146e4bd1657e644db9e.png "/>

Copy the entire old data directory to the new data disk, and if you have permission settings for the database file, you can use xcopy,robocopy for processing

650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/09/a46a68822bbb0144a15ca1de17a0c6e8.png "style=" float: none; "title=" 2017-11-09_090654.png "alt=" A46a68822bbb0144a15ca1de17a0c6e8.png "/>

650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/09/f14b76cb8ff638c192c954e48470b613.png "title=" 2017-11-09_090711.png "alt=" F14b76cb8ff638c192c954e48470b613.png "/>

Log existing DTC app configuration, then delete, rebuild

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/09/deaa547ec121c003d35464e6a610711e.png "title=" 2017-11-09_091124.png "alt=" Deaa547ec121c003d35464e6a610711e.png "/>


650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/09/dd4fd30eda8f8a3f70006b8dc3374ee7.png "title=" 2017-11-09_091438.png "alt=" Dd4fd30eda8f8a3f70006b8dc3374ee7.png "/>

Here for the DTC application, we can choose this way of direct reconstruction, or if you are not easy to rebuild, repair the replacement, the new replacement can also be manipulated, the DTC application itself does not have anything to replace the data, only for the SQL node distributed coordination between. So we have no problem with direct reconstruction.


Finally, use the fix to replace the SQL app's data disk, right-click on the SQL application cluster disk 5-More actions-fix


the cluster disk 5 status here must be offline before you can use Fix

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/09/e4d0d143e4e3a7cb1cff388afbca2933.png "title=" 2017-11-09_091927.png "alt=" E4d0d143e4e3a7cb1cff388afbca2933.png "/>

Select a new data disk to copy the completed data

650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/09/6d9fb3b6c07c077a75c127d1f7bfcd54.png "title=" 2017-11-09_092317.png "alt=" 6d9fb3b6c07c077a75c127d1f7bfcd54.png "/>

As with file server replacements, the Repair Wizard automatically helps us to bring the old cluster disk information into the new cluster disk, confirming that the drive letter is the old drive letter

650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/09/7c52405a2b1b2e96d9093d8d3014c14c.png "title=" 2017-11-09_092723.png "alt=" 7c52405a2b1b2e96d9093d8d3014c14c.png "/>

Online SQL Cluster app

650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/09/0f478943a31309c88824890ad6642b8e.png "title=" 2017-11-09_092908.png "alt=" 0f478943a31309c88824890ad6642b8e.png "/>

Verify that failover can be performed normally

650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/09/5e8c4ef963607a4466bf186bec85a987.png "style=" float: none; "title=" 2017-11-09_093032.png "alt=" 5e8c4ef963607a4466bf186bec85a987.png "/>

Verify that database queries can be performed normally

650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/09/ad1aa817766d8445b44b5f2a71ef918b.png "style=" float: none; "title=" 2017-11-09_093210.png "alt=" Ad1aa817766d8445b44b5f2a71ef918b.png "/>


Here we have completed all storage replacements for SQL cluster applications

With the benefit of this substitution method, we do not have to go back and restore the data one after the other, without going to the care permission issue, because all the files are intact copies.

The disadvantage is that the SQL application has a long downtime, mainly offline copy of the database directory time, the actual environment, perhaps there are some more flexible way, for example, you can freeze the SQL write handle before work, and then copy the file out, after work directly replace the witness, DTC, and then fix the SQL.


The above is the old Wang for everyone to bring two articles about the cluster replacement storage, hoping to bring a harvest for interested friends

This article is from "Lao Wang's Microsoft Technology Research Park" blog, please be sure to keep this source http://wzde2012.blog.51cto.com/6474289/1980187

WSFC SQL application disk array substitution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.