Learn more about SQL Server tools

mssqltips logo
giveaway
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 

Step-by-step Installation of SQL Server 2016 on a Windows Server 2016 Failover Cluster - Part 4


By:   |   Read Comments   |   Related Tips: More > Clustering

Attend a SQL Server Conference for FREE >> click to learn more


Problem

In a previous tip on Validating a Windows Cluster Prior to Installing SQL Server 2014, I have seen how to install SQL Server 2014 on a Windows Server 2012 R2 failover cluster (WSFC). With Windows Server 2016 already publicly available, I would like to upgrade and migrate my SQL Server 2008 failover clusters to SQL Server 2016 running on Windows Server 2016. How do I go about building a Windows Server 2016 failover cluster for SQL Server 2016 and eventually upgrade and migrate my databases?

Solution

To continue this series on Step-by-step Installation of SQL Server 2016 on a Windows Server 2016 Failover Cluster, we will look at adding a node to an existing SQL Server 2016 failover clustered instance (FCI).

  • Part 1 completed the installation of the Failover Clustering feature on both of the servers that will be used as part of the WSFC and ran the Failover Cluster Validation Wizard.
  • Part 2 created the WSFC using the Create Cluster Wizard.
  • Part 3 completed the installation of a single-node SQL Server 2016 FCI.

SQL Server 2016 Failover Cluster Instance Installation - Install Secondary (Failover) Cluster Node

Now that you have a working SQL Server 2016 FCI, you make it highly available by adding nodes. To add a node to an existing SQL Server 2016 FCI,

  1. Run setup.exe from the SQL Server 2016 installation media to launch SQL Server Installation Center. Click on the Installation link on the left-hand side.
  2. Click the Add node to a SQL Server failover cluster link. This will run the SQL Server 2016 Setup wizard.

  3. installation center

  4. In the Product Key dialog box, enter the product key that came with your installation media and click Next.

  5. product key

  6. In the License Terms dialog box, click the I accept the license terms check box and click Next.

  7. license terms

  8. In the Global Rules dialog box, validate that the checks return successful results and click Next.

  9. global rules

  10. In the Microsoft Update dialog box, click Next.

  11. microsoft update

  12. In the Add Node Rules dialog box, validate that the checks return successful results. If the checks returned a few warnings, make sure you fix them before proceeding with the installation. Click Next.

  13. add node rules

  14. In the Cluster Node Configuration dialog box, validate that the information for the existing SQL Server 2016 FCI is correct. Click Next.

  15. cluster node configuration

  16. In the Cluster Network Configuration dialog box, validate that the IP address information is the same as the one you provided in the previous tip.

  17. cluster network configuartion

  18. In the Service Accounts dialog box, verify that the information is the same as what was used to configure the first node. Provide the appropriate credentials for the corresponding SQL Server service accounts.

  19. service accounts

    NOTE: Pay close attention to the order of the SQL Server services especially when you use different service accounts. In the previous tip, you see the SQL Server Agent service come before the SQL Server Database Engine service. Here, it's the reverse - the SQL Server Database Engine service comes before the SQL Server Agent service. Be sure not to mix those two up.

    Select the checkbox Grant Perform Volume Maintenance Task privilege to SQL Server Database Engine Service to enable Instant File Initialization for SQL Server as highlighted in this tip. Because this is a local permission assigned to an account, you need to explicitly do this on all of the nodes in the SQL Server FCI.

    Click Next.

  20. In the Feature Rules dialog box, verify that all checks are successful. Click Next.

  21. feature rules

  22. In the Ready to Add Node dialog box, verify that all configuration settings are correct. Click Install to proceed with the installation.

  23. ready to add node

  24. In the Complete dialog box, click Close. This concludes adding a node to an existing SQL Server 2016 FCI.

  25. complete

To add more nodes to the SQL Server 2016 FCI, simply repeat steps #1 to #13.

At the completion of a successful installation and configuration of the node, you need to validate whether the SQL Server 2016 FCI will failover - either automaticaly or manually - to all of the available nodes.

Testing SQL Server 2016 FCI Manual Failover with Application Connectivity

A simple way to test whether or not the SQL Server 2016 FCI works is to perform a manual failover. This process involves moving the SQL Server cluster resource group/role from one node to another.

For this test, a simple query using SQL Server Management Studio as the client application can be used. It is recommended to perform this test with application connectivity to observe how the application behaves during the failover process. Refer to the query below and connect to the SQL Server 2016 FCI.

SELECT @@SERVERNAME AS InstanceName, 
SERVERPROPERTY ('ComputerNamePhysicalNetBIOS') AS NodeName
SELECT * FROM sys.dm_os_cluster_nodes

server name

To test the failover process using the Failover Cluster Manager console,

  1. Expand Roles and select SQL Server (MSSQLSERVER).

  2. roles

  3. Right-click the SQL Server (MSSQLSERVER) role, select Move and click Select Node.

  4. failover cluster manager

  5. In the Move Clustered Role dialog box, select the node where you want the SQL Server FCI to move into. Click OK.

  6. move clustered role

  7. After the failover process completes, re-run the query above to verify that the SQL Server FCI is now running on the other node.

  8. instance name

Another way of performing a manual failover test is by using the Move-ClusterGroup PowerShell cmdlet as described in this previous tip.

Move-ClusterGroup "SQL Server (MSSQLSERVER)" -Node "WSFC2016-NODE2"

Testing SQL Server 2016 FCI Automatic Failover

The ultimate test of validating whether or not a SQL Server FCI works is to invoke automatic failover by simulating real failure. While this is easier said than done when you only access your servers remotely, it is still recommended to perform these tests. The following can be performed to simulate failure of a WSFC node and initiate automatic failover of the SQL Server FCI. Note that these steps need to be performed using remote control management tools like HPE's iLO or an IP-based KVM (keyboard, video and mouse) - not Microsoft Remote Desktop - if you are accessing the servers remotely. You can also ask the data center engineers to unplug cables to simulate real failure.

  • Reboot nodes
  • Disable network adapters
  • Kill Microsoft Failover Cluster Service - clussvc.exe
  • Kill SQL Server service - sqlservr.exe

Congratulations! You now have a working two-node SQL Server 2016 FCI running on Windows Server 2016.

Next Steps


Last Update:


signup button

next tip button



About the author
MSSQLTips author Edwin Sarmiento Edwin M Sarmiento is a Microsoft SQL Server MVP and Microsoft Certified Master from Ottawa, Canada specializing in high availability, disaster recovery and system infrastructures.

View all my tips
Related Resources





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Notify for updates 


SQL tips:

*Enter Code refresh code     



Learn more about SQL Server tools