If you have a highly-available Microsoft Exchange environment, you have at least one Exchange database availability group. 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 database availability groups in Exchange 2019 with the web interface and with PowerShell. You’ll also learn how to add member servers and join a database to the group.
Table of Contents
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.
- All servers must be joined to an Active Directory (AD) domain.
- The user should be at least a member of the Organization Management and Database Availability Group Role. A complete reference on the required permission on Microsoft.com
Configuring the Witness Server
Before you can create a database availability group 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
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 an Exchange database availability group!
- 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.
3. Click on the + sign and you will see the following dialog. Ensure you fill in each of the below required fields.
- Database availability group 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.
- Database availability group IP addresses – The IP address which will be assigned to the DAG.
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
The database availability group is 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:
- Click on the newly created group and click the Manage DAG membership icon as shown below.
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.
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.
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:
- 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.
3. Click on Browse and select the desired server from the list and click on OK —> Save
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
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.
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:
- 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.
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 database availability group. 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.
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.
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.
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.
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
More from Adam The Automator & Friends