如何将新磁盘添加到现有SQL Server故障转移群集实例

In this article, we are going to see how to add a new disk to an existing SQL Server failover clustered instance (which I will be referring as FCI from now on). Let’s assume a scenario where you have an existing FCI with dedicated data and log drives and you want to add a new disk (Let’s say you have a new requirement to store your backups locally).

在本文中,我们将了解如何将新磁盘添加到现有SQL Server故障转移群集实例(从现在开始,我将其称为FCI)。 假设存在一个现有的FCI,其中具有专用的数据和日志驱动器,并且您想要添加新磁盘(假设您有一个新的要求,将备份存储在本地),这种情况发生。

I will be demonstrating this in my lab setup where I have a two node failover clustered SQL Server 2017 Instance, running on Windows Server 2012 R2. Below is the current state of my FCI from failover cluster manager.

我将在我的实验室设置中对此进行演示,在该示例中,我有一个在Windows Server 2012 R2上运行的两节点故障转移群集SQL Server 2017实例。 以下是故障转移群集管理器中FCI的当前状态。

如何将新磁盘添加到现有SQL Server故障转移群集实例

As you can see I have two disk drives (E$-SQLData and F$-SQLLogs) dedicated to my SQL Server Instance. Now I would like to add a new disk with volume label SQLBacks. First thing first, we need to carve a new disk from SAN and present it to windows (This part will be typically done by Storage admins and or Windows admins depending on your organization). FYI, in my lab environment for the demo purposes, I am leveraging windows server iSCSI for building my SAN infrastructure. In order to create a new disk drive and present to both the nodes of my failover cluster, I am going to create a new iSCSI virtual disk from my SANDC machine. This is the server which acts as Domain Controller and SAN (File and Storage Services role has already been installed and configured) in my lab environment.

如您所见,我有两个专用于我SQL Server实例的磁盘驱动器(E $ -SQLData和F $ -SQLLogs)。 现在,我想添加一个带有卷标SQLBacks的新磁盘。 首先,我们需要从SAN雕刻一个新磁盘并将其呈现给Windows(这部分通常由存储管理员和/或Windows管理员完成,具体取决于您的组织)。 仅供参考,在演示环境中,我将利用Windows Server iSCSI构建SAN基础架构。 为了创建一个新的磁盘驱动器并将其呈现给故障转移群集的两个节点,我将通过SANDC计算机创建一个新的iSCSI虚拟磁盘。 这是在我的实验室环境中充当域控制器和SAN(已安装和配置文件和存储服务角色)的服务器。

如何将新磁盘添加到现有SQL Server故障转移群集实例

创建一个新磁盘 (Creating a new Disk)

Open server manager and navigate to “File and Storage Services” and click on Tasks button located at the top right corner (highlighted in the above screenshot) and select “New iSCSI virtual disk”. This will open a create disk wizard.

打开服务器管理器,然后导航到“文件和存储服务”,然后单击右上角的任务按钮(在上面的屏幕快照中突出显示),然后选择“新iSCSI虚拟磁盘”。 这将打开创建磁盘向导。

如何将新磁盘添加到现有SQL Server故障转移群集实例

Select a path where you want the desired hard disk file to be created. To clarify, this is the folder where we are asking iSCSI services to create VHDX (Hard Disk Image) files which will be presented as hard disks to my cluster nodes eventually.

选择要在其中创建所需的硬盘文件的路径。 为了明确起见,这是我们要求iSCSI服务创建VHDX(硬盘映像)文件的文件夹,该文件最终将作为硬盘呈现给我的群集节点。

After selecting a path, give it a name and size and select a desired iSCSI target. As you can see in the below screenshot, I already have an iSCSI target dedicated to my SQL server FCI. This is where I will be adding my newly created hard disk. (You can notice I have listed both my cluster nodes 192.168.1.116 and 192.168.1.117 as Initiator ID’s under my iSCSI target ‘SQLCLUST’.

选择路径后,为其指定名称和大小,然后选择所需的iSCSI目标。 如下面的屏幕快照所示,我已经有一个专用于我SQL Server FCI的iSCSI目标。 这是我将添加新创建的硬盘的位置。 (您可能会注意到,我已将群集节点192.168.1.116和192.168.1.117都列为iSCSI目标“ SQLCLUST”下的启动程序ID。

如何将新磁盘添加到现有SQL Server故障转移群集实例

Below is the summary of all the steps what I have done so far.

以下是到目前为止我已完成的所有步骤的摘要。

如何将新磁盘添加到现有SQL Server故障转移群集实例

Now, All I have to do is connect to both my cluster nodes and fire up iSCSI initiator and connect the newly created disk. Since I already have my iSCSI target setup on both the nodes, All I have to do is just to refresh the connection and click on Auto Configure under volumes and devices as shown below, Immediately I see my newly created disk under my volume list.

现在,我要做的就是连接到两个群集节点并启动iSCSI启动器并连接新创建的磁盘。 因为我已经在两个节点上都设置了iSCSI目标,所以我要做的就是刷新连接,然后在卷和设备下单击“自动配置”,如下所示,立即在卷列表下看到新创建的磁盘。

如何将新磁盘添加到现有SQL Server故障转移群集实例

Well, we are done with all the hard work, all we are left with is to bring the newly assigned disk Online, Initialize and create a simple volume from Disk Management.

好吧,我们完成了所有艰苦的工作,剩下的就是使新分配的磁盘联机,从“磁盘管理”初始化并创建一个简单的卷。

如何将新磁盘添加到现有SQL Server故障转移群集实例

On the other node(s), just bring the disk online (we don’t have to initialize and format on the second node as that part has been already taken care on the first node where we created the simple volume).

在其他节点上,只需使磁盘联机(我们不必在第二个节点上进行初始化和格式化,因为在创建简单卷的第一个节点上已经对该部分进行了处理)。

Once the newly created drive has been presented to windows, step 1 is to add the new drive to Windows cluster, I am going to perform this using Microsoft failover cluster manager.

将新创建的驱动器呈现给Windows后,步骤1是将新驱动器添加到Windows群集中,我将使用Microsoft故障转移群集管理器执行此操作。

如何将新磁盘添加到现有SQL Server故障转移群集实例

Navigate to storage and select Add disk as shown in the above screenshot, failover cluster manager will automatically detect eligible storage.

导航到存储并选择“添加磁盘”,如上面的屏幕快照所示,故障转移群集管理器将自动检测合格的存储。

如何将新磁盘添加到现有SQL Server故障转移群集实例

如何将新磁盘添加到现有SQL Server故障转移群集实例

Moving on to the next step, add the newly created disk which is listed as available storage in the above screenshot to SQL Server Role.

继续下一步,将新创建的磁盘(在上面的屏幕快照中列为可用存储)添加到SQL Server角色。

In order to do that, Select SQL Server Role, choose Add storage and select the newly created disk as shown below.

为此,请选择“ SQL Server角色”,选择“添加存储”,然后选择新创建的磁盘,如下所示。

如何将新磁盘添加到现有SQL Server故障转移群集实例

如何将新磁盘添加到现有SQL Server故障转移群集实例

Once the cluster disk 3 (G$-SQLBacks) has been added to SQL role, below is how my SQL Server role looks like in failover cluster manager.

将群集磁盘3(G $ -SQLBacks)添加到SQL角色后,下面是故障转移群集管理器中我SQL Server角色的外观。

如何将新磁盘添加到现有SQL Server故障转移群集实例

At this stage, you can see that my SQL Server Instance(SQLPROD1/PROD1) has three disk drives including the one which we just added. Okay, let’s try taking a Full backup of one of the user databases and place it on G$. As you can see in the below screenshot, my SSMS couldn’t even locate the newly added disk drive. Well, basically it’s not allowing me to take a backup pointing to my newly created volume at this point.

在此阶段,您可以看到我SQL Server实例(SQLPROD1 / PROD1)具有三个磁盘驱动器,其中包括我们刚刚添加的磁盘驱动器。 好的,让我们尝试对用户数据库之一进行完整备份,并将其放置在G $上。 如下面的屏幕快照所示,我的SSMS甚至都找不到新添加的磁盘驱动器。 好吧,基本上,这时不允许我进行指向我新创建的卷的备份。

如何将新磁盘添加到现有SQL Server故障转移群集实例

So, what are we missing?

那么,我们缺少什么呢?

Here comes the important part which I often see being ignored. Before going any further below is the screenshot of the dependency report (You can notice, the newly created drive is not tied to SQL Server)

这是重要的部分,我经常看到它被忽略。 下面是相关性报告的屏幕截图(您可能会注意到,新创建的驱动器未绑定到SQL Server)

如何将新磁盘添加到现有SQL Server故障转移群集实例

So, what’s the tricky part? The answer is adding “AND Dependency”. To add this dependency for your newly added physical disk, navigate to SQL Server Resource and go to Properties, locate Dependencies tab and add newly created disk as “AND” dependency as shown in the below screenshots.

那么,棘手的部分是什么? 答案是添加“ AND Dependency”。 要为您新添加的物理磁盘添加此依赖关系,请导航至SQL Server资源,然后转到“属性”,找到“依赖关系”选项卡,然后将新创建的磁盘添加为“ AND”依赖关系,如以下屏幕快照所示。

如何将新磁盘添加到现有SQL Server故障转移群集实例

如何将新磁盘添加到现有SQL Server故障转移群集实例

Once that has been taken care, now here is how my SQL Server dependency report looks like.

处理完之后,现在这里是我SQL Server依赖性报告的样子。

如何将新磁盘添加到现有SQL Server故障转移群集实例

As you can see the newly added physical disk is no longer floating in the air and tied to SQL Server and of course now my SSMS is able to locate G$-SQLBacks drive without any issues.

如您所见,新添加的物理磁盘不再浮空并与SQL Server绑定在一起,当然,现在,我的SSMS能够找到G $ -SQLBacks驱动器而没有任何问题。

如何将新磁盘添加到现有SQL Server故障转移群集实例

This task can be performed without impacting the cluster services or SQL Server services. However, you might want to failover SQL Server services to all other available nodes in your cluster to make sure everything is intact and working as expected. That’s all for the post and I hope this has been helpful.

可以执行此任务,而不会影响群集服务或SQL Server服务。 但是,您可能希望将SQL Server服务故障转移到群集中的所有其他可用节点,以确保一切正常并按预期工作。 这就是帖子的全部内容,希望对您有所帮助。

翻译自: https://www.sqlshack.com/how-to-add-a-new-disk-to-an-existing-sql-server-failover-clustered-instance/