[Step By Step] Exchange Server 2010: Creating a DAG + Failover and Switchover Simulation

Hello, friends! This time I bring you a tutorial that details the creation of a DAG in Exchange Server 2010, creating database copies and verifying the platform's high availability (switchover and failover). I hope it is useful to you. Cont

AI-assisted translation, approved by Mateo.

Hello, friends! This time I bring you a tutorial that details the creation of a DAG in Exchange Server 2010, creating database copies and verifying the platform's high availability (switchover and failover). I hope it is useful to you.

Contents

  • Objective
  • Scope
  • Introduction
  • Creating a DAG in Exchange Server 2010
  • Adding database copies
  • Database switchover
  • Database failover: ServiceDown Simulation

Objective

The objective of this article is to detail the steps required to create and configure a DAG in Exchange Server 2010. After the DAG is created, the high availability it provides (Failover and Switchover) will be tested.

Scope

The scope of this article is:
  • Creating a DAG in Exchange Server 2010.
  • Configuring 2 servers in the DAG.
  • Adding 2 databases to the DAG.
  • High Availability test.

Introduction

What is a DAG? A DAG (Database Availability Group), or database availability group, is a core high-availability component in Exchange Server 2010. A DAG is a group of Mailbox Servers that provide automatic recovery at the database level for failures affecting an entire server or a particular database. It can also be identified as a database replication boundary, including their failover and switchover (this is done through a component called Active Manager, which manages and controls these processes). This post details how to create a DAG with 2 Exchange Server 2010 Mailbox servers and 2 databases, perform the required basic configurations, add database copies, and finally simulate a Switchover and a Failover to verify how databases behave under high availability.

Creating a DAG in Exchange Server 2010

We will create the DAG through the EMC console:
  • Go to Organization Configuration>Mailbox>Database Availability Groups. Then right-click and select “New Database Availability Group” (we can also access it from the action pane):
Picture1
  • The DAG creation wizard will open. We will specify the name and leave the Witness Server and Directory options unchecked. We must do this if there is a server in the Exchange organization with the Hub Transport role and without the Mailbox role, since Exchange will automatically use this Hub Transport server as the Witness Server and automatically create the Witness Directory. If the Witness server to be configured is not an Exchange 2010 server (having configured it manually), the global security group “Exchange Trusted Subsystem” must be added to the local administrators group on the witness server.
Picture2
  • The DAG creation wizard will finish, and we can verify that it was created successfully:
Picture3
  • Right-click the DAG object and go to Properties. Here we can verify that the Witness Server and Witness Directory were configured (in this case, the Exchange server in the organization without the Mailbox role and with the Hub Transport role was configured).
Picture4
  • Now, it is necessary to configure an IP Address for the DAG. Go to the IP Addresses tab. Then click Add.
Picture5
  • And assign it an IP within the DAG MAPI network.
Picture6 NOTE: this lab used only one network (with only one network adapter per server) for MAPI and replication traffic. In a production environment, it is recommended to use a MAPI network and a network for DAG replication.
  • Now, we will use the Add-DatabaseAvailabilityGroupServer command to add 2 servers with the Mailbox role to DAG01.
    • The EXC-SVR-01 and EXC-SVR-02 servers will be added to DAG01.
Picture7 Picture8 After adding the servers, in EMC>Organization Configuration>Mailbox>Database Availability Group, by selecting DAG01, we can see the automatically created network, where replication is enabled and 2 network interfaces are visible (those of the 2 servers in the DAG). Picture9

Adding database copies

Having created the DAG and added the EXC-SVR-01 and EXC-SVR-02 servers, we can begin to use it. To do so, we will add database copies to DB01 (mounted on the EXC-SVR-01 server) and DB02 (mounted on the EXC-SVR-02 server). What is a database copy? A DAG works in such a way that databases can be on 1 or more Mailbox servers (in this case, in DAG01), either active or passive. However, only one active copy of the databases can exist, so the other copies (on one or more servers in the DAG) become passive copies. This passive copy will be kept up to date through database replication, where logs will be copied and committed to the passive database, thus preventing data loss in the event of a failover or switchover. To create copies of a database within the DAG, we can use the EMC or the EMS. Below I will show you how to do it both ways:
  • We add a database copy through the EMC:
    • Go to: Organization Configuration>Mailbox. Right-click the database for which we want to create a copy and start the Add Mailbox Database Copy… wizard.
Picture10
  • The wizard to add a database copy will start. Here we must choose the server where we will create the copy and the activation preference order (in this case, because we have only 2 copies, it will automatically be configured as second in activation preference).
Picture11
  • This will complete the wizard, adding the database copy.
Picture12
  • We verify that the DB01 database copy was added.
Picture13
  • Now we will add a copy of the DB02 database through EMS:
    • We will use the Add-MailboxDatabaseCopy command:
Picture14
  • After this command is executed, we can verify that the DB02 database copy was created on the EXC-SVR-01 server:
Picture15 We can verify the database connections: Picture16 And we can verify the status of the database copies: Picture17

Database switchover

We can perform a database switchover to its passive copies, causing the database to become active (mounted) in one of its copies. In this case, we will perform the switchover of the DB01 database:
  •  Before doing so, it is necessary to verify that the ContentIndex status is Healthy in all copies. To verify this, we will run the Get-MailboxDatabaseCopyStatus * command.
Picture18
  • If the ContentIndex status appears as Failed in any of the copies, we can use this command to regenerate it:
Get-MailboxDatabaseCopyStatus | where {$_.contentindexstate -eq "failed"} | Update-MailboxDatabaseCopy -CatalogOnly NOTE: this command must be run on the server where the database copy has a Failed ContentIndex status
  • After verifying the ContentIndex status, we can perform the database switchover. In Organization Configuration>Mailbox, right-click the database we want to move and start the wizard to move the active database copy:
Picture19
  • The wizard will start, where we will first select the server to which we will move the active copy and select Lossless as the database mount dial settings:
Picture20
  • After this, the move will run and the wizard will finish:
Picture21
  • Finally, we verify that the database copy is active and mounted on the EXC-SVR-02 server:
Picture22

Database failover: ServiceDown Simulation

Now we will simulate a Failover in the previously created “DAG01” DAG. What is a Failover? It is an operational Backup mode in which the functions of a system are assumed by a secondary system component when a primary component fails or becomes inaccessible. In the case of an Exchange 2010 DAG, a failover occurs when:
  • MAPI Network Down: A server is disconnected or experiences failures in the MAPI network connection (it cannot participate in DAG operations
  • Node Down: a server cannot participate in DAG operations but remains enabled on the MAPI network.
In this case, we will simulate a MAPI network outage on the EXC-SVR-02 server, where the DB01 and DB02 databases are mounted:
  • We will simulate the EXC-SVR-02 server outage by disabling the network adapter:
Picture23
  • After disabling the network adapter, we can check the Service Down progress on the EXC-SVR-02 node and the automatic mounting of the databases on the EXC-SVR-02 server through the Get-MailboxDatabaseCopyStatus * cmdlet (in a DAG with more active copies of the databases, database copies will be activated depending on activation preference).
Picture24
  • After this process, we can verify that the databases are mounted on the EXC-SVR-01 server (the only active DAG node) and that the status of the copies on the EXC-SVR-02 server is currently ServiceDown.
Impact of a failover in a production DAG: the impact will be a small service disruption for end users (Outlook and OWA), and some data loss may occur in log transactions. Normally, log loss does not occur, but it is possible. Then, when the failed node comes back up, we can remount the databases on it if the database copies are in a Healthy state.

Thanks for reading. The learning continues in the next article.