Quantcast
Channel: NLB – Interface Technical Training
Viewing all articles
Browse latest Browse all 5

Windows Server 2008 and 2012 Network Load Balancing (NLB) Cluster using PowerShell

$
0
0

One of the major improvements to NLB in Windows Server 2008R2 and Windows Server 2012 is the addition of a NetworkLoadBalancingClusters module to PowerShell.  When the NLB-RSAT are installed 35 new NLB related CMDlets are available.  In this blog we will be exploring some of the new CMDlets.

Installing Network Load Balancing Cluster.

To install the NLB feature and NLB-RSAT tool set type the following, Install-windowsfeature NLB,RSAT-NLB

001-Windows-Server-Network-Load-Balancing-NLB-Cluster-using-PowerShell

Note: In Windows Server 2008R2 the CMDlet to install a windows feature is add-windowsfeature.

To view a complete list of NLB CMDlets type the following CMDlet, Get-command -module NetworkLoadBalancingClusters

002-Get-command module-NetworkLoadBalancingClusters-NLB-using-PowerShell

Note: On Windows Server 2008R2 the NLB Manifest must be imported first before viewing a list of CMDlets.  To import the Manifest type Import-Module NetworkLoadBalancingClusters.

To get help on and individual CMDlet use the built in help system of PowerShell, ie Get-help New-NLBCluster   Use the -Full, -Detailed, -Online or -Examples for more information.

003-Get-help-New-NLBCluster-using-PowerShell

Scenario:

A network load balancing cluster needs to be configured using USSHQSVR1 and USSHQSVR2.  The cluster name will be USSHQNLB.

Creating the NLB Cluster, use the following steps to configure:

  1. To create a new NLB cluster the New-NLBCluster CMDlet will be used.  On Server1 launch PowerShell to configure NLB on the first server, type the following CMDlet,  New-NLBCluster -Interface “Ethernet” -OperationMode Multicast -ClusterPrimaryIP 172.16.10.101 -ClusterName USSHQNLB

004-ClusterName-Get-help-New-NLBCluster-using-PowerShell

  • Interface – is the user friendly name displayed for the desired interface in the Network and Sharing Center.  In my example my interface name was Ethernet.  The default name may be Local Area Connection.
  • OperationMode
    • Unicast – All cluster hosts use the same unicast MAC address.  Suitable for NLB Clusters with a single network card.
    • Multicast – Each cluster host keeps it original MAC address, but is assigned an additional NLB Cluster MAC address.   Suitable for NLB Clusters with multiple network card.
    • Igmpmulticast – Special mode to prevent the switch from being flooded.
    • ClusterPrimaryIP – Configures the primary IP address of the NLB Cluster.
    • ClusterName – [Optional] Specifies the name of the NLB Cluster.

2. Port Rules are used to control how traffic is routed to the NLB Cluster nodes depending on port.  If desired after creating the NLB cluster you may want to modify the NLB Port Rules.  PowerShell provides a set of CMDlets to manage the NLB Port Rules.  This should be accomplished prior to adding additional nodes to the NLB environment.  The primary CMDlet for accomplishing this task is Set-NLBClusterPortRule.

  • Set-NLBClusterPortRule
    • NewStartPort – Specifies the new start port for the cluster port rule. The acceptable range is between 0 and 65535.
    • NewEndPort – Specifies the new end port for the cluster port rule. The acceptable range is between 0 and 65535.
    • NewAffinity – Specifies the new affinity for the cluster port rule. There are three possible values for port rule affinity: none, single, and network.
    • Add- NLBClusterPortRule.
      • Used to add a new port rule.
    • Disable- NLBClusterPortRule.
      • Used to disable a new port rule.
    • Enable- NLBClusterPortRule.
      • Used to enable a new port rule.
    • Remove- NLBClusterPortRule.
      • Used to remove a new port rule.

Adding Nodes to the NLB Cluster.

1. The additional node can be configured either locally or remotely.  In this demo I will be configuring it remotely. Using PowerShell type Invoke-Command -Computername  USSHQSVR2 -Command {Install-Windowsfeature NLB,RSAT-NLB}  to install the NLB feature on USSHQSVR2.

005-Install-Windowsfeature-ClusterName-NLBCluster-using-PowerShell

2. To add the USSHQSVR2 to the NLB Cluster type the following, Add-NlbClusterNode -InterfaceName “Ethernet” -NewNodeName “USSHQSVR2” -NewNodeInterface “Ethernet”

006-cluster-type-NLB-Cluster-using-PowerShell

3. A 2 node NLB Cluster is now configured, to view the NLB Cluster type Get-NLBClusterNode | Format-List * (See figure 7).   To verify the NLB Cluster IIS could be installed, using the default website make an obvious change to the landing page on one server.  Create and entry in DNS for the NLB Cluster IP Address and connect to the Website for a client.  Disconnect or disable the NIC on the sever you connected to and refresh the screen.  You should see the landing page on the other server.

007-cluster-type-format-list-NLB-Cluster-using-PowerShell

Your Network Load Balancing Cluster is now all configured and tested.  Until next time Ride Safe!

Rick Trader
Windows Server Instructor – Interface Technical Training
Phoenix, AZ

The post Windows Server 2008 and 2012 Network Load Balancing (NLB) Cluster using PowerShell appeared first on Interface Technical Training.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images