DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. How to Install and Configure Windows Server Failover Clustering on an ECS Instance

How to Install and Configure Windows Server Failover Clustering on an ECS Instance

Learn how to deploy Windows Server Failover Clustering on an Alibaba Cloud ECS Instance in a remote cloud.

Leona Zhang user avatar by
Leona Zhang
·
Oct. 16, 18 · Tutorial
Like (1)
Save
Tweet
Share
5.91K Views

Join the DZone community and get the full member experience.

Join For Free

In this tutorial, we will show you how to prepare your remote cloud and deploy Windows Server Failover Clustering on an Alibaba Cloud ECS Instance.

We recommend you use Windows Server Failover Clustering (WSFC) and SQL Server AlwaysOn Availability Groups as your SQL Server high availability solution on Alibaba Cloud's ECS (Elastic Compute Service) Instances.

WSFC is a feature of the Windows Server platform, which is generally used to improve the high availability of applications and services on your network. WSFC is a successor to the Microsoft Cluster Service (MCS).

An Alibaba Cloud ECS Instance provides fast memory and the latest Intel CPUs to help you to power your cloud applications and achieve faster results with low latency. All ECS instances come with Anti-DDoS protection to safeguard your data and applications from DDoS and Trojan attacks.

The Alibaba Cloud ECS allows you to load applications with multiple operating systems and manage network access rights and permissions. Within the user console, you can also access the latest storage features, including auto snapshots, which is perfect for testing new tasks or operating systems as it allows you to make a quick copy and restore later. It offers a variety of configurable CPU, memory, data disk and bandwidth variations allowing you to tailor each Instance to your specific needs.

We recommend the following hardware to deploy this solution:

  1. ECS: 4-core CPU or above with 16GB of memory, or above.
  2. Mount SSD cloud disks as ECS.

We also recommend the following software with the listed specifications:

  1. .NET Framework 4.0 or above
  2. Powershell 5.0 or above
  3. Windows Server 2016 64-bit Data Center Edition
  4. SQL Server 2016 64-bit Enterprise Edition

1. Set Up Your ECS and Remote Cloud

1.1. Modify Your Host Name

Since images produce ECS instances, some of them may share the same name. While this problem is rare with VPCs (Virtual Path Connections), to ensure absolute security, modify the host name to shorter than 15 characters and immediately restart the host.

You can manually alter the name using the following Powershell command:

Rename-Computer -NewName "ServerName" -restart -force  

1.2. Disable UAC Restrictions

You can disable the User Account Control (UAC) remote restrictions using the following Powershell command:

new-itemproperty -path 
HKLM:SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem -Name 
LocalAccountTokenFilterPolicy -Value 1

1.3. Install the Windows Failover Cluster Feature

This is a mandatory and basic structure that allows AlwaysOn to grow on the Windows Cluster. Use the Powershell command:

Install -WindowsFeature -Name Failover-Clustering - IncludeManagementTools

1.4. Modify the DNS Suffix of a Windows Host

This solution involves a stand-alone control. To make the solution successfully run under Windows Cluster, you need to add the uniform suffix to the hostname for identification purposes.

You can modify it through the UI, or use the Powershell command:

$ParentKeyPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
$DnsSuffix="aliyunrds.com"
New-ItemProperty -Path $ParentKeyPath -Name "NV Domain" -Value $DnsSuffix -PropertyType 

1.5. Change the Host's Static IP Address

Strictly speaking, you can use a DHCP for configuration in Windows Server. However, we suggest you use a static IP address to configure the host's network connection.

You can use the UI or the Powershell command for configuration. However, remember to check the DNS configuration and adjust it as necessary. The Powershell command is as follows:

$IPType = "IPv4"

$Adapter = Get-NetAdapter | Where-Object {$_.Status -eq 'up' -and $_.name -ne 'loopback'}

$IpAddress=((($Adapter | Get-NetIPConfiguration).IPv4Address) | Where InterfaceAlias -ne "loopback").IPAddress
$PrefixLength=((($Adapter | Get-NetIPConfiguration).IPv4Address) | Where InterfaceAlias -ne "loopback").PrefixLength
$Gateway=((Get-NetIPConfiguration).Ipv4DefaultGateway).NextHop

If (($adapter | Get-NetIPConfiguration).IPv4Address.IPAddress) 
{
    $adapter | Remove-NetIPAddress -AddressFamily $IPType -Confirm:$false
}

If (($adapter | Get-NetIPConfiguration).Ipv4DefaultGateway) 
{
    $adapter | Remove-NetRoute -AddressFamily $IPType -Confirm:$false
}

# config static ip address
$Adapter | New-NetIPAddress -AddressFamily $IPType  -PrefixLength $PrefixLength  -IPAddress $IpAddress -DefaultGateway $Gateway

1.6. Modify the Host's Hosts File

The file is located at hosts under C:WindowsSystem32driversetc. You need to map the name and DNS suffix of every host along with the IP addresses. You can do this with the following cmd command:

copy C:\Windows\System32\drivers\etc\hosts C:\Windows\System32\drivers\etc\hosts_2017033141131
echo 172.16.18.247 iZbp1ehi2dopyqC.aliyunrds.com >> C:\Windows\System32\drivers\etc\hosts
echo 172.16.18.246 iZbp1ehi2dopyqZ.aliyunrds.com >> C:\Windows\System32\drivers\etc\hosts
echo 172.16.18.248 iZbp1ehi2dopyqA.aliyunrds.com >> C:\Windows\System32\drivers\etc\hosts

1.7. Create a Windows Cluster

Next, we'll create the Windows cluster. The latest version of Windows Server 2016 supports cluster creation through the UI, but you can also choose to create the cluster through the Powershell command. You need to specify staticAddress, which is the IP address in the VPC. Be careful not to occupy it:

New-Cluster –Name clus-aliyun0001 -Node 
iZbp1ehi2dopyqC.aliyunrds.com,iZbp1ehi2dopyqZ.aliyunrds.com,iZbp1ehi2dopyqA.aliyunrds.com -AdministrativeAccessPoint DNS -StaticAddress 172.16.18.101

1.8. Set an Arbitration Mechanism for Windows Cluster

Non-domain-control AlwaysOn availability groups only support arbitration through majority nodes or based on Microsoft cloud files. Alibaba Cloud only supports the majority nodes mode. As a result, you must deploy at least three nodes for your Windows Cluster. If you deploy four nodes, make sure to set one of them to zero voting rights. If you only need two database copies, you can use two ECS instances, with one serving as an AlwaysOn node and the other only joining the Windows Cluster.

Set VOTE: 
$node = "Always OnSrv1"  
(Get-ClusterNode $node).NodeWeight = 0 

Set no-witness:  
Set-ClusterQuorum -NoWitness  

Set majority-node arbitration: 
Set-ClusterQuorum –NodeMajority

1.9. Set the Interval for the Windows Cluster Failovers

You may observe in your testing process that after several failovers, automatic failover ceases to function after some time. This is because Windows Cluster imposes a limit on the number of automatic failovers for each resource group within a certain period.

If you want to increase the limit of automatic failovers to, say 30 failovers, use the following command.

(Get-ClusterGroup "Cluster Group").FailoverThreshold = 30

1.10. Create a Read-Only Server Load Balancer

Bind the read-only ECS instance to the Server Load Balancer and specify the weight.

2. Deploy an Active Directory (AD) Domain Service and the CA (Certificate) Service

2.1. Add AD Domain Service

Open the Windows Server UI and click "Add roles and features."

Image title

Under Server Roles, click "Active Directory Domain Service" and click "Next."

Image title

Make sure the "Include management tools" checkbox is selected and click "Add Features."

Image title

Check your installation selection matches the screenshot below. Click "Install."

Image title

The installation process will start, and you will see a progress bar. When the installation is complete, the following line will appear, indicating that you need to configure your installation:

Image title

Your installation is complete. Click "Close" and proceed to the next step.

2.2. Configure the AD Domain Service

Now, you need to configure your AD Domain Service. A small hazard sign should appear on the Server Manager Dashboard, alerting you to complete your configuration. Click the hazard sign, and then click "Promote this server to a domain controller."

Image title

The configuration wizard window will appear:

Image title

Check to "Add a new forest" and enter your root domain name. Next, click the "Domain Controller Options" on the left-hand menu and fill in the password fields, leaving all the other options as the default values:

Image title

Click "Next." The prerequisite checks should pass successfully. You can now click "Install" to begin the installation:

Image title

After the installation your computer will automatically restart. Use "rwstest.comAdministrator" to log in to Windows Server.

2.3. Install the CA (Certificate) Service

Return to your "Add Roles and Features Wizard" and click "Server Roles." Check "Active Directory Certificate Services:"

Image title

Go to "Role Services" and check "Certification Authority Web Enrollment:"

Image title

Click "Next" and the following screen should appear:

Image title

The CA Service installation is complete.

2.4. Configure the CA (Certificate) Service

Open the AD CS Configuration window, go to "Role Services" and check "Certification Authority Web Enrollment:"

Image title

Click "Next" and make sure the "Enterprise CA" is selected:

Image title

Click "Next." Then, add the details of your CA:

Image title

Click "Next" and check your configuration:

Image title

Click "Configure" and the following screen should appear:

Image title

3. Verification

Open a browser window and type "http://servername/certsrv in the address line (where servername is the name of the server on which the CA certificate is installed).

The following should appear:

Image title

That's it! You've installed and configured Windows Server Failover Clustering for Alibaba Cloud ECS.

Entity component system clustering Alibaba Cloud Host (Unix) Web Service Data (computing) Cloud Command (computing) PowerShell

Published at DZone with permission of Leona Zhang. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Check Docker Images for Vulnerabilities
  • How Observability Is Redefining Developer Roles
  • Upgrade Guide To Spring Data Elasticsearch 5.0
  • Express Hibernate Queries as Type-Safe Java Streams

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: