Tag Archives: High Availability

Windows Server 2022 Failover Cluster

Windows Server 2022 Failover Cluster using PowerShell
for SQL Server Always On Availability Groups

Table of Contents



0. Environment

NodeHostnameIP Address
DB Node 1NTICBPSQLSGV01192.168.2.21
DB Node 2NTICBPSQLSGV02192.168.2.22
DB Node 3NTICBPSQLSGV03192.168.2.23
DB Node 4NTICBPSQLSGV04192.168.2.24
Cluster NameNTICBPSQLSGC05192.168.2.25
DCDC01192.168.2.20

1. Prerequisites

  • All four servers must run Windows Server 2022.
  • All servers must be joined to the same Active Directory domain.
  • Ensure proper DNS name resolution between all nodes.
  • Verify network connectivity and configure static IP addresses.
  • Install the latest Windows updates and vendor drivers.

2. Install Failover Clustering Feature

Run the following command on each node as Administrator.

On NTICBPSQLSGV01

PS C:\Users\Administrator> Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools                     
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Failover Clustering, Remote Server Admini...


PS C:\Users\Administrator> hostname
NTICBPSQLSGV01
PS C:\Users\Administrator>
PS C:\Users\Administrator> Get-WindowsFeature -Name Failover-Clustering

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] Failover Clustering                                 Failover-Clustering            Installed

PS C:\Users\Administrator>

On NTICBPSQLSGV02

PS C:\Users\Administrator> Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools                     
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Failover Clustering, Remote Server Admini...


PS C:\Users\Administrator> hostname
NTICBPSQLSGV02
PS C:\Users\Administrator> Get-WindowsFeature -Name Failover-Clustering

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] Failover Clustering                                 Failover-Clustering            Installed


PS C:\Users\Administrator>

On NTICBPSQLSGV03

PS C:\Users\Administrator> Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools                     
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Failover Clustering, Remote Server Admini...


PS C:\Users\Administrator> hostname
NTICBPSQLSGV03
PS C:\Users\Administrator> Get-WindowsFeature -Name Failover-Clustering

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] Failover Clustering                                 Failover-Clustering            Installed

PS C:\Users\Administrator>

On NTICBPSQLSGV04

PS C:\Users\Administrator> Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools                     
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Failover Clustering, Remote Server Admini...


PS C:\Users\Administrator> hostname
NTICBPSQLSGV04
PS C:\Users\Administrator> Get-WindowsFeature -Name Failover-Clustering

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] Failover Clustering                                 Failover-Clustering            Installed


PS C:\Users\Administrator>
✔ Failover Clustering feature installed successfully on all nodes.

 

3. Import Cluster Module and Validate Cluster Configuration

On NTICBPSQLSGV01

Load the Windows Failover Clustering PowerShell module into your current PowerShell session.
Run validation before creating the cluster:

On NTICBPSQLSGV01:

PS C:\Users\Administrator> hostname
NTICBPSQLSGV01
PS C:\Users\Administrator> Import-Module FailoverClusters
PS C:\Users\Administrator>

PS C:\Users\Administrator> Test-Cluster -Node NTICBPSQLSGV01,NTICBPSQLSGV02,NTICBPSQLSGV03,NTICBPSQLSGV04
WARNING: System Configuration - Validate Software Update Levels: The test reported some warnings..
WARNING: Network - Validate Network Communication: The test reported some warnings..
WARNING:
Test Result:
HadUnselectedTests, ClusterConditionallyApproved
Testing has completed for the tests you selected. You should review the warnings in the Report.  A cluster solution is
supported by Microsoft only if you run all cluster validation tests, and all tests succeed (with or without warnings).
Test report file path: C:\Users\Administrator\AppData\Local\Temp\2\Validation Report 2025.12.29 At 18.28.44.htm

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        12/29/2025   6:34 PM        1346352 Validation Report 2025.12.29 At 18.28.44.htm


PS C:\Users\Administrator>

Note: Warnings are acceptable, but errors must be resolved.
Always review the cluster validation report.

 

4. Create the Cluster

New-Cluster `
 -Name NTICBPSQLSGC05 `
 -Node NTICBPSQLSGV01,NTICBPSQLSGV02,NTICBPSQLSGV03,NTICBPSQLSGV04 `
 -StaticAddress 192.168.2.25 `
 -NoStorage

PS C:\Users\Administrator> New-Cluster `
>>  -Name NTICBPSQLSGC05 `
>>  -Node NTICBPSQLSGV01,NTICBPSQLSGV02,NTICBPSQLSGV03,NTICBPSQLSGV04 `
>>  -StaticAddress 192.168.2.25 `
>>  -NoStorage

Name
----
NTICBPSQLSGC05


PS C:\Users\Administrator>
✔ Cluster NTICBPSQLSGC05 created successfully.

 

5. Verify Cluster Configuration

Cluster Name

PS C:\Users\Administrator> Get-Cluster

Name
----
NTICBPSQLSGC05


PS C:\Users\Administrator>

Cluster Nodes

PS C:\Users\Administrator> Get-ClusterNode

Name           State Type
----           ----- ----
NTICBPSQLSGV01 Up    Node
NTICBPSQLSGV02 Up    Node
NTICBPSQLSGV03 Up    Node
NTICBPSQLSGV04 Up    Node


PS C:\Users\Administrator>

Cluster Resources

PS C:\Users\Administrator> Get-ClusterResource

Name               State  OwnerGroup    ResourceType
----               -----  ----------    ------------
Cluster IP Address Online Cluster Group IP Address
Cluster Name       Online Cluster Group Network Name


PS C:\Users\Administrator>

Cluster Network

PS C:\Users\Administrator> Get-ClusterNetwork | Format-Table Name, Address, Role, State

Name              Address                 Role State
----              -------                 ---- -----
Cluster Network 1 192.168.2.0 ClusterAndClient    Up


PS C:\Users\Administrator>
✔ All cluster components are online and healthy.

6. Add Witness

In this test lab environment, the File Share Witness (FSW) is hosted on the Domain Controller (DC).

Using a Domain Controller as File Share Witness is NOT recommended for production.

  • In production, the File Share Witness should be hosted on:
    • A dedicated file server
    • Azure Cloud Witness (recommended)
  • The witness folder must have Full Control for:
    • The Windows Failover Cluster computer object
    • SQL Server Always On cluster name object
       

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

Training

br8dba.com — Senior Database Professional

DBA Training & Mentoring Oracle · PostgreSQL · SQL Server

Practical, hands-on training designed for real-world production environments. Learn from a Senior DBA with years of industry experience.

🎓 Technical Trainer 🌐 Founder of BrightDBA ⚡ Real-World DBA Skills 🆓 Free PostgreSQL Training in Telugu

I am a Senior Database Professional, Trainer, and Consultant with extensive hands-on experience in Oracle, SQL Server, and PostgreSQL. I strongly believe that real-world DBA skills come from practical exposure — not just theory. My goal: to make complex database concepts easy, practical, and directly usable in real jobs.

🔥 Registration got closed

Free PostgreSQL DBA Training in Telugu

తెలుగులో నేర్చుకోండి · 4 Weeks · Online · Beginner Friendly · 100% Free

✏️ Registration got Closed →
📚

What I Teach

Oracle DBA — Single Instance, RAC, Exadata & Performance Tuning
PostgreSQL Administration — Installation to Advanced Tuning
SQL Server Administration & Always On Availability Groups
High Availability & Disaster Recovery (HA/DR) Design
DBA Mentoring, Documentation & Hands-on Labs
Linux, Storage & Networking fundamentals for DBAs
🌐

BrightDBA — Practical Learning for Real DBAs

A learning platform created to help DBAs and IT professionals gain practical, step-by-step, industry-ready skills through clear documentation and real-world scenarios.

📝 Detailed Articles

DBA articles & technical guides

🎯 Step-by-Step Training

Hands-on production-ready content

🤝 Community Support

WhatsApp group & peer learning

🚀 Real Challenges

Prepare for production problems

🧠

My Training Approach

💡 Hands-on first, theory next
🔧 Real problems with practical solutions
📄 Clean documentation with repeatable steps
⚡ Focus on performance, stability & reliability
🗄️

Technologies I Work With

🔴 Oracle

11g, 12c, 19c, RAC, Exadata

🐘 PostgreSQL

Installation, Configuration, WAL, Replication, Performance Tuning

🪟 SQL Server

Always On AG, HA/DR, Performance Tuning

⚙️ Infrastructure

Linux, Storage, Networking, Cloud & Hybrid DBA

🤝 Let's Connect

You're in the right place if you are:

📚 Looking to learn DBA skills practically 🎯 Beginner wanting to start from zero 📖 Searching for clear DBA documentation 🚀 Aiming to grow as a database professional
🎖️

Oracle Certifications

Oracle 10g OCA
Oracle 10g OCP
Oracle 11g OCP
Oracle 12c
RAC 10g
RAC 11g
12c RAC
GoldenGate 10g
GoldenGate 12c
Exadata 11g