Setting Up Exchange Database Availability Groups Correctly

Published:14 January 2021 - 7 min. read

Azure Cloud Labs: these FREE, on‑demand Azure Cloud Labs will get you into a real‑world environment and account, walking you through step‑by‑step how to best protect, secure, and recover Azure data.

If you have a highly-available Microsoft Exchange environment, you have Exchange database availability groups. Database availability groups are the key to maintaining a highly-available and scalable set of Mailbox servers.

In this tutorial, you will learn how to create and set up Exchange Database Availability Groups 2019 with the web interface and with PowerShell. You’ll also learn how to add member servers and join a database to the group.

Database Availability Groups, overview
Database Availability Groups, overview

Prerequisites

This tutorial will be hands-on and will require an existing environment to follow along. To ensure your environment matches the tutorial, ensure that:

  • Two servers are running Exchange Server 2019.
  • All Exchange servers are running the same version of Microsoft Exchange. Mixing versions is not supported. This tutorial will use two servers running on Windows Server 2019 Standard Edition and Exchange Server 2019 called Ex01 and Ex02.
  • A Windows Server 2016+ that will act as the Witness Server. This tutorial will be assigning a server called FS01 as the witness server.

If you have an odd number of Exchange nodes you will not need a witness server. The cluster will be using Node majority.

Configuring the Witness Server

Before you can create Exchange Database Availability Groups with an even number of nodes, you first need a witness server. The witness server hosts a folder that all members of the Exchange Trusted Subsystem AD Universal group access. The witness server is used to achieve the voting majority and maintain the quorum.

You can read more about witness servers and how they work within availability groups in Microsoft’s documentation.

While on the FS01 server:

First, add the Exchange Trusted Subsystem AD group to the local Administrators group. The Exchange Trusted Subsystem AD group is a high-privilege AD Group that has full access to all Exchange related objects

Adding the Exchange Trusted SubSystem to the Local Administrators group.

Then, create a new folder and name it something relevant such as C:\DAGWitness.

That’s it for the configuration on the witness server.

Configuring a Database Availability Group with Exchange Admin Center

Let’s now get down to actually creating a Exchange database availability groups!

  1. Open up The Exchange Admin Center on EX01 by going to https:///EX01/ecp. EX01 is one of the mailbox server’s that the tutorial is using.

2. Once in the Exchange Admin Center, click on servers —> database availability groups as shown below.

Database Availability Groups
Database Availability Groups

3. Click on the + sign and you will see the following dialog. Ensure you fill in each of the below required fields.

  • Exchange Database Availability Groups name – This is the name for the group. It will be the name used to manage and communicate with the DAG.

The group name cannot exceed 15 characters.

  • Witness server – The name of the server hosting the witness folder. In this tutorial’s case, the server is FS01.
  • Witness directory – The path literal path to for the directory created.

Always use the local path and not a UNC path for the Witness directory.

  • Exchange Database Availability Groups IP addresses – The IP address which will be assigned to the DAG.
Exchange Database Availability Groups
Exchange Database Availability Groups : DAG required parameters

4. Once you’ve filled in all of the required fields, click on Save to create the group.

If you run into any problems at this stage, be sure to refer to the Troubleshooting section below.

Adding a Member Server to the Database Availability Group

Exchange Database Availability Groups are created but it’s not doing much good until you add some nodes (member servers) to it. To do that, while still in the Exchange Admin Center:

  1. Click on the newly created group and click the Manage DAG membership icon as shown below.
Adding members to the DAG
Adding members to the DAG

2. Next, add the member servers needed. For this tutorial, add EX01 and EX02 and click Save.

When you’ve added the member servers, a wizard will proceed in installing and configuring the Windows Failover Cluster on the nodes.

Adding members to the DAG progress
Adding members to the DAG progress

Building the cluster can take some time, so feel free and get a cup of coffee.

If everything worked, you should now see the member servers assigned to the group as shown below.

Servers are added to the DAG as members
Servers are added to the DAG as members

The database availability group is now ready. At this time, you can add mailbox databases to the group.

Adding a Mailbox Database

Once you have the group created and the member servers added, it’s time to add a mailbox database. While still in Exchange Admin Center:

  1. Navigate to servers —> databases.

2. Click on the database that you would like to join to the DAG and click on Add database copy. This tutorial has two mailboxes databases called EX01-DB and EX02-DB. A popup will ask you to specify the mailbox server that will host an additional copy of the selected mailbox database.

Adding Database to DAG
Adding Database to DAG

3. Click on Browse and select the desired server from the list and click on OK —> Save

Selecting the additional server which will host a copy of the mailbox database
Selecting the additional server which will host a copy of the mailbox database

The seeding process will be triggered and start copying the database to the destination selected server.

The process of initially adding a mailbox to the group is called seeding. Seeding is the process of copying the database from one server to another. The Seeding operation is a server resource-intensive, so plan it on non-busy days

Seeding process

4. Now confirm that this database is now hosted on EX01 and EX02 by clicking on the databases tab. Notice below that the database below is now on SERVERS WITH COPIES.

You will also notice the ACTIVE ON SERVER. For this tutorial, the database EX01-DB is currently activated and mounted on the EX01 server.

EX01-DB is now hosted on both EX01 and EX02
EX01-DB is now hosted on both EX01 and EX02

Its recommended to have the volume formatted using GPT not MBR as it can extend beyond Two TB, but if you stuck with this limitation and want to convert it to GPT without losing data, a conversion from MBR to GPT is possible third-party tools, Read more about GPTGen at PowershellCenter.com.

Configuring a Database Availability Group with PowerShell

As an alternative method (and to save some time), you can also perform all of the aforementioned steps to create and configure a database availability group with PowerShell! Let’s see how.

While logged onto any Exchange Server:

  1. Open the Exchange Management Shell and the following command. This command creates a database availability group:
  • With the name of DAG.
  • Using a witness server called FS01.
  • Using a pre-created folder called C:\DAGWitness on the witness server.
  • Assigning the DAG 192.168.100.10 as an IP Address.
New-DatabaseAvailabilityGroup -Name DAG -WitnessServer FS01 -WitnessDirectory C:\DAGWitness -DatabaseAvailabilityGroupIPAddresses '192.168.100.10’

Once complete, you should see the following output.

Creating DAG using Powershell
Creating DAG using Powershell

If you run into any problems at this stage, be sure to refer to the Troubleshooting section below.

2. Next, use the Add-DatabaseAvailabilityGroupServer cmdlet to add the member servers to the Exchange database availability groups. Below is an example you can use to find all Exchange servers using Get-ExchangeServer and add them all to the database availability group called DAG.

Get-ExchangeServer | Add-DatabaseAvailabilityGroupServer -Identity DAG 

Alternatively, you could add each member server one at a time using the MailboxServer parameter as shown below.

Add-DatabaseAvailabilityGroupServer -Identity DAG –MailboxServer EX01

Now verify the member servers have been added using the Get-DatabaseAvailabiltyGroup cmdlet. If all is well, you should see all member servers in the Member Servers column as shown below.

Members of the DAG
Members of the DAG

4. Next, add the mailbox database to the database availability group using the Add-MailboxDatabaseCopy cmdlet. The below command adds the EX01-DB database that’s hosted on EX01 to EX02 to allow EX02 to hope an additional copy of the database.

Add-MailboxDatabaseCopy -Identity EX01-DB -MailboxServer EX02

5. Restart the Microsoft Exchange Information Store ****service on the destination server.

Finally, run the Get-MailboxDatabaseCopyStatus command to confirm the mailbox was added successfully. If all goes well, you should see an output like below.

The Database is added
The Database is added

Notice that one database is Mounted and the other is Healthy. The Mounted database is the copy serving the users and the Healthy database is the standby copy., Exchange can activate the standby copy should the Mounted copy run into problems.

Troubleshooting

During the database availability group configuration, you may run into a few different problems. If so, refer to the following common troubleshooting steps.

Always check Windows Event log first as it have more information about the root cause and why things are not working as should.

IPv6 is Enabled…

The error Windows Failover Clustering isn’t installed on… is one of the common error messages you will see.

A server-side database availability group administrative operation failed. Error The operation failed. 
CreateCluster errors may result from incorrectly configured static addresses. 
Error: Windows Failover Clustering isn't installed on 'EX01'’.

If you encounter this problem, disable IPv6 by creating a new 32-bit DWORD registry value called DisabledComponents under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters and give it the value of ffffffff. Once complete, restart the server.

CreateCluster() failed with 0x5. Error: Access is denied

You might encounter another common problem that’s caused by a permission problem.

A server-side database availability group administrative operation failed. Error The operation failed. CreateCluster
errors may result from incorrectly configured static addresses. Error: An error occurred while attempting a cluster
operation. Error: Cluster API failed: "CreateCluster() failed with 0x5. Error: Access is denied". [Server:EX01.test.local]

To fix this problem, disable the database availability group AD computer object and make sure the Exchange Trusted Subsystem AD group is granted Full Control of the AD object as shown below.

Adding Exchange Trusted SubSystem group

Next Steps

Take a look at how to get Mailbox Database and perform some action, such as Move, Mount, and repair it using Get-MailboxDatabase and Other Cmdlet.

Also, import PST to Outlook in multiple ways on How to Import a PST into Outlook

Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.

Explore ATA Guidebooks

Looks like you're offline!