In Exchange 2013, Mailbox server high availability is provided by a feature called Database Availability Group (DAG). DAG uses failover clustering feature of Windows Server. The feature, Windows Failover Cluster will be automatically installed in each nodes when you setup DAG members, so no need to install it manually early. The underlying Windows OS where Exchange 2013 is installed must support Windows Failover Cluster to be able to setup DAG. Following OS supports Windows Failover Cluster: –
- Server 2008 R2 Enterprise
- Server 2008 R2 Datacenter
- Server 2012 R2 Standard
- Server 2012 R2 Datacenter
In addition, all servers that will be member of DAG must run same operating system version. For example, you can’t configure DAG between Exchange 2013 running on Server 2008 and Server 2012, both must be running same operating system.
Configure DAG in Exchange 2013
The diagram below shows Exchange 2013 DAG scenario. EX01 and EX02 are two Exchange 2013 Standard edition servers with both CAS and Mailbox roles installed in each Exchange servers. Both Exchange servers are installed on Server 2012 R2 Standard edition.
Step 1: NIC Configuration
Let’s start with NIC configuration. DAG needs NICs for replication and client connectivity. So two NICs for each Mailbox server is highly recommended even though one will simply work. It is good way to start with renaming the NICs. Open Network Connections by going into control panel or by running ncpa.cpl in Run (Windows Key + R) application.
You need to setup the order of NIC so that MAPI is listed first. To do so, press Alt key which will display the file menu and click on Advanced and Advanced Settings.
Arrange the NIC order and click OK.
The replication network and MAPI network must be in different subnet.
Step 2: Pre Stage DAG Cluster Name Object (CNO)
When you create a DAG, you need to create Cluster Name Object (CNO) in Active Directory prior to creating DAG. So before you create a DAG group, it is highly recommended to pre stage the DAG Cluster Name Object (CNO) in Active Directory. In my lab, I have already pre-staged the CNO in Active Directory.
Step 3: Witness Server
DAG requires a witness server to maintain a Quorum. Witness server is used only when there is even number of nodes in DAG. But you must configure witness server even though you have odd number of nodes in DAG even though the witness server won’t be used in this case. So witness server is only used when it’s needed to maintain the quorum. If the roles are separately installed then, Microsoft recommends to configure CAS server to become witness server as part of DAG configuration. If both roles are installed in same machine, then File server or any other server can be used as witness server. You can use domain controller as witness server but it is not recommended. Here, I have configured file server as a witness server by using a shared folder on C drive of file server.
Step 4: DAG Configuration
To create a DAG, open Exchange Admin Center (EAC). Select Servers on the features pane and select Database Availability Groups tab in the main window. Here, click Add “+” to create new DAG.
New database availability group page will open. Under DAG name, type the name of the DAG. The name of DAG must match the CNO object created in Active Directory. In my case it’s MBG-DAG. Under witness server, type the FQDN of Witness Server. Here, I have configured file server as witness server and the FQDN is file.mustbegeek.com. Under witness directory, type the location of shared folder. I had shared folder called WitnessShare which was located in C Drive. So the directory is, “C:\WitnessShare”. You can configure the DAG IP or leave it blank, leaving it blank will get IP from DHCP server if the DHCP server is configured. Here, I will leave it blank. But you can assign static IP, for example, 192.168.2.135. The DAG IP is actually assigned to DAG name and the DAG name will be resolved to assigned/DHCP IP address. Click Save.
You can view the DAG information in same window.
Double click the DAG name to add DAG members to this DAG. Click Add “+”.
Select the Mailbox servers and click Add button. Click OK after adding.
After click OK and Save, Windows Failover Clustering components will be installed in each DAG members.
You will see completed message after the DAG configuration is completed.
You can view the DAG information by selecting the DAG name and viewing the information in details pane.
You can view the details of DAG network configuration using following PowerShell cmdlet,
Get-DatabaseAvailabilityGroupNetwork | FL
If, for some reason DAG network is not populated properly, you can using following PowerShell cmdlet to populate the DAG networks. You can also use this command if you add or remove networks or change DAG network subnets, you can force rediscovery of all DAG networks by using the DiscoverNetworks parameter
Set-DatabaseAvailabilityGroup MBG-DAG -DiscoverNetworks
If you want to re-configure the DAG, cluster configuration and witness server automatically, then type this PowerShell cmdlet. This might be handy if there is something wrong going on with the DAG setup.
You can also view DAG cluster information in Windows Failover Cluster Manager. The snapshot below shows DAG name which is now a Failover Cluster name. You can also see witness server information which is file.mustbegeek.com.
The DAG has been created successfully. Now type the following PowerShell cmdlet in EMS to enable the DAC mode.
Set-DatabaseAvailabilityGroup -Identity MBG-DAG -DatacenterActivationMode DAGOnly
DAC mode prevents from split brain formation. This will also allow you to run Stop-DatabaseAvailabilityGroup and Start-DatabaseAvailabilityGroup PowerShell cmdlets for failover.
You can now add database copy for each database.