Note:

Deploy Microsoft SQL Server Windows Server Failover Cluster for HA and DR on Oracle Cloud Infrastructure

Introduction

Microsoft SQL Server (MSSQL) enterprise-level database infrastructures rely heavily on high availability (HA) and disaster recovery (DR) capabilities to maintain business continuity and minimize downtime. MSSQL offers several clustering deployment models to help achieve these goals. These models include Always on availability groups and Failover cluster instances.

While each model has its own strengths and use cases, this tutorial will focus specifically on the deployment and configuration of MSSQL failover cluster instance with OCI Block Volumes service using Small Computer Systems Interface (SCSI) Persistent Reservation (PR) feature. For more information about Always On availability groups, see Deploy Microsoft SQL Server Always On Availability Groups for HA and DR on OCI.

Architecture

This tutorial uses the following architecture:

architecture

Objectives

Prerequisites

Task 1: Configure the Failover IP

Windows Server Failover Clustering employs an active/passive clustering model, where a dedicated IP address, known as a failover IP or floating IP, is assigned to the cluster. This failover IP automatically moves from a failed node to an active node, ensuring continuous network connectivity and minimizing downtime. When a node fails, the failover IP is seamlessly transferred to the new active node, allowing clients to maintain access to the cluster resources without interruption.

For more information about configuring the failover IPs on both the Microsoft SQL Server VMs, see Automating Secondary IP address Failover on Windows Server.

Task 2: Create a SQL Server Service Account

SQL Server needs to use a dedicated domain account. In this task, we will create this account. Later in the tutorial, we use this account to configure the SQL Server service on each of the nodes.

  1. Log in to the Domain Controller using the domain administrator account and navigate to Active Directory Users and Computers.

  2. Expand the domain you configured for this tutorial.

  3. Right-click Users and click New User to create a new user.

  4. Enter the required information and click Next.

    SQL Server Service Account

  5. Enter the password for this domain account and click Next.

  6. Review the details and click Finish.

Task 3: Create Quorum and Shared Disks

We utilize a dedicated shared disk for Quorum purposes in WSFC to prevent split-brain conditions that could arise when multiple nodes in a cluster attempt to assume control simultaneously. This dedicated disk ensures that all nodes in the cluster have a unified view of the cluster’s state, thereby preventing conflicts.

In this task, we will create two distinct shared block volumes with SCSI PR enabled. We enable PR on both volumes as a mechanism to reserve shared resources, ensuring that only authorized nodes can access these resources. SCSI PR is a requirement in a clustering environment, as it prevents data corruption by managing access to shared disks.

By creating these two separate shared block volumes with distinct roles and enabling SCSI PR on both, we ensure that our WSFC is properly configured to maintain high availability and redundancy, both for the critical Quorum function and for the data storage needs of the applications running within the cluster.

To create OCI Block Volumes with SCSI PR enabled, follow the steps:

  1. Log in to the OCI Console, navigate to Storage, Block Volumes page and click Create Block Volume.

  2. Adjust Volume size and performance and select Enables persistent reservations for iSCSI volume attachments to enable SCSI PR for the volume.

    Create Block Volume

  3. Attach the volume to SQL Server VMs one by one. Since these volumes have SCSI PR enabled, these volumes can only be attached in shared read-write/read-only mode. For this setup, we will attach the volumes in shared read-write mode. Select Use Oracle Cloud Agent to automatically connect to iSCSI-attached volumes and click Attach.

    Attach Block Volume to instance

  4. Repeat steps 1 to 3 for creating and attaching both Quorum and Data disks.

Task 4: Configure a Windows Server Failover Cluster

In this task, we will:

Task 4.1: Add WSFC Roles to the Windows Server VMs

  1. Log in to SQL Server node 1 VM using the domain administrator account, open Server Manager and under Dashboard, click Add roles and features.

  2. Review the Before You Begin section and click Next.

  3. Select Role-based or feature-based installation and click Next.

  4. In Select destination server, select server from the server pool and verify sqlnode1.example.org is selected and click Next to proceed.

  5. We will not be adding any Server Roles, so click Next to proceed.

  6. In Features, select Failover Clustering. When you do, a window will appear, then click Add Features.

    Add Failover Cluster Management Tools

  7. In Confirm installation selection, review the details and click Install to confirm the installation and when the installation is finished, close the wizard.

  8. Repeat steps 1 to 7 for installing failover clustering tools on the second SQL Server Node.

