为SQL Server Always On可用性组配置故障转移群集,存储控制器和仲裁配置

This article explores the configuration of Windows failover clusters, storage controllers and quorum configurations for SQL Server Always On Availability Groups.

本文探讨了SQL Server Always On可用性组的Windows故障转移群集,存储控制器和仲裁配置的配置。

先决条件 (Prerequisites)

In this series of articles, we will configure the SQL Server always on availability groups from end to end for your learning purpose. We covered the following topics in the previous articles.

在本系列文章中,我们将始终在端到端的可用性组上始终配置SQL Server,以供您学习。 我们在先前的文章中介绍了以下主题。

  1. A comprehensive guide to SQL Server Always On Availability Groups on Windows Server 2016 Windows Server 2016上SQL Server Always On可用性组的全面指南
    1. We installed Oracle Virtual Box with three VM’s

      我们用三个虚拟机安装了Oracle Virtual Box
    2. We did installation of Windows Server 2016 standard edition with desktop experience

      我们完成了Windows Server 2016标准版的安装并具有桌面体验
    3. We covered VM network adapter configurations

      我们介绍了VM网络适配器配置
  2. Configure Domain Controller and Active Directory for SQL Server Always On Availability Groups 为SQL Server Always On可用性组配置域控制器和Active Directory
    1. We installed and configured domain controller, active directory and DNS

      我们安装并配置了域控制器,活动目录和DNS
    2. Assign static IP’s to all VMs

      为所有虚拟机分配静态IP
    3. Join SQL Nodes in the MyDemoSQL.com domain

      在MyDemoSQL.com域中加入SQL节点

To follow along better, try to go over these previous articles before proceeding with this one.

为了更好地跟进,在继续阅读本文之前,请尝试阅读这些先前的文章。

SQL Server Always On可用性组的故障转移群集配置 (Failover Cluster configuration for SQL Server Always On Availability Groups)

We require a minimum of two nodes failover cluster for the SQL Server always on availability groups. We can setup AG without cluster as well starting from SQL Server 2017, but it gives you limited AG functionality. It is out of scope topic for this article series.

对于始终在可用性组上SQL Server,我们至少需要两个节点故障转移群集。 从SQL Server 2017开始,我们也可以设置不带集群的AG,但是它给您有限的AG功能。 这是本系列文章的主题之外。

We prepared the following VMs for our demo purposes.

我们为演示目的准备了以下虚拟机。

Server Name

IP address

Role

VDITest3

10.0.2.15

Domain Controller and Active Directory

SQLNode1

10.0.2.21

Primary Node of SQL AG

SQLNode2

10.0.2.22

Secondary Node of SQL AG

服务器名称

IP地址

角色

VDITest3

10.0.2.15

域控制器和Active Directory

SQLNode1

10.0.2.21

SQL AG的主节点

SQLNode2

10.0.2.22

SQL AG的辅助节点

Now, we have a requirement to set up the Windows failover cluster for SQLNode1 and SQLNode2. To do so, launch Add Roles and Feature Wizard from the server manager. Enable the Failover Clustering feature in both the SQL nodes.

现在,我们需要为SQLNode1和SQLNode2设置Windows故障转移群集。 为此,请从服务器管理器中启动“添加角色和功能向导”。 在两个SQL节点中都启用故障转移群集功能。

Failover Cluster configuration  for SQL Server Always On Availability Groups

Confirm the failover cluster installation for SQL Server Always On Availability Groups.

确认SQL Server Always On可用性组的故障转移群集安装。

Add features

Put a tick mark on Failover Clustering and click on Add Features to install the feature with dependency.

故障转移群集上打勾,然后单击添加功能以安装具有依赖关系的功能。

Failover clustering

Review and confirm the installation. You can see it installs failover Cluster Management Tools along with the Failover Cluster Module for Windows PowerShell.

查看并确认安装。 您可以看到它安装了故障转移群集管理工具以及Windows PowerShell的故障转移群集模块。

Confirm installations

It quickly installs the features on your respective server.

它可以在您各自的服务器上快速安装功能。

Feature installation status

Once you enabled the feature on both nodes, search and launch failover clustering from the start menu. It currently shows no items found because we haven’t configured the cluster yet.

在两个节点上都启用该功能后,请从开始菜单搜索并启动故障转移群集。 由于我们尚未配置集群,因此当前显示未找到任何项目。

No items found

Before we proceeded further, check the ping response from SQLNode1 to SQLNode2 and vice-versa.

在继续进行之前,请检查从SQLNode1到SQLNode2的ping响应,反之亦然。

从SQLNode1到SQLNode2的Ping响应 (Ping response from SQLNode1 to SQLNode2)

Ping response
从SQLNode2到SQLNode1的ping响应 (Ping response from SQLNode2 to SQLNode1)

SQLNode2 to SQLNode1 ping

In case it does not work for you, disable the Windows firewall in both the nodes. Search for Windows Firewall in Start and disable all firewalls.

如果它对您不起作用,请在两个节点中都禁用Windows防火墙。 在“开始”中搜索Windows防火墙并禁用所有防火墙。

Note: Please do not disable the firewall in a production environment due to security reasons.

注意 :出于安全原因,请不要在生产环境中禁用防火墙。

Windows firewall off

始终在可用性组上验证SQL Server的配置 (Validate Configurations for SQL Server always on availability groups)

Click on the Validate Configurations in the Actions menu. You can read the description for learning purposes.

单击“ 操作”菜单中的“ 验证配置 ”。 您可以阅读说明以进行学习。

Validate Configurations

On the next page, add the nodes you want to add in the failover cluster. Here, I added both nodes for my cluster.

在下一页上,将要添加的节点添加到故障转移群集中。 在这里,我为集群添加了两个节点。

Select servers on a cluster

It performs various tests such as cluster configuration, network, Storage and Hyper-V configuration. We can perform limited tests as well, but it is good to perform all tests.

它执行各种测试,例如群集配置,网络,存储和Hyper-V配置。 我们也可以执行有限的测试,但是最好执行所有测试。

Run all validations

On the next page, it shows the servers for validation and lists down all tests it is going to perform.

在下一页上,它将显示用于验证的服务器,并列出了将要执行的所有测试。

Confirm message

It starts validations one by one for all rules. It shows the result of each test, whether passed, failed or any warnings.

它开始对所有规则进行验证。 它显示每个测试的结果,无论是通过,失败还是任何警告。

View rules status

You can review the result of all test parameters in a cluster. Once reviewed, put a check on the Create the cluster now using validated nodes… It does not allow any additional nodes at this point. If you want, you can finish the process and revalidate the cluster servers.

您可以查看集群中所有测试参数的结果。 检查后,选中“ 立即使用已验证的节点创建集群...” ,此时不允许任何其他节点。 如果需要,可以完成此过程并重新验证群集服务器。

Create the cluster now using validated nodes

It launches the Create Cluster Wizard.

它启动创建群集向导。

Create cluster wizard

On the next page, we define an access point for administrating the cluster. It is a cluster name and cluster IP address.

在下一页上,我们定义用于管理集群的访问点。 它是集群名称和集群IP地址。

Cluster name and IP address

Give a unique name for the cluster in your environment along with a virtual IP address. It should be in the IP range of the nodes network.

为您的环境中的群集提供唯一的名称以及虚拟IP地址。 它应该在节点网络的IP范围内。

Cluster configuration

The cluster configuration is now complete. Click Next to start the cluster build process.

集群配置现已完成。 单击“下一步”开始集群构建过程。

Cluster build process

It forms the failover cluster from both SQL nodes specified.

它从指定的两个SQL节点组成故障转移群集。

Forming cluster

Once the process is finished, launch the Failover cluster manager and view the nodes. It should show both nodes in the Up status.

该过程完成后,启动故障转移群集管理器并查看节点。 它应该显示两个节点都处于“启动”状态。

View nodes in the cluster

