Skip to main content
TechNet

Microsoft Exchange Server 2010: Clustering for high availability

Configuring clustering and using Database Availability Groups are two excellent ways to ensure high availability for Microsoft Exchange.

Excerpted from “Exchange 2010 - A Practical Approach,” published by Red Gate Books (2009).

Jaap Wesselius

In Exchange Server 2007, Cluster Continuous Replication (CCR) uses the cluster resource management model to install and manage the high availability (HA) solution. Initially, you build the Windows cluster and then run Exchange setup in clustered mode. This registers the EXRES.DLL in the failover cluster, and creates the Clustered Mailbox Server (CMS). You have to build the failover cluster in advance in an Exchange Server 2007 environment, even if it’s just a one-node cluster.

The cluster components are now hidden in Exchange Server 2010. This process has also introduced a new component called the Active Manager. The Active Manager replaces the resource model and failover-management features offered in previous versions of Exchange Server.

The failover clustering components haven’t been completely removed, though. Some of them are still being used. If you open Failover Cluster Manager in Administrative Tools, you’ll find the Database Availability Group (DAG), cluster networks and so on. Don’t try to manage the DAG using the Failover Cluster Manager, as this isn’t supported. The Exchange Management Console (EMC) or the Exchange Management Shell (EMS) are the only ways to manage the DAG.

The Active Manager runs on all Mailbox Servers that are members of a DAG. There are two roles—the Primary Active Manager (PAM) and the Standby Active Manager (SAM). The PAM is running on the Mailbox Server that also holds the cluster quorum. This is the server that decides which databases are active and which are passive within a DAG.

The SAM is responsible for determining server or database failures (the PAM does this on its own server for its own local databases). If the SAM detects any, it communicates with the PAM to initiate a failover.

The replication service monitors the health of the mounted databases within a DAG. It also monitors the Extensible Storage Engine, or ESE, for any I/O issues or failures. If anything goes wrong here, the replication service immediately contacts the Active Manager. In the case of a failover, the Active Manager determines which database should become the active copy of the database (depending on the failover order you’ve specified during configuration).

Configuring a DAG

You’ll need at least two Exchange Server 2010 Mailbox Servers to properly configure a DAG. Imagine a four-server deployment, one Exchange Server 2010 Client Access Server, one Exchange Server 2010 Hub Transport Server and two Exchange Server 2010 Mailbox Servers (EXMBX01 and EXMBX11). All four servers are located in the same Active Directory site, and this site is also the Internet-facing Active Directory site.

Let’s assume all four servers are fully operational and working fine. To create a DAG for the two Mailbox Servers, you’ll need an additional private network. You’ll use this for replication purposes.

Follow these steps to create a DAG in this environment:

  1. Log on to an Exchange Server and open the EMC.
  2. Expand Exchange On-Premises (the server), and then expand the Organization leaf. Click the Mailbox and then click the Database Availability Group tab. No items will show in the results pane.
  3. On the Mailbox Server, open the EMS and then enter the following command:
New-DatabaseAvailabilityGroup –Name DAG1
–DatabaseAvailabilityGroupIpAddresses 10.0.0.101
4. This will create a new DAG with the IP address of 10.0.0.101. Because a DAG is nothing more than a placeholder in Active Directory, you can see it with ADSIEdit.
5. To add the first Mailbox Server (EXMBX01) to the DAG, switch back to the EMS and enter the following command:
Add-DatabaseAvailabilityGroupServer –Identity DAG1 –MailboxServer EXMBX01
6. The specified Mailbox Server is now added to the DAG. This will also create a File Share Witness on the Hub Transport Server. You need the File Share Witness (just like in an Exchange Server 2007 CCR environment) to create a majority in the cluster when a server fails. The process of adding the Mailbox Server and creating the File Share Witness can take up to 45 seconds.
7. When switching back to the EMC, you’ll now see the DAG (DAG1) in the console, as well as the EXMBX01 you just added.
8. Click the Database Management tab in the EMC. You’ll see the initial databases on the first and second Mailbox Servers. You’ll also notice there’s one database copy available on each server. When you select the Public Folder Database in the Database Management tab, the Database Copies results pane is grayed-out. This is because Public Folder Replication and Database Replication aren’t compatible.
9. To add the second Mailbox Server to the DAG, log on to the second server and open the EMS. Enter the following command:
Add-DatabaseAvailabilityGroupServer –Identity DAG1 –MailboxServer EXMBX11

Now the second Mailbox Server will be added to the DAG. As with adding the first Mailbox Server, this process can take several seconds to complete.

If the Windows failover clustering components aren’t already installed on the Mailbox Server, they will be automatically. You can also manually install them in advance by opening a command prompt and execute the following command:

ServerManagerCmd.exe –i Failover-Clustering

Now you’ve created a DAG with two Mailbox Servers and you’re ready to configure Database Copies. The DAG feature in Exchange is very flexible. There’s no need to configure a Windows failover cluster in advance. You can add a Mailbox Server to the DAG whenever you need to without a problem. Just install a Mailbox Server, install the failover clustering bits and add the server to the DAG. This process is called Incremental Deployment.

You can also create site resilience using the DAG. Besides adding Mailbox Servers within the same Active Directory site (in the same datacenter), you can also add Mailbox Servers to another Active Directory site. As long as the network connectivity is good enough to handle replication in a timely manner—and the Hub Transport Server and Client Access Server have a reliable network connection to the other datacenter—you’re ready to go.

If you want to add a Mailbox Server from another site to the DAG, you’ll need to make a few configuration changes. You have to add the IP address of the DAG in the other site to the local DAG. Because you can’t do this with the EMC, you’ll have to use the EMS. Enter the following command:

Set-DatabaseAvailabilityGroup –Identity DAG1
–DatabaseAvailabilityGroupIpAddresses 10.0.0.101,192.168.1.101

The first network in the DAG will be created automatically when you add the first Mailbox Server. Additional networks will not be created automatically, so you’ll have to manually add the subnet of the second site to the DAG:

New-DatabaseAvailabilityGroupNetwork -DatabaseAvailabilityGroup DAG1
-Name DAGNetwork02 -Description “Second Site” -Subnets 192.168.1.0/24
-ReplicationEnabled:$True

If there are domain controllers in the site you just added, you’ll have to either wait for replication to finish or force replication to start. Otherwise, the DCs in the second site might not have enough knowledge about the changes you want to make.

At this stage you can add a Mailbox Server from the second site to the DAG using the EMC or the EMS:

Add-DatabaseAvailabilityGroupServer –Identity DAG1 –MailboxServer EXMBX02

This is one of several HA strategies you can use with Microsoft Exchange Server. Look for more details on additional HA configuration strategies in the future.

Jaap Wesselius
Jaap Wesselius is the founder of DM Consultants, a company with a strong focus on messaging and collaboration solutions. After working at Microsoft for eight years, Wesselius decided to commit more of his time to the Exchange community in the Netherlands, resulting in an Exchange Server MVP award in 2007. He’s also a regular contributor at the Dutch Unified Communications User Group and a regular author for Simple-Talk.

Learn more about “Exchange 2010 - A Practical Approach” at red-gate.com/our-company/about/book-store.

Related Content