Task 4.2: Create a Cluster

  1. Log in to the Windows Server node 1 VM using the domain administrator account and open the Failover Cluster Manager. You will find there are no clusters running.

    Create a cluster

  2. Right-click on Failover Cluster Manager and select Create Cluster…, this will open a Create Cluster Wizard.

  3. Once the Create Cluster Wizard opens, click Next to proceed.

  4. Click Browse and select sqlnode1.example.org and sqlnode2.example.org.

  5. Select Yes, When I click Next, run the configuration tests, and then return to the process of creating the cluster and click Next.

  6. Select Run all tests and click Next.

  7. In the Confirmation window, click Next and wait till all tests are finished and click Finish. OCI supports SCSI PR now and you can see the test Validate SCSI-3 Persistent reservation passed.

    Validate tests

  8. Enter Cluster Name and consider the NetBIOS constraints. Click Next.

  9. Confirm the cluster before creating and click Next.

    Cluster create summary

  10. When the cluster is successfully created, click Finish.

  11. Open the Failover Cluster Manager and you will be able to see the newly created cluster.

    Cluster

  12. Notice that the status of the cluster is Offline in the Cluster Core Resources section. Expand the resources and find the cluster IP addresses not yet configured. Right-click the IP address with Failed status and then click Properties.

  13. In the General tab, specify the Static IP Address configured for this node in Task 1 and click Apply.

  14. Right-click the configured IP address and click Bring Online.

  15. With the cluster creation complete, we will now expand the cluster and navigate to the Storage section, where we will select Disks to confirm that both shared block volumes (the designated quorum disk and the data disk) are properly listed and recognized by the cluster.

    Cluster disks

Task 5: Install and Configure SQL Server

In this task, we will cover new SQL Server failover cluster installation.

  1. Run setup.exe from downloaded MSSQL software bundle.

  2. Select Installation.

    SQL server cluster installation

  3. Select New SQL Server failover cluster installation.

  4. Enter Product Key and click Next.

  5. Accept License Terms and click Next.

  6. Under Microsoft Update, click Next. Installer will scan for software updates, download and will start the installation process.

  7. It will Install Failover Cluster Rules. Click Next.

    SQL server failover cluster install rules

  8. Under Feature Selection, select Database Engine Services and click Next.

    SQL server failover cluster feature selection

  9. In Instance Configuration, enter a name for SQL Server Network Name, select Default Instance or Named Instance and click Next.

  10. In Cluster Resource Group, click Next.

  11. In Cluster Disk Selection, select Cluster Disk 2 and click Next.

  12. In Cluster Network Configuration, assign IPv4 address and click Next.

    SQL server failover cluster network configuration

  13. In Server Configuration, enter SQL server Service Account Name and Password created in Task 2 and click Next.

    SQL server configuration

  14. In Database Engine Configuration, configure Authentication mode and other settings and click Next.

  15. In Ready to Install, click Install.

  16. You will see the installation progress. Click Close.

    SQL server install completion

  17. Go to Failover Cluster Manager, expand the cluster and navigate to the Storage section and verify disks. You will see the second disk is assigned to SQL Server as shown in the following image.

    Windows server failover cluster SQL server cluster disks

  18. Go to Failover Cluster Manager, expand the cluster, navigate to the Roles section. You can see the SQL Server cluster.

    SQL server cluster

  19. In SQL Server Management Studio, we can now connect to the database. Your deployment is now ready and is set up to be highly available and fault tolerant.

    SQL server management studio

Next Steps

In this tutorial, we have walked you through the process of setting up a WSFC cluster with MSSQL using SCSI PR feature of OCI Block Volumes service. By following this tutorial, you should now have a fully functional WSFC cluster with MSSQL using SCSI PR. Remember to test and validate your cluster regularly to ensure high availability and minimize downtime.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.