How to Manage Database Availability Groups(DAG) In Exchange Server
In this article, we'll learn to manage and administer the Database Availability Groups (DAG) in Microsoft Exchange Server to ensure an optimal DAG environment.
Join the DZone community and get the full member experience.Join For Free
Before DAG, Exchange Server 2007 was using multiple services for high availability, such as Local Continuous Replication (LCR), Single Copy Clustering (SCC), Standby Continuous Replication (SCR), and Cluster Continuous Replication (CCR). However, it lacked automatic failover protection, and there was no graphical user interface to manage or control the operations.
Database Availability Groups or DAG is a unified high availability feature that was introduced with the release of Microsoft Exchange Server 2010 to automate the database-level recovery and prevent data loss in the event of a database, server, or network failure. And to manage the DAG, you can use GUI-based Exchange Management Console in Exchange 2010 or the Exchange Admin Center in Exchange 2013 and later. You may also use Exchange management Shell, a command-line-based Exchange Server tool, to manage DAG.
In this article, you will learn how to manage and administer the Database Availability Groups (DAG) in Microsoft Exchange Server to ensure continuous replication, high availability and prevent issues or errors that may compromise or break your DAG environment.
Managing Database Availability Group in Exchange Server
After an Exchange Server DAG is built and configured, it’s time to manage the member servers and the databases. As an administrator, you may often require adding or removing member server or database copies to the DAG, performing an update, recovering lost DAG members, or removing the DAG.
Besides, you may also configure various DAG properties after the deployment to make changes to witness server/directory, encryption, network, active databases, etc.
Below are the best practices you may follow and apply to manage and maintain your DAG Exchange Server infrastructure efficiently.
Add or Remove Servers
You may require to add a new mailbox server to DAG or remove a lost mailbox server from the DAG to replace it with another and perform recovery on the lost one.
To add or remove Exchange Servers in DAG, you can use the Database Availability Group wizard in Exchange Admin Center (EAC). You may also use Add-DatabaseAvailaibilityGroupServer or Remove-DatabaseAvailaibilityGroupServer PowerShell cmdlets in Exchange Management Shell.
To add Exchange Server to DAG via EAC:
- Go to servers> database availability groups and tap + icon.
- Select the servers from the list and click Add> OK.
- This can take a while to finish. After the process completes, click Close.
Similarly, to remove a member Exchange Server from DAG:
- Go to servers> database availability groups and select the mailbox server from the list.
- Click on the – (minus) icon, confirm, and then click Save to save the changes.
- Click Close once the mailbox server is removed from the DAG.
To add or remove member mailbox servers from DAG, execute the following command in the EMS:
Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MBX1
Remove-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MBX1
Change/Update DAG Properties
After setting up and configuring the DAG Exchange Server, you can use the Exchange Admin Center or Exchange Management Shell to configure, change or update the DAG properties, such as witness server/directory, network, encryption, active databases, etc.
To edit or change the DAG properties, you can follow these steps in EAC:
- Go to servers> database availability groups and select the DAG you want to reconfigure, update or change the properties.
- Click on the edit (pencil) icon.
- Under the General page, you can view the DAG status and membership status. You can also configure or reconfigure witness server or directory and other network configurations.
- The IP addresses page allows you to change or modify the IP addresses assigned to the Database Availability Group.
To perform these changes and actions via EMS, you can use the following cmdlets:
Set-DatabaseAvailabilityGroup -Identity DAG01 -WitnessDirectory C:\DAG01
Set-DatabaseAvailabilityGroup -Identity DAG01 -AlternateWitnessDirectory C:\DAGFSW\DAG01.abc.com -AlternateWitnessServer MBX03
Set-DatabaseAvailabilityGroup -Identity DAG01 -DatabaseAvailabilityGroupIPAddresses 2555.255.2555.0
To check the configuration and changes are effectively running:
Get-DatabaseAvailabilityGroup <DAGName> | Format-List
DAG networks are automatically created and configured when DAG is deployed in Exchange 2013 or later. However, in Exchange 2010, you need to configure the DAG network manually.
However, you can always configure or change the DAG networks after enabling the manual DAG network control. To do this, you can run the following command in the EMS:
Set-DatabaseAvailabilityGroup DAG01 -ManualDagNetworkConfiguration $true
Now you can use the New-DatabaseAvailabilityGroupNetwork and Set-DatabaseAvailabilityGroupNetwork cmdlets in EMS to create a new DAG network or configure the existing DAG network properties, such as name, description, subnet, and enable/disable replication.
Use Set-MailboxServer Cmdlet to Manage DAG
Set-MailboxServer cmdlet can modify and change the mailbox server attributes and mailbox configuration settings. For example, you can use the cmdlet with the below parameters mentioned to manage the mailbox servers in DAG.
AutoDatabaseMountDial is a parameter used with the Set-MailboxServer cmdlet to specify automatic database mount for continuous replication after failover. You can choose between three different values to specify whether to mount the database immediately after the failover or wait for logs to be copied to the passive copy before mounting.
The values are as follow:
BestAvailability - When BestAvailability is selected, the database automatically mounts immediately after a failover when the number of logs pending for copy is less than or equal to 12. When queue length is >12, the Exchange replicates the pending logs to passive database copy and then mounts the database.
GoodAvailability - When GoodAvailability is the default value that automatically mounts the database when the log queue length is less than or equal to 6.
Lossless - The database mounts only after all the logs are copied to the passive copy in the event of a failover.
To change the value, you can run the following command in EMS:
Set-MailboxServer -Identity EXCHSRV01 -AutoDatabaseMountDial Lossless
DatabaseCopyActivationPolicy is another Set-MailboxServer parameter that allows you to specify the automatic activation for mailbox database copies on member DAG servers. You can choose between the following values to define the policy,
Unrestricted - Use this value to remove all restrictions from activating mailbox database copies on mailbox servers.
Blocked - Use the value to block the databases from automatic activation on selected mailbox servers.
IntrasiteOnly - Use the value to allow the database copy to be activated on mailbox servers in the same AD site and prevent cross-site activation or failover.
MaximumActiveDatabases parameter allows you to specify the number of databases mounted on a mailbox server to distribute the load and ensure each mailbox server is not overloaded.
When the specified number of database copies are active on a server, no more copies will be activated in case of a switchover or failover.
Shutting Down DAG
Shutdown may be required if you have installed an application or updated the server in a DAG. The best practice is to switch over to a member server before performing a shutdown to prevent lossless activation and prevent issues.
DAG Maintenance and Update
It’s good to put the DAG member servers in maintenance mode before installing the updates or performing any hardware or software maintenance task. This step is critical as several services, including cluster service, are stopped when you update the server or install updates. After the update, you can put the back server to production mode.
Additionally, you can use the
StopDagServerMaintenance,ps1 PowerShell scripts with server parameters to put the server in maintenance mode and revert to production mode.
In this article, we shared some tips and methods to efficiently manage the Database Availability Groups (DAG) in Exchange Server. You may follow these for the maintenance and administration of your DAG Exchange Server infrastructure. Also, maintain a regular VSS backup for your Exchange Server to prevent permanent data loss when a disaster strikes.
Opinions expressed by DZone contributors are their own.