📜 ⬆️ ⬇️

Creating a DAG Cluster on Mailbox Exchange Servers

This article discusses Exchange 2010 servers with the Mailbox role (hereinafter I will write a mailbox server). The Database Availability Group DAG cluster is built on Exchange servers with this role, in my case other Hub Transport roles, Client Access, Edge are not installed on these servers, other servers are used for these roles.

The architecture is as follows:

image
')
The article discusses only setting up a single DAG cluster for servers that are located in different data centers (DC01 and DC02) - this is necessary for fault tolerance when one of the data centers fails (the circuit is also realizable in a single DC).



1) On all mailbox servers, you need to connect additional network drives, preferably via iSCSI (FC also comes down). All bases will be stored on them.
This is done for fault tolerance.

2) You need to go to the mailbox server and run the Exchange management console from under the Administrator (Run as ....).

image

3) Creating a new DAG cluster is done by the command

New-DatabaseAvailabilityGroup -Name DAG1 -WitnessServer MSK02-PT-HCA01 -WitnessDirectory E: \ DAG1

Where the following parameters are used:

-Name is the name of the DAG cluster
- WitnessServer - indicates the name of the server that will be used as a quorum witness with an even number of members of the accessibility group. The selected server cannot be a member of the database availability group configured with it. If the WitnessServer parameter is not specified, an attempt will be made to automatically select the Hub Transport server as the witness server without the Mailbox server role located in the Active Directory database availability group site. Usually one of the HCA servers is used.
- WitnessDirectory - specifies the name of the directory on the witness server that is used to store the data file of the witness. The directory and file share must be located on an Exchange server other than the mailbox servers that are in the availability group. This allows the Exchange administrator to control the directory. The specified directory should not be used by other availability groups for purposes other than the witness server function. If this parameter is not specified, the default witness directory will be used.

image

<I’ll add that it is desirable to give an IP address for the DAG cluster, for this purpose use the key - DatabaseAvailabilityGroupIpAddresses >

Whether a cluster has been created can be checked using the Get-DatabaseAvailabilityGroup command:

image

You can see that the network has 2 clusters.
One has already added 2 servers (it was created earlier), in the second there are no servers added yet.

4) Next, be sure to add an alternative quorum for the DAG cluster. This is done through cluster changes:

Set-DatabaseAvailabilityGroup -Identity DAG1T -AlternateWitnessServer MSK01-PT-HCA01 -AlternateWitnessDirectory C: \ DAG1W

Accordingly, an alternative quorum will be created (if the primary is unavailable) on the MSK01-PT-HCA01 server in another site.

5) To add servers to the cluster, use the command:

Add-DatabaseAvailabilityGroupServer -Identity DAG1T -MailboxServer MSK01-PT-MB01

Where keys are used:

-Identity — Specifies the name of the DAG to which the server is being added.
-MailboxServer — Specifies the name of the mailbox server being added to the database availability group.
To begin, select the DAG cluster we need with the command:
Get-DatabaseAvaialbilityGroup |? {$ _. name-like "* DAG1T *"}

image

The console will display a cluster matching the request. Accordingly, it will be possible not to enter the –Identity parameter (mandatory).

Enter the command to add a server to the cluster:

Get-DatabaseAvailabilityGroup |? {$ _. name-like "* DAG1T *"} | Add-DatabaseAvailabilityGroupServer -MailboxServer MSK01-PT-MB01

image

And similarly for MSK01-PT-MB02

Get-DatabaseAvailabilityGroup |? {$ _. name-like "* DAG1T *"} | Add-DatabaseAvailabilityGroupServer -MailboxServer MSK01-PT-MB02


6) We need to create a new database for this, we will execute the command:

New-MailboxDatabase -Name "MBX1" -EdbFilePath E: \ DatabaseFiles \ MBX1.edb


Where are the following keys:

-Name - the name of the mailbox database
-EdbFilePath - the path where it will be stored
The server will ask for data on which server to put this database.

image

Choose server MSK01-PT-MB01

7) To create a database on the server, you need to mount it.

image

8) Next, you need to add a copy of the database to the server MSK01-PT-MB02, with the command:

Add-MailboxDatabaseCopy -Identity MBX1 -MailboxServer MSK01-PT-MB02


image

It is necessary to check the status, enter the command:

Get-MailboxServer | Get-MailboxDatabaseCopyStatus


The command will display all copies of databases on all servers. And we will see the following:

image

MBX1 base is sorted on MSK01-PT-MB01 and in the wait status on server MSK01-PT-MB02.

9) To add a server cluster from another site to DAG - you need to register the networks of this site in the cluster settings with the command:

Set-DatabaseAvailabilityGroupNetwork -Subnets 10.103.103.0/24 -ReplicationEnabled: $ true


The console will ask for the Identity parameter - enter the name of the cluster DAG1T
Similarly, add the second network:

Set-DatabaseAvailabilityGroupNetwork -Subnets 192.168.22.0/24 -ReplicationEnabled: $ true


You can check that networks are added either through the command:

Get-DatabaseAvailabilityGroupNetwork


And you can see in the properties of the cluster:

image

10) Now you can add a server cluster from another subnet to DAG.

Add-DatabaseAvailabilityGroupServer -MailboxServer MSK02-PT-MB03
Add-DatabaseAvailabilityGroupServer -MailboxServer MSK02-PT-MB04

11) Next, you need to add copies of the database to all members of the DAG cluster.

Add-MailboxDatabaseCopy -MailboxServer MSK02-PT-MB04


The console requests Identity - we enter the appropriate database (in our case, MBX1) - then similarly with MBX2).

12) In the end, all servers should have the following:

MSK01-PT-MBX01 - MBX1 Mounted and MBX2 Standby
MSK01-PT-MBX02 - MBX1 wait and MBX2 wait
MSK02-PT-MBX03 - MBX1 Standby and MBX2 Mounted
MSK02-PT-MBX04 - MBX1 Wait and MBX2 Wait

image

Those. we have 1 active copy on each of the servers in different data centers.

13) Prioritization of the DAG cluster.

In order to make a priority for activating database copies, enter the following command:

Set-MailboxDatabaseCopy -Identity MBX1 \ MSK01-PT-MB01 -ActivationPreference 1

Where 2 parameters are specified: 1) database name \ server name 2) cost, where 1 is the highest value

Used by:

1) Technet section "Exchange 2010 cmdlets"
technet.microsoft.com/ru-ru/library/bb124413.aspx

2) MSExchange
www.msexchange.org/articles_tutorials/exchange-server-2010/high-availability-recovery/uncovering-exchange-2010-database-availability-groups-dags-part1.html

Source: https://habr.com/ru/post/139591/


All Articles