Set up a Microsoft SQL Server failover cluster on Amazon EC2 using FSx for Windows File Server
Sweta Krishna and Ramesh Babu Donti, Amazon Web Services
Summary
Microsoft SQL Server Standard edition with a failover cluster instance (FCI) can provide a more cost-effective alternative to SQL Server Enterprise. Setting up SQL FCI requires shared file storage between nodes, and Amazon FSx for Windows File Server
Pay only for what you use with no upfront fees or commitments.
Set up FCI manually with FSx as your shared storage.
Use FSx as the file share witness for your SQL cluster.
Amazon FSx for Windows File Server supports Server Message Block (SMB) 3.0 for continuously available file shares, making it suitable for SQL Server FCI deployments.
Prerequisites and limitations
Prerequisites
Active AWS account
. Permissions to create and manage Amazon Virtual Private Cloud (Amazon VPC) resources, Amazon Elastic Compute Cloud (Amazon EC2) instance, security groups, and AWS Identity and Access Management (IAM) roles.
AWS Managed Microsoft AD or your own on-premises Active Directory.
An Active Directory domain user with necessary permission
to set up a failover cluster. Security group rules for SQL Server FCI and Microsoft Active Directory ports for secure hybrid connectivity.
A service account
in Active Directory for SQL Server that’s configured with appropriate permissions across SQL nodes. Amazon FSx for Windows File Server in a failover cluster.
SQL Server installation binaries.
Limitations
Some AWS services aren’t available in all AWS Regions. For Region availability, see AWS services by Region
. For specific endpoints, see the Service endpoints and quotas page, and choose the link for the service.
Product versions
Amazon EC2 for Windows Server 2012 R2 or later
Amazon FSx for Windows File Server with all current Windows Server versions
Amazon FSx for NetApp ONTAP as an alternative for shared storage
SQL Server 2012/2016/2019/2022
Architecture
Technology stack
Amazon EC2
Amazon FSx for Windows File Server
Amazon VPC
AWS Directory Service
AWS Systems Manager
IAM
Target architecture
The following diagram shows the high-level architecture of Microsoft SQL Server FCI on Amazon EC2 using Amazon FSx for Windows File Server.

