Lab: Implementing failover clustering
Scenario
As the business of Contoso, Ltd. grows, it’s becoming increasingly important that many of the applications and services on its network are always available. Contoso has many services and applications that must be available to internal and external users who work in different time zones around the world. Many of these applications can’t be made highly available by using Network Load Balancing (NLB). Therefore, you should use a different technology to make these applications highly available.
As one of the senior network administrators at Contoso, you’re responsible for implementing failover clustering on the servers that are running Windows Server 2019 to provide high availability for network services and applications. You’re also responsible for planning the failover cluster configuration and deploying applications and services on the failover cluster.
Objectives
After completing this lab, you’ll be able to:
- Configure a failover cluster.
- Deploy and configure a highly available file server on the failover cluster.
- Validate the deployment of the highly available file server.
Estimated time: 60 minutes
Lab setup
Virtual machines: SEA-DC1, SEA-ADM1, SEA-SVR2, and SEA-SVR3
User name: Contoso\Administrator
Password: Pa55w.rd
Sign in only to SEA-ADM1. Sign in to other virtual machines only when instructed in lab steps.
Exercise 1: Configuring iSCSI storage
Task 1: Install Failover Clustering
-
On SEA-ADM1, select Start, right-click or access the context menu for Windows PowerShell, and then select Run as Administrator.
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
Install-WindowsFeature –Name Failover-Clustering –IncludeManagementTools
-
Wait until the installation process is complete and a command prompt appears.
-
On SEA-ADM1, repeat step 1 to open a new PowerShell session that you’ll use to connect to the SEA-SVR2 server.
-
In the new Administrator:Windows PowerShell window, enter the following command, and then select Enter:
$cred=Get-Credential
-
When prompted, sign in as Contoso\Administrator with password Pa55w.rd.
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
$sess = New-PSSession -Credential $cred -ComputerName sea-svr2.contoso.com
-
After running the previous command, enter the following command, and then select Enter:
Enter-PSSession $sess
-
Verify that
sea-svr2.contoso.com
appears at the beginning of the command prompt. -
In the Administrator: Windows PowerShell window for SEA-SVR2, enter the following command, and then select Enter:
Install-WindowsFeature –Name Failover-Clustering –IncludeManagementTools
-
On SEA-ADM1, repeat step 1 to open a new PowerShell session that you’ll use to connect to the SEA-SVR3 server.
-
To install the Failover Clustering feature on SEA-SVR3, in the new Administrator: Windows PowerShell window, enter the following command, and then select Enter.
$cred=Get-Credential
-
When prompted, sign in as Contoso\Administrator with password Pa55w.rd.
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
$sess = New-PSSession -Credential $cred -ComputerName sea-svr3.contoso.com
-
After running the previous command, enter the following command, and then select Enter:
Enter-PSSession $sess
-
Verify that
sea-svr3.contoso.com
appears at the beginning of the command prompt. -
In the Administrator: Windows PowerShell window for SEA-SVR3, enter the following command, and then select Enter:
Install-WindowsFeature –Name Failover-Clustering –IncludeManagementTools
-
On SEA-ADM1, in the Administrator: Windows PowerShell window for the local server, enter the following command, and then select Enter:
Add-WindowsFeature FS-iSCSITarget-Server
-
Wait until the installation finishes and the command prompt returns.
-
In the PowerShell window for SEA-SVR2, enter the following command, and then select Enter:
Restart-Computer
-
In the PowerShell window for SEA-SVR3, enter the following command, and then select Enter:
Restart-Computer
-
In the PowerShell window for SEA-ADM1, enter the following command, and then select Enter:
Restart-Computer
-
Wait for 3–4 minutes for all three servers to restart.
Task 2: Configure iSCSI virtual disks
-
Sign in to SEA-ADM1 as Contoso\Administrator with password Pa55w.rd.
-
Select Start, right-click or access the context menu for Windows PowerShell, and then select Run as Administrator.
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
New-IscsiVirtualDisk c:\Storage\disk1.VHDX –size 10GB
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
New-IscsiVirtualDisk c:\Storage\disk2.VHDX –size 10GB
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
New-IscsiVirtualDisk c:\Storage\disk3.VHDX –size 10GB
-
To open another Windows PowerShell window to connect to SEA-SVR2, on SEA-ADM1, select Start, right-click or access the context menu for Windows PowerShell, and then select Run as Administrator.
-
In the new Administrator: Windows PowerShell window, enter the following command, and then select Enter:
$cred=Get-Credential
-
When prompted, sign in as Contoso\Administrator with password Pa55w.rd.
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
$sess = New-PSSession -Credential $cred -ComputerName sea-svr2.contoso.com
-
After running the previous command, enter the following command, and then select Enter:
Enter-PSSession $sess
-
Verify that
sea-svr2.contoso.com
appears at the beginning of the command prompt. -
To open another Windows PowerShell window to connect to SEA-SVR3, on SEA-ADM1, select Start, right-click or access the context menu for Windows PowerShell, and then select Run as Administrator.
-
In the new Administrator: Windows PowerShell window, enter the following command, and then select Enter:
$cred=Get-Credential
-
When prompted, sign in as Contoso\Administrator with password Pa55w.rd.
-
In the Administrator: Windows PowerShell window, enter the following command, and then select Enter:
$sess = New-PSSession -Credential $cred -ComputerName sea-svr3.contoso.com
-
After running the previous command, enter the following command, and then select Enter:
Enter-PSSession $sess
-
Verify that
sea-svr3.contoso.com
appears at the beginning of the command prompt.Note: You should have three Windows PowerShell windows opened. Ensure that you always use the proper PowerShell session window that’s connected to the server where you want to run a command.
-
In the Administrator: Windows PowerShell window for SEA-SVR2, start the Microsoft iSCSI Initiator service by entering the following commands, each followed by selecting Enter:
Start-Service msiscsi Set-Service msiscsi -startuptype "automatic"
-
In the Administrator: Windows PowerShell window for SEA-SVR3, start the Microsoft iSCSI Initiator service by entering the following commands, each followed by selecting Enter:
Start-Service msiscsi Set-Service msiscsi -startuptype "automatic"
-
On SEA-ADM1, in the Administrator: Windows PowerShell window for the local machine, enter:
New-IscsiServerTarget iSCSI-MOD6 –InitiatorIds “IQN:iqn.1991-05.com.microsoft:sea-svr2.contoso.com","IQN:iqn.1991-05.com.microsoft:sea-svr3.contoso.com"
Results
After completing this exercise, you should have successfully installed the Failover Clustering feature and configured the Internet SCSI (iSCSI) Target Server.
Exercise 2: Configuring a failover cluster
Task 1: Connect clients to the iSCSI targets
-
In the PowerShell window for SEA-ADM1, enter each of the following commands, each followed by selecting Enter:
Add-IscsiVirtualDiskTargetMapping iSCSI-MOD6 c:\Storage\Disk1.VHDX Add-IscsiVirtualDiskTargetMapping iSCSI-MOD6 c:\Storage\Disk2.VHDX Add-IscsiVirtualDiskTargetMapping iSCSI-MOD6 c:\Storage\Disk3.VHDX
-
In the Administrator: Windows PowerShell window for SEA-SVR2, enter the following commands, and after each, select Enter:
New-iSCSITargetPortal –TargetPortalAddress SEA-ADM1.contoso.com Connect-iSCSITarget –NodeAddress iqn.1991-05.com.microsoft:sea-adm1-iscsi-mod6-target Get-iSCSITarget | fl
- Verify that after running the last command, the value for the IsConnected variable is True.
-
In the Administrator: Windows PowerShell window for SEA-SVR3, enter the following commands, and then select Enter after each:
New-iSCSITargetPortal –TargetPortalAddress SEA-ADM1.contoso.com Connect-iSCSITarget –NodeAddress iqn.1991-05.com.microsoft:sea-adm1-iscsi-mod6-target Get-iSCSITarget | fl
- Verify that after you run the last command, the value for the IsConnected variable is True.
Task 2: Initialize the disks
-
In the Administrator: Windows PowerShell window for SEA-SVR2, enter the following command, and then select Enter:
Get-Disk
- After running this command, ensure that three disks are in the Offline operational status. These should be disks with numbers 4, 5, and 6.
-
In the Administrator: Windows PowerShell window for SEA-SVR2, enter the following commands, selecting Enter after each:
Get-Disk | Where OperationalStatus -eq 'Offline' | Initialize-Disk -PartitionStyle MBR New-Partition -DiskNumber 4 -Size 5gb -AssignDriveLetter New-Partition -DiskNumber 5 -Size 5gb -AssignDriveLetter New-Partition -DiskNumber 6 -Size 5gb -AssignDriveLetter Format-Volume -DriveLetter E -FileSystem NTFS Format-Volume -DriveLetter F -FileSystem NTFS Format-Volume -DriveLetter G -FileSystem NTFS
Task 3: Validate and create a failover cluster
-
Switch to SEA-SVR2, and then sign in as Contoso\Administrator with password Pa55w.rd.
Note: You must sign in on SEA-SVR2 because you can’t run cluster commands over remote PowerShell.
-
Enter PowerShell, and then select Enter.
-
At the command prompt on SEA-SVR2, enter Test-Cluster SEA-SVR2, SEA-SVR3, and then select Enter.
-
Wait for a few minutes for the cluster validation test to complete. You can expect a few warning messages to appear, but there should be no errors.
-
At the command prompt on SEA-SVR2, enter the following command, and then select Enter:
New-Cluster -Name WFC2019 -Node sea-svr2 -StaticAddress 172.16.10.125
-
You should receive a cluster name as a result. It should display Name WFC2019. Verify that there are no errors.
-
At the command prompt on SEA-SVR2, enter the following command, and then select Enter:
Add-ClusterNode -Name SEA-SVR3
-
When a command prompt appears, verify that no errors are reported.
Results
After completing this exercise, you should have installed and configured the Failover Clustering feature.
Exercise 3: Deploying and configuring a highly available file server
Task 1: Add the file server application to the failover cluster
- On SEA-ADM1, open Server Manager, and then select Failover Cluster Manager in the Tools menu.
- In the Failover Cluster Manager console, select Connect to Cluster.
- To connect to the cluster that you created in the previous exercise, in the Select Cluster window, enter WFC2019, and then select OK.
- Expand
WFC2019.contoso.com
, select Roles, and then notice that no roles display. This is because no cluster roles are configured yet. - Select Nodes, and then notice that the SEA-SVR2 and SEA-SVR3 nodes both display a status of Up.
- Expand Storage, and then select Disks. Notice that three cluster disks have a status of Online.
- On the Failover Cluster Manager page, right-click or access the context menu for Roles, and then select Configure role.
- On the Before You Begin page, select Next.
- On the Select Role page, select File Server, and then select Next.
- On the File Server Type page, select File Server for general use, and then select Next.
- On the Client Access Point page, in the Name box, enter FSCluster.
- In the Address box, enter 172.16.10.130, and then select Next.
- On the Select Storage page, select Cluster Disk 1 and Cluster Disk 2, and then select Next.
- On the Confirmation page, select Next.
- On the Summary page, select Finish.
- In the Storage node, select Disks.
- Verify that three cluster disks are online. Cluster Disk 1 and Cluster Disk 2 should be assigned to FSCluster.
Task 2: Add a shared folder to a highly available file server
- On SEA-ADM1, in Failover Cluster Manager, select Roles, select FSCluster, and then in the right pane, select Add File Share.
- On the Select Profile page, select SMB Share - Quick, and then select Next.
- On the Share Location page, select Next.
- On the Share Name page, enter Docs for the share name, and then select Next.
- On the Other Settings page, select Next.
- On the Permissions page, select Next.
- On the Confirmation page, select Create.
- On the View results page, select Close.
Task 3: Configure the failover and failback settings
- On SEA-ADM1, in the Failover Cluster Manager console, select Roles, select FSCluster, and then select Properties.
- Select the Failover tab, and then select Allow failback.
- Select Failback between, and then enter:
- 4 in the first text box
- 5 in the second text box.
- Select the General tab.
- Under Preferred owners, select both SEA-SVR2 and SEA-SVR3.
- Select the SEA-SVR3 object, select Up, and then select OK.
Results
After completing this exercise, you should have configured a highly available file server.
Exercise 4: Validating the deployment of the highly available file server
Task 1: Validate the highly available file server deployment
- On SEA-ADM1, open File Explorer, and then try to access the \\FSCluster location.
- Verify that you can access the Docs folder.
- Inside the Docs folder, right-click or access the context menu in an empty area of the folder, select New, and then select Text Document.
- To accept the default name of the document as New Text Document.txt, select Enter.
- In the Failover Cluster Manager console, right-click or access the context menu for FSCluster, select Move, select Select node, choose the available node from the Cluster nodes list, and then select OK.
- On SEA-ADM1, in File Explorer, verify that you can still access the \\FSCluster location.
Task 2: Validate the failover and quorum configuration for the File Server role
- On SEA-ADM1, in Failover Cluster Manager, determine the current owner for the FSCluster role. If you select Roles and observe the value in the Owner Node column, it will be SEA-SVR2 or SEA-SVR3.
- Select Nodes, and then right-click or access the context menu for the node that’s the current owner of the FSCluster role.
- Select More Actions, and then select Stop Cluster Service.
- Try to access \\FSCluster from SEA-ADM1 to verify that FSCluster has moved to another node and that the \\FSCluster location is still available.
- Select Nodes, and then right-click or access the context menu for the node that has the status of Down.
- Select More Actions, and then select Start Cluster Service.
- In the Failover Cluster Manager console, right-click or access the context menu for the
WFC2019.Contoso.com
cluster, select More Actions, and then select Configure Cluster Quorum Settings. - On the Before you begin page, select Next.
- On the Select Quorum Configuration Options page, select Use default quorum configuration, and then select Next.
- Select Next, and then select Finish.
- Browse to the Disks node, select the disk marked witness disk in Quorum, and then select Take Offline.
- When prompted, select Yes.
- Verify that FSCluster is still available by trying to access it from SEA-ADM1.
- Select the disk marked witness disk in Quorum, and then select Bring Online.
- Close all open windows.
Results
After completing this exercise, you should have validated high availability with Failover Clustering.