Sunday 1 March 2015

Setting up a basic Database Availabilty Group (DAG) with Exchange 2013

In order to create a DAG we will assume the current environment is setup:

x 2 2012 R2 Exchange MBOX/CAS Server (MBOXCAS01, MBOXCAS02)
x 1 2012 R2 File Server (FS01)



We will setup a share on FS01 called "QUORUM" - now this will be used as the File Share Witness for the DAG ** Note that you NEED a file share witness even if you have an odd number of members in the DAG! ** If the FS01 is not an Exchange server member we will also have to make the local "Administrators" group on FS01 a member of the "Exchange Trusted Subsystem" security group as well. Otherwise you will get an error as follows while attempting to create the DAG:


* Note: When choosing the IP address(es) for the DAG cluster ideally you should have a dedicated network for this (that it only available between the nodes in the cluster. You can then separate cluster traffic from other traffic e.g. MAPI etc.)




"The Exchange Trusted Subsystem is not a member of the local Administrators group on specified witness server dlab-dc01.dlab.xyz. Error: Access is denied."





Now because we are using 2012 R2 we will also need to create a CNO (Cluster Name Object) in AD - to do this simply create a computer account AD - lets say for example under the Computers container and then DISABLE the account.



We can now create the DAG by going to ECP > Servers > Database Availability Groups > New DAG.



Entering in the following:
- Database Availability Group Name: This is how your DAG will be identified - it should match the CNO you created earlier!
- Witness Server: This is the server with the file share witness on e.g.: FS01.mydomain.com
- Witness Directory: This is specifically where you created the share on the filesystem
- Database availability group IP addresses: Here you will add all of the IP address of which will be used to access the DAG



Now we will use the Exchange Shell (as it is not supported in ECP) to add members to the DAG:
Add-DatabaseAvailabilityGroupServer -Identity DLABDAG -MailboxServer MBOXCAS02
Add-DatabaseAvailabilityGroupServer -Identity DLABDAG -MailboxServer MBOXCAS01
And then we will add a mailbox database copy of MBOXCAS01 to MBOXCAS02:
Add-MailboxDatabaseCopy -Identity "Mailbox Database 0001" -MailboxServer MBOXCAS02 -ActivationPreference 2
Finally hit save and test the DAG with the following cmdlets:
Get-MailboxDatabaseCopyStatus
Test-ReplicationHealth
We can view the members of a specific DAG with:
Get-DatabaseAvailabilityGroup -Identity <dag-name>
We can check the health of the replication within a DAG with:
Test-ReplicationHealth
We will setup mailbox database replicaton between the two servers:
Add-MailboxDatabaseCopy
Add-MailboxDatabaseCopy -Identity <MailboxDatabase> -MailboxServer <MailboxServer> -ReplayLagTime 00:10:00 -TruncationLagTime
00:15:00 -ActivationPreference 2
This will add a mailbox database copy to the specified mailbox server, with a 15 minute delay of replaying logs to the database and
the trancation lag time (which is the time limit of when the logs will be purged.) is set to 10 minutes.
We can also check to see which mailbox server is active or passive:
Get-MailboxDatabaseCopyStatus -Identity <MailboxDatabase> | FL *ActiveDatabaseCopy*

0 comments:

Post a Comment