群集節點sql失敗,為SQL Server Always On可用性組配置故障轉移群集,存儲控制器和仲裁配置

 2023-10-17 阅读 16 评论 0

摘要: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故障轉移群集,存儲控制器和仲裁配置的配置

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/

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/143794.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息