Exchange 2013: Creating and testing Database Availability Groups (DAG)
Exchange can be used to reduce the cost and complexity of messaging systems that provide high availability levels and mailbox capacity.The new Exchange allows users to deploy an economical messaging continuity service in their organization.
In this article, we shall deal with the use of the new Exchange Administration Center (EAC) in creating a mailbox database and a new DAG.
Database Availability Group feature of the Exchange can be viably used to increase reliability and availability in organizations.
Note: We can check which mailbox is already running on your system by opening
There, locate Microsoft Exchange Store Worker Process. Each instance of this process is associated with a mailbox database.
Here only one Store Worker process is running indicating that only one mailbox database is being used by the exchange.
We begin by signing in to the Exchange Administration Center (EAC).
Now locate Servers page on the left pane of our homepage and go to Databases Tab.
We can now see a list of available mailboxes. Clicking on a particular mailbox will allow us to review the mailbox.
We shall now see how to configure Exchange for high availability.
We begin by clicking on + (New).
We can now see a pop up window where we can define the properties of the new mailbox. Fill in the name and select the server on which the mailbox is to be hosted.
After choosing the server, we can now specify the paths for database and log folder.
Please note that we have to select Mount this database option.
Now click on Save.
This will create a new mailbox database
We can verify that the new mailbox has been created by going to task manager-> Processes and locating Microsoft Exchange Worker Processes instances just as we did before.
In Exchange, it is database availability group (or DAG), that enables high availability and site resilience. A DAG is a collection of Mailbox servers that can manage a set of databases providing automated, database-level failure recovery that may affect individual databases, networks, or servers. The number of mailboxes can be up to 16 in a DAG.
Any mailbox database from a server in a DAG can be accessed from any other server in the DAG. Other servers within the DAG can provide automatic recovery from failures that affect mailbox databases, such as a disk failure or server failure, to any new or existing server added to the DAG.
Steps to Create a New DAG in Exchange 2013
In the EAC home page, go to Servers from the left pane.
Click on Database Availability Groups tab.
Click on the + (NEW) button.
In the new pop up window, we can define the parameters of the DAG like name, ip address, witness server etc. A witness resource is used in DAGs to make sure that only one collection of the members in the DAG is considered official.
Click on Save.
A warning message will be displayed. Click OK.
Now we can see the newly created DAG listed. We can review and edit the information about the DAG by clicking edit button. This is illustrated in the following figure.
Next, we need to add a server to the DAG. It can be done by clicking on Manage Membership button on the DAG page in the EAC. The following figure illustrates this.
Once you click the Manage Membership button, a new pop up window opens listing the current servers in the DAG. To add a new server click on the + (Add) button, select the desired server from the newly populated list, click OK, and finally Save. Now a message will be displayed notifying that the saving has been completed successfully. Click Close.
We can add as many servers to the DAG as we desire by repeating the procedure.
Once servers are added to the DAG, we can see in the DAG window that the added servers have been listed as Member Servers.
If we navigate back to the database pane, we can see that the newly added database has been listed as a part of the newly created DAG.
Now, we can add a copy of the database to another server. To do this, follow the following steps.
Click on Add database copy button.
In the pop up window, specify the Mailbox Server for the copy database. Here, we can also define the activation preference number of the server.
After the database copy has been successfully created, click Close.
We can view and edit the information about the mailbox database from the details pane by clicking on Edit Details button. We can also manage aspects of the database copy, like suspending the copy, activating the copy or removing the copy, from the details pane.
Checking the Status of the DAG in Exchange 2013
After deploying and assigning mailbox servers to a DAG, we can check the status of the DAG through Exchange Management Shell.
The following cmdlet returns the status of the DAG named DAG1.
Get-DatabaseAvailabilityGroup -Identity DAG1 –Status
The following cmdlet returns the status of the database copy called MDBHA1
We can create a new mailbox for a user in the mailbox using the following cmdlet.
New-Mailbox-Alias SpencerL -Name “Spencer Low” -Firstname Spencer -LastName Low -DisplayName “Spencer Low” -UserPrincipalName SpencerL@contoso.com -Password <ConvertTo-SercureString -String ‘password’ -AsPlainText -Force> -Database MDBHA1
Here, we have created a mailbox for user Spencer Low in the mailbox MDBHA1.
We can verify that the mailbox for Spencer Low has been created, by going back to the EAC. In the EAC navigate to Recipients and in the populated list, search for the name Spencer. We can view and edit the details of the mailbox by clicking on the edit button as shown here.
Testing Database Availability Group (DAG) Switchover and Failover in Exchange 2013
Now we can examine how we can test a DAG for reliability by performing Switchover and Failover tests.
Let us begin by sending a text message between two Exchange users using the Outlook WebApp.
Log in to the outlook web app as the first user (Henceforth known as Spencer Low)
Send a text message to a second user whose mailbox is located in a different mailbox database. (The second user shall henceforth be known as Alex Darrow)
Now just to verify that the message has been received, sign out of the web app and sign in as Alex Darrow.
Now return to the EAC, go to Servers and open Database tab.
Now select the required mailbox database.
Click on Activate in the details pane as shown to switch over to the database.
Click Yes on the warning message.
When it shows that operation is successful, click Close.
Now we have successfully completed a switch over.
Now we can return to the outlook web app to reply to the message sent to Alex as Spencer.
To verify that the replying was successful, in the outlook web app log out and log in as Spencer.
Automatic Service Recovery
Now let us find out more about automatic service recovery. Let us terminate a process and see if it is reinstated automatically by the exchange.
Open the exchange management shell
Terminate the inetinfo process using the following command
TaskKill /F /IM inetinfo.exe
Now open event viewer from Start Menu->Administrative Tools->Event Viewer to find out how the event was handled.
Select the event logged as an Error to see more details.
Now just above the Error Log, an information log has been registered which shows that the service was reinstated into running state. This happened because the inetinfo process was being monitored by the managed availability feature in Exchange.
With managed availability, internal monitoring and recovery-oriented features are tightly integrated to help prevent failures, proactively restore services, and initiate server failovers automatically or alert administrators to take action. The focus is on monitoring and managing the end-user experience, rather than just server and component uptime, to help keep the service continuously available.
Now, we can test the DAG for a failover. The automatic activation of one or more mailboxes after a failure event is known as failover.
We begin by triggering a failover by stopping an Exchange Store Worker process.
This can be done by the following command.
Get-Process Microsoft.Exchange.Store.Worker | Stop-Process –Force
After entering the command we can check the status of the database copy of the mailbox database. This is done using the command:
Get-MailboxDatabaseCopyStatus -Identity MDBHA1
Now we can see that the failover has been successful
This can be further verified by going to the outlook web app and sending a message to Spencer as Alex. The failover will be successful if Spencer receives the message.
Keywords: Exchange 2013 DAG, understanding DAG in exchange 2013, Exchange 2013 database availability group