• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
OpenTechTips

OpenTechTips

Comprehensive IT Guides for Pros and Enthusiasts

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE
Home » How to Create an Exchange 2019 Database Availability Group

How to Create an Exchange 2019 Database Availability Group

May 7, 2020 - by Zsolt Agoston - last edited on May 10, 2020

It this article we'll create basic, single site Exchange 2019 DAG (Database Availability Group). We already installed two mailbox servers with the same specifications (detailed here).

Each of them has a single database configured already, MAIL has DB01 and MAIL2 has DB02.

Important: the databases on both future DAG members need to be stored in the same folder location. In our case it is C:\ExchangeDatabases (database move steps here).

To create the DAG we also need a witness server that will be the tie-breaker in a failover situation. The witness is a regular file server, with simply a dedicated shared directory that all members can access.

1. Add the Exchange Trusted Subsystem to the local admin group on the witness server

First we need to make sure the Exchange servers will have read-write access on the witness server. To achieve that, we add the "Exchange Trusted Subsystem" domain group to the local admin group on the witness.

How to Create an Exchange 2019 Database Availability Group
How to Create an Exchange 2019 Database Availability Group

1.5 Install the File Server role on the witness server

Make sure the File Server role is installed on the witness, otherwise you'll receive the following error message after creating the DAG

PS C:\> Install-WindowsFeature FS-FileServer
How to Create an Exchange 2019 Database Availability Group

2. Create the DAG

To create the database availability group, we connect to one of the Exchange servers (guide here), and issue the following command. We specify the DAG name, the witness server and the directory on the witness server that will contain the file share witness data files.

PS C:\> New-DatabaseAvailabilityGroup -Name DAG1 -WitnessServer WITNESS.alwayshotcafe.com -WitnessDirectory "C:\DAGWitness"
How to Create an Exchange 2019 Database Availability Group

2.5 Set DAC on the DAG

DAC stands for Datacenter Activation Coordination, it is to prevent split-brain situation to occur. Generally it's a good idea to have it enabled on DAGs by default.

PS C:\> Set-DatabaseAvailabilityGroup -Identity DAG1 -DatacenterActivationMode DagOnly

3. Add the mailbox servers to the DAG

To add the member servers to the DAG we issue the following commands in the same PS window:

PS C:\> Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MAIL
PS C:\> Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MAIL2
How to Create an Exchange 2019 Database Availability Group

If you get the following error messages, that is because RSAT tools were not installed before and a reboot is needed to install the failover cluster feature and proceed with the setup. Reboot the mail servers
How to Create an Exchange 2019 Database Availability Group

4. Add database copies to the mailbox server

At this point we have a working DAG, with all member servers hosting their only databases. The whole purpose of the DAG is to have passive copies of the databases on the other server, so if one box goes down, both the databases stay available.

MAIL has DB01, MAIL2 hosts DB02. We add a passive copy of their databases to the other server: a copy of DB02 to MAIL and DB01 to MAIL2

PS C:\> Add-MailboxDatabaseCopy -Identity DB01 -MailboxServer MAIL2
PS C:\> Add-MailboxDatabaseCopy -Identity DB02 -MailboxServer MAIL
How to Create an Exchange 2019 Database Availability Group

5. Aftermath

After the DAG is created we can verify it's functional

PS C:\> Get-DatabaseAvailabilityGroup DAG1

Name             Member Servers                                      Operational Servers
----             --------------                                      -------------------
DAG1             {MAIL2, MAIL}
PS C:\> Get-MailboxDatabaseCopyStatus -Server MAIL | ft -AutoSize

Name      Status  CopyQueueLength ReplayQueueLength LastInspectedLogTime ContentIndexState
----      ------  --------------- ----------------- -------------------- -----------------
DB01\MAIL Mounted 0               0                                      NotApplicable
DB02\MAIL Healthy 0               0                 07/05/2020 17:31:02  NotApplicable


PS C:\> Get-MailboxDatabaseCopyStatus -Server MAIL2 | ft -AutoSize

Name       Status  CopyQueueLength ReplayQueueLength LastInspectedLogTime ContentIndexState
----       ------  --------------- ----------------- -------------------- -----------------
DB02\MAIL2 Mounted 0               0                                      NotApplicable
DB01\MAIL2 Healthy 0               0                 07/05/2020 17:46:38  NotApplicable

On the witness the witness directory is populated as expected

How to Create an Exchange 2019 Database Availability Group

Reader Interactions

Comments Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tools

Secondary Sidebar

CONTENTS

  • 1. Add the Exchange Trusted Subsystem to the local admin group on the witness server
  • 1.5 Install the File Server role on the witness server
  • 2. Create the DAG
  • 2.5 Set DAC on the DAG
  • 3. Add the mailbox servers to the DAG
  • 4. Add database copies to the mailbox server
  • 5. Aftermath

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}