Network infrastructure
Amazon VPC provides a network container that spans three Availability Zones.
Private subnets provide isolated subnets in each Availability Zones for deploying resources.
Compute layer
Amazon EC2 contains an SQL Server cluster node 1, deployed in Availability Zone 1 as part of the Windows Server Failover Cluster (WSFC).
Amazon EC2 contains an SQL Server cluster node 2, deployed in Availability Zone 2 as part of the WSFC.
The WSFC cluster connects both SQL Server nodes for failover capability.
Storage layer for Amazon FSx for Windows File Server
Multi-AZ FSx deployment (spanning Availability Zones 1 and 2)
A primary FSx file system in Availability Zone 1 hosts active SQL Server data and log files.
A secondary FSx file system in Availability Zone 2 provides automatic failover capability.
A shared SMB file share (\\fsx.domain\sqlshare), accessible by both cluster nodes for SQL Server databases.
Single-AZ FSx deployment (in AZ3)
Amazon FSx file server witness in Availability Zone 3 serves as the cluster quorum witness.
The file share witness (
\\fsx.domain\witness
) maintains the cluster quorum and prevents split-brain scenarios.
Directory services
AWS Managed Microsoft AD provides Windows authentication and domain services that are required for cluster functionality.
High availability features
Multi-AZ components provide fault tolerance across Availability Zones.
FSx standby file server provides automatic failover if the primary server fails.
File share witness provides cluster quorum management in Availability Zone 3 to help ensure proper cluster operation during failures.
Domain is integrated with AWS Managed Microsoft AD for seamless Windows authentication.
Tools
AWS services
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the AWS Cloud. You can launch as many virtual servers as you need and quickly scale them up or down.
Amazon FSx provides file systems that support industry-standard connectivity protocols and offer high availability and replication across AWS Regions.
Amazon Virtual Private Cloud (Amazon VPC) helps you launch AWS resources into a virtual network that you’ve defined. This virtual network resembles a traditional network that you’d operate in your own data center, with the benefits of using the scalable infrastructure of AWS.
AWS Directory Service for Microsoft Active Directory enables your directory-aware workloads and AWS resources to use Microsoft Active Directory in the AWS Cloud.
AWS Identity and Access Management (IAM) helps you securely manage access to your AWS resources by controlling who is authenticated and authorized to use them.
AWS Systems Manager helps you manage your applications and infrastructure running in the AWS Cloud. It simplifies application and resource management, shortens the time to detect and resolve operational problems, and helps you manage your AWS resources securely at scale.
Best practices
Place database instances in private subnets to protect them from being publicly accessible from the internet while still allowing them to connect to AWS services and perform updates.
For general best practices, see Best Practices for Deploying Microsoft SQL Server on Amazon EC2.
To use PowerShell to administer your Amazon FSx for Windows File Server, see Administering FSx for Windows file systems.
Epics
Task | Description | Skills required |
---|---|---|
Add names and tags. |
| DBA |
Choose a Windows AMI. | Choose an Amazon Machine Image (AMI) for Windows that meets your SQL Server requirements. | DBA |
Select an instance type. | Select an Amazon EC2 instance type that meets your requirements. | DBA |
Use a key pair. | You can use a key pair to securely connect to your instance. Ensure that you have access to the selected key pair before you launch the instance. | DBA |
Configure network settings. |
| DBA |
Configure advanced network settings. |
| DBA |
Configure storage. | Configure the required total storage and choose the required storage type. | DBA |
Configure advanced details and launch the instance. |
| DBA |
Create node 2. | Repeat these steps to create and configure node 2. | DBA |
Task | Description | Skills required |
---|---|---|
Log in to node 1. | Log in to the Windows Amazon EC2 instance as an administrator. | DBA |
Install FCI features on node 1. |
| DBA |
Log in to node 2. | Log in to the Windows Amazon EC2 instance as an administrator. | DBA |
Install FCI features on node 2. |
| DBA |
Add nodes to the cluster. |
| DBA |
Bring the cluster online. | To bring the cluster online, update the static IP addresses of both nodes:
| DBA |
Validate the cluster. | Navigate to Failover cluster manager and verify that the cluster core resources are online. | DBA |
Task | Description | Skills required |
---|---|---|
Log in to the server. | Log in to the Amazon EC2 instance as an administrator. | DBA |
Mount the SQL binaries. |
| |
Add node 2 to the failover cluster. |
| DBA |
Task | Description | Skills required |
---|---|---|
Configure quorum settings. |
| DBA |
Retrieve DNS details. | In the Amazon FSx console, choose Managed AD and then Attach. The DNS should have the following format: | DBA |
Configure the file share witness. | Choose Amazon FSx file share path and then Finish. | DBA |
Related resources
AWS resources
How to deploy a SQL Server failover cluster with Amazon EBS Multi-Attach on Windows Server
(AWS blog post) Simplify your Microsoft SQL Server high availability deployments using Amazon FSx for Windows File Server
(AWS blog post) SQL Server high availability deployments using Amazon FSx for NetApp ONTAP
(AWS blog post)
Other resources
Additional information
Configuring the file share witness
Ensure that you’re connected to the file system from both nodes by adding rules in the Amazon FSx security group that allow inbound connections. The SMB port should be allowed. For example, if the DNS name is \\example.example.com\share
, use \\example.example.com\share
. Use the same value for the file share witness in the Always On availability cluster. Complete the following steps to configure the file share witness:
Use RDP to connect to your Amazon EC2 instance.
Navigate to Failover cluster manager.
Open the context (right-click) menu and choose More actions.
Choose Configure cluster quorum settings.
Choose Next.
Select Quorum configuration and configure a file share witness.
Provide the DNS name.
Review the summary and then choose Finish. The file share witness should be online in the Cluster core resources section.