Click on Roles, and it is empty because we have not added any roles yet in this cluster. You can verify the cluster name as SQLAGCLU.MyDemoSQL.com

单击角色,它为空,因为我们尚未在此集群中添加任何角色。 您可以将群集名称验证为SQLAGCLU.MyDemoSQL.com

No roles available

始终在可用性组上为SQL Server启用域控制器服务器上的iSCSI功能
(Enable iSCSI feature on Domain Controller server for SQL Server always on availability groups
)

In this article, we want to add the cluster storage from the domain controller server. For this purpose, connect to the DC server. Choose the iSCSI Target Server in the Add Roles and Features Wizard.

在本文中,我们要从域控制器服务器添加群集存储。 为此,请连接到DC服务器。 在“添加角色和功能向导 ”中选择iSCSI目标服务器。

Enable iSCSI feature on Domain Controller server for SQL Server always on availability groups

Here we see, it installed the feature on the domain controller server.

在这里,我们看到它在域控制器服务器上安装了该功能。

iSCSI taget

We need to configure the iSCSI target server now. For this purpose, in the server manager, click on the File and Storage Services.

我们现在需要配置iSCSI目标服务器。 为此,在服务器管理器中,单击“ 文件和存储服务”

File and storage services

It opens another page with storage options. Click on the iSCSI from the menu located on the left-hand side.

它会打开另一个带有存储选项的页面。 从左侧菜单中单击iSCSI。

iSCSI configurations

In iSCSI, it does not show any iSCSI virtual disks as now. It shows an option – To create an iSCSI virtual disk, start the New iSCSI virtual Disk Wizard.

在iSCSI中,它不会像现在一样显示任何iSCSI虚拟磁盘。 它显示一个选项– 要创建iSCSI虚拟磁盘,请启动“新建iSCSI虚拟磁盘向导”。

To create an iSCSI virtual disk, start the New iSCSI virtual disk wizard.

Click on the hyperlink, and it launches iSCSI virtual disk wizard.

单击超链接,它会启动iSCSI虚拟磁盘向导。

In the Virtual disk location, select the volume. We have only C drive available in the VM, so it shows that drive information including used and free space.

在虚拟磁盘位置,选择卷。 VM中只有C驱动器可用,因此它显示驱动器信息,包括已用和可用空间。

iSCSI virtual disk wizard for SQL Server Always On Availability Groups configurations

Specify an iSCSI virtual disk name. You can give it any name as per your preference. It creates a .vhdx file in the C:\iSCSI directory.

指定iSCSI虚拟磁盘名称。 您可以根据自己的喜好给它起任何名字。 它在C:\ iSCSI目录中创建一个.vhdx文件。

iSCSI virtual disk name

Specify a size for the virtual disk. You can configure a fixed or dynamic size. We should use a fixed size virtual disk for better performance.

指定虚拟磁盘的大小。 您可以配置固定大小或动态大小。 我们应该使用固定大小的虚拟磁盘以获得更好的性能。

iSCSI virtual disk size

We do not have any existing iSCSI target, so select the option to create a new iSCSI target.

我们没有任何现有的iSCSI目标,因此选择创建新iSCSI目标的选项。

New iSCSI target

Specify a target name for the iSCSI.

指定iSCSI的目标名称。

Target name and access

On the next page, we define the servers which will have access to the virtual disk. You can specify the node IP address and add it to the console.

在下一页上,我们定义可以访问虚拟磁盘的服务器。 您可以指定节点IP地址并将其添加到控制台。

Access servers

Similarly, search for the SQLNod2 IP address and add it.

同样,搜索SQLNod2 IP地址并将其添加。

Add Node 2 IP address

We get both SQL Nodes as part of the virtual disk access list.

我们将两个SQL节点都作为虚拟磁盘访问列表的一部分。

Specify server access

Click Next and confirm your selections for the iSCSI target.

单击“下一步”并确认对iSCSI目标的选择。

Confirm selections

Click Create. We created the iSCSI targets successfully.

单击创建。 我们成功创建了iSCSI目标。

iSCSI targets success

We configured the iSCSI target on the domain controller server. We need to use iSCSI initiator wizard on both the nodes to reflect the virtual disks on the failover cluster.

我们在域控制器服务器上配置了iSCSI目标。 我们需要在两个节点上使用iSCSI启动器向导来反映故障转移群集上的虚拟磁盘。

Connect to the SQLNode1 and launch the iSCSI initiator from the Server Manager -> tools -> iSCSI initiator.

连接到SQLNode1并从服务器管理器->工具-> iSCSI启动器启动iSCSI启动器。

In the iSCSI initiator, it asks for an iSCSI target.

在iSCSI启动器中,它要求一个iSCSI目标。

iSCSI initiator.

Our iSCSI target is on the domain controller server, so specify the IP address of DC. It is 10.0.2.15 in my case. Click on Quick Connect after specifying the IP address.

我们的iSCSI目标位于域控制器服务器上,因此请指定DC的IP地址。 在我的情况下是10.0.2.15。 指定IP地址后,单击快速连接

Quick Connect

It shows you a list of iSCSI targets available on the specified IP address. We already have configured one iSCSI target, so select the discovered target and click done.

它显示了指定IP地址上可用的iSCSI目标的列表。 我们已经配置了一个iSCSI目标,因此选择发现的目标并单击完成。

select the iSCSI target

Now, launch the Computer Management and click on Disk Management. In the disk management, it shows you the available Storage.

现在,启动计算机管理,然后单击磁盘管理。 在磁盘管理中,它显示可用的存储。

In the below screenshot, we see a root drive along with a 10 GB unallocated space. It is the same virtual disk of 10 GB that we configured earlier.

在下面的屏幕截图中,我们看到一个根驱动器以及一个10 GB的未分配空间。 它与我们先前配置的10 GB虚拟磁盘相同。

View cluster disk

Right-click on this disk and choose New Simple Volume. It opens the simple volume configuration wizard.

右键单击该磁盘,然后选择“ 新建简单卷” 。 它打开简单的卷配置向导。

New Simple Volume

In the volume size, we can specify a different size for the volume, but it cannot exceed the virtual disk maximum size we specified earlier.

在卷大小中,我们可以为卷指定其他大小,但不能超过我们先前指定的虚拟磁盘最大大小。

New Simple Volume size

Simple Volume drive letter

On the next page, assign a volume label and select the option to format this volume.

在下一页上,分配卷标签,然后选择格式化该卷的选项。

New Simple Volume label

Finish the wizard, and it shows up the drive, as shown below.

完成向导,它会显示驱动器,如下所示。

View disk

将磁盘添加为群集资源 (Add the disk as a cluster resource)

To add this disk as a cluster resource, open the failover cluster manager and click on Storage -> Disks. Currently, It does not show any clustered disk in the console.

要将此磁盘添加为群集资源,请打开故障转移群集管理器,然后单击存储->磁盘。 当前,它在控制台中不显示任何群集磁盘。

Add the disk as a cluster resource

Click on Add Disk, and it shows up the virtual disk we created earlier.

单击添加磁盘,它将显示我们之前创建的虚拟磁盘。

disk

It adds the cluster disk in the failover cluster manager as shown below.

它将群集磁盘添加到故障转移群集管理器中,如下所示。

View cluster disk

群集仲裁配置 (Cluster Quorum configuration)

Quorum is an essential and critical component of a Windows failover cluster. A quorum keeps running the failover cluster based on the majority of votes in the group. It uses a voting mechanism to check for the node’s majority. It also helps to avoid a split-brain scenario where none of the nodes owns the resources.

仲裁是Windows故障转移群集的重要组成部分。 仲裁将根据组中的大多数票数继续运行故障转移群集。 它使用表决机制来检查节点的多数票。 这也有助于避免出现裂脑的情况,在这种情况下,任何节点都不拥有资源。

We have the following quorum configurations in the Windows server.

Windows服务器中具有以下仲裁配置。

  • Node Majority

    节点多数
  • Node and Disk Majority

    节点和磁盘多数
  • Node and File Share Majority

    节点和文件共享占多数
  • No Majority

    没有多数
  • Dynamic Quorum configuration

    动态仲裁配置

I suggest you go through the article Windows Failover Cluster Quorum Modes in SQL Server Always On Availability Groups to understand this in detail.

我建议您仔细阅读SQL Server Always On可用性组中的Windows故障转移群集仲裁模式一文,以详细了解此内容。

Now, right-click on the Cluster name and go to More Actions -> Configure Cluster Quorum Settings.

现在,右键单击群集名称,然后转到“其他操作”->“ 配置群集仲裁设置”。

Cluster Quorum configuration

It launches the cluster quorum wizard with a brief introduction.

它将启动群集仲裁向导并进行简要介绍。

Quorum configuration wizard

Select the option Advanced quorum configuration from the quorum confirmation options.

从仲裁确认选项中选择选项高级仲裁配置

Quorum option

We can decide which nodes can do voting in a failover cluster configuration. By default, it selects all failover cluster nodes for voting eligibility.

我们可以决定在故障转移群集配置中哪些节点可以进行投票。 默认情况下,它将选择所有故障转移群集节点以具有投票资格。

Quorum voting configuration

Select the file share witness as a quorum witness on the next page.

在下一页上选择文件共享见证作为法定见证。

Quorum witness

Before we proceed for the next step, create a file share in the domain controller VM and permit the Windows account by which we log in to SQL nodes. Ideally, you should not create the file share on the cluster nodes because in case that particular node goes down, file share witness also goes down.

在继续下一步之前,请在域控制器VM中创建文件共享,并允许我们使用Windows帐户登录SQL节点。 理想情况下,不应在群集节点上创建文件共享,因为如果特定节点发生故障,文件共享见证也将发生故障。

Specify the shared folder path as a file share path.

将共享文件夹路径指定为文件共享路径。

File share witness

Review your configuration and confirm to proceed further.

查看您的配置并确认以继续。

Quorum confirmation

It has successfully configured the file share witness in our failover cluster configuration, as shown below.

它已成功在我们的故障转移群集配置中配置了文件共享见证,如下所示。

Quorum settings

You can connect to the failover cluster manager, and it shows the file share witness in the console.

您可以连接到故障转移群集管理器,它在控制台中显示文件共享见证。

View quorum in a cluster

结论 (Conclusion)

In this article, we configured the failover clusters on the virtual machine we created earlier. It also shows the iSCSI and file share witness quorum for SQL Server Always On Availability Groups. It completes the underlying foundation or infrastructure for always on configuration. In the next article, we will install SQL Server 2019 and configure an AG group.

在本文中,我们在之前创建的虚拟机上配置了故障转移群集。 它还显示了SQL Server Always On可用性组的iSCSI和文件共享见证仲裁。 它为始终在线的配置奠定了基础或基础架构。 在下一篇文章中,我们将安装SQL Server 2019并配置一个AG组。

目录 (Table of contents)

A comprehensive guide to SQL Server Always On Availability Groups on Windows Server 2016
Configure Domain Controller and Active Directory for SQL Server Always On Availability Groups
Configure failover clusters, storage controllers and quorum configurations for SQL Server Always On Availability Groups
Install SQL Server 2019 on Windows Server 2016 with SQL Server Always On Availability Groups
Add a new node into existing SQL Server Always On Availability Groups
Configure Managed Service Accounts for SQL Server Always On Availability Groups
Windows Server 2016上SQL Server Always On可用性组的全面指南
为SQL Server Always On可用性组配置域控制器和Active Directory
为SQL Server Always On可用性组配置故障转移群集,存储控制器和仲裁配置
在Windows Server 2016和SQL Server Always On可用性组上安装SQL Server 2019
将新节点添加到现有SQL Server Always On可用性组中
为SQL Server Always On可用性组配置托管服务帐户

翻译自: https://www.sqlshack.com/configure-failover-clusters-storage-controllers-and-quorum-configurations-for-sql-server-always-on-availability-groups/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值