Step-by-Step DHCP Load Balance Cluster on Windows Server 2012 R2

 Overview

In large environments a single DHCP server may become overwhelmed by the amount of client DHCP lease requests it receives. Load balancing your Windows DHCP server allows you to improve performance and availability by spreading the load across multiple servers.

When a load balance cluster is created, a partnership between two servers is defined. Each server is able to read and write to the DHCP scope’s database. Any changes are then replicated to the other partner to insure consistency.

Clustering is done at the scope level, allowing us to use one server, for example, as a cluster partner with multiple remote servers.  We can selectively choose to cluster all scopes available on a server or a selection of scopes.

This step-by-step tutorial will guide you through configuring a DHCP load balance cluster on Windows Server 2012 R2.

Requirements

  • An existing Active Directory Domain.
  • Two Windows Server 2012 R2 servers that are domain members.

  • Install the DHCP Server Role

The DHCP server role must be installed on both servers before the cluster can be created.

  1. Log onto the first server with an account that has administrative rights.
  2. Launch the Server Manager console.
  3. In the top-right corner, click Manage.
  1. FIG1 – Click the Manage link in Server Manager
  2. Click Add Roles and Features.
  3. On the Before You Begin page, click Next.
  4. On the Select installation type screen, ensure Role-based or feature-based installation is selected, and then click Next.
  5. On the Select destination server screen, ensure Select a server from the server pool is selected, select the local server in the Server Pool list, and then click Next.
  6. On the Select server roles screen, ensure DHCP Server is checked. A dialog box called Add Roles and Features Wizard will appear, if dependencies exist. Click Add Feature to ensure all dependent roles or features are installed in addition to the DHCP server role.
  7. Click Next.
  8. On the Select features screen, click Next.
  9. On the DHCP Server screen, click Next.
  10. On the Confirmation screen, click Install.
  11. After the installation process completes, there should be a link named Complete DHCP Configuration. Click it to start the DHCP Server Active Directory authorization process. A DHCP server must be authorized before it can assign DHCP leases.
  12. On the Description screen of the DHCP Post-Install Configuration wizard, click Next.
  13. On the Authorization screen of the DHCP Post-Install Configuration wizard, select the appropriate option for selecting a user with domain admin rights. This is required to authorize the server. When done, click Commit.
  14. On the Summary screen, review the output to ensure the authorization was successful. Click Close.
  15. On the Results screen of the Add Roles and Features Wizard, click Close.
  16. Log onto the second server and repeat steps 2 through 17.
  17. Create a DHCP Scope

    The cluster cannot be created unless a DHCP scope exists. Let’s create a simple scope to start.

    1. Log onto the first DHCP server.
    2. Launch the Server Manager console.
    3. On the top-right, click Tools.
    4. Select DHCP from the Tools drop-down menu.
    5. From the DHCP tree on the left of the console, expand the node named after the server.
    6. Select the IPv4 node by clicking it.
    7. Right-click the IPv4 node and then select New Scope.
    8. Go through the New Scope Wizard to create the new scope.
    1. Create the Load Balance Cluster
    1. From within the DHCP console, right-click the IPv4 node of the DHCP server tree on the left-side.


      1. FIG2 – Windows Server 2012 R2 DHCP Console
      2. Click Configure Failover from the IPv4 context menu.
      3. When the Configure Failover dialog box appears, select from the available scopes that you wish to have in the cluster. If you want to include all of them, check the Select All box.


      1. FIG3 – DHCP Configure Cluster Dialog Box
        You can create multiple partner relationships with other DHCP servers. This allows you to create clusters between all of your remote site DHCP servers and a central head office server.
      2. Click Next.
      3. Click Add Server to add the DHCP partner server. Alternatively, you can enter its IP address or fully-qualified domain name into the text field.
      4. Click Next.
      5. On the Create a new failover relationship screen, give the cluster relationship a name.


      1. FIG4 – Configure Cluster – DHCP Load Balance
      2. Set the Maximum Client Lead Time value using hours and minutes.
        This sets the maximum amount of time a partner DHCP server can extend a lease to a client after the owner of the scope fails. This also sets how long the partner DHCP will wait for the failed owner before taking full control of the scope.
      3. From the Mode drop-down menu, select Load balance.
      4. Adjust the Load Balance Percentage values of the two DHCP servers. The default creates a 50/50 balance between both nodes.
      5. Ensure Enable Message Authentication is checked.
      6. In the Shared Secret text field, enter a complex password that will be used by the servers. This ensures that only servers who know the password can communicate in the cluster.
      7. Click Next.
      8. Verify your settings, and then click Finish.
      9. Log onto the second DHCP server.
      10. Launch the DHCP console and verify that the scope we created on the first DHCP server has been replicated to the second server.
      1. Creating a DHCP Failover Cluster using PowerShell

      We can accomplish the same task above using PowerShell. This is very useful when administering the servers remotely from a client computer.

      1. 1. Launch PowerShell.
      2. 2. Use the Add-DhcpServerv4Failover cmdlet. The example below creates a partnership (cluster) called Toronto-Loadbalance using servers WS12-DHCP01 and WS12-DHCP02.
      Add-DhcpServerv4Failover -ComputerName ws12-dhcp01.serverlab.intra -Name Toronto-Loadbalance -PartnerServer ws12-dhcp02.serverlab.intra -ScopeId 172.30.0.0 -LoadBalancePercent 50 -MaxClientLeadTime 2:00:00
3.Verify the cluster’s configuration using the Get-DhcpServerv4Failover cmdlet.

Name                : Toronto-Loadbalance
PartnerServer       : ws12-dhcp02.corp.serverlab.intra
Mode                : LoadBalance
LoadBalancePercent  : 50
ServerRole          :
ReservePercent      :
MaxClientLeadTime   : 02:00:00
StateSwitchInterval :
State               : Normal
ScopeId             :
AutoStateTransition : False
EnableAuth          : True

Post a Comment

0 Comments