Creating a DAG Cluster on Mailbox Exchange Servers
This article discusses Exchange 2010 servers with the Mailbox role (I will continue to write a mailbox server). The DAG (Database Availability Group) cluster is built on Exchange servers with this role, in my case, other Hub Transport, Client Access, Edge roles are not installed on these servers - other servers are used for these roles.
The architecture scheme is as follows:
The article only considers the configuration of one DAG cluster for servers located in different data centers (DC01 and DC02) - this is necessary for fault tolerance in the event of failure of one of the data centers (the scheme is also possible in a single DC).
1) On all mailbox servers it is necessary to connect additional network drives, preferably via ISCSI (FC will work too). All databases will be stored on them.
This is made for fault tolerance.
2) You need to go to the mailbox server and start the Exchange management console from under the Administrator (Run as ....).
3) Creating a new DAG cluster is carried out by the command
New-DatabaseAvailabilityGroup -Name DAG1 -WitnessServer MSK02-PT-HCA01 -WitnessDirectory E: \ DAG1
Where the following parameters are used:
-Name - 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 availability group. The selected server cannot be a member of the database availability group configured using 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 role of the Mailbox server located in the Active Directory database availability group site. Usually some HCA server is used.
- WitnessDirectory - indicates the name of the directory on the witness server, which is used to store the data of the witness file resource. The directory and file resource 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, then the default tracking directory will be used.
<I’ll add that it’s also desirable to give an IP address for the DAG cluster, for this use the key - DatabaseAvailabilityGroupIpAddresses >
You can check whether the cluster was created using the Get-DatabaseAvailabilityGroup command:
You can see that there are 2 clusters in the network.
Two servers have already been added to one (it was created earlier), while the second has no added servers 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 main one is unavailable) on the server MSK01-PT-HCA01 in another site.
5) To add a server to the cluster, we use the command:
Add-DatabaseAvailabilityGroupServer -Identity DAG1T -MailboxServer MSK01-PT-MB01
Where the keys are used:
-Identity - indicates the name of the DAG to which the server is added.
-MailboxServer - Specifies the name of the Mailbox server to be added to the database availability group.
First, select the DAG cluster we need with the command:
Get-DatabaseAvaialbilityGroup |? {$ _. name -like "* DAG1T *"}
The console will return a cluster matching the request. Accordingly, it will be possible not to enter the –Identity parameter (required).
Enter the command to add the server to the cluster:
Get-DatabaseAvailabilityGroup |? {$ _. name -like "* DAG1T *"} | Add-DatabaseAvailabilityGroupServer -MailboxServer MSK01-PT-MB01
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 execute the command:
New-MailboxDatabase -Name "MBX1" -EdbFilePath E: \ DatabaseFiles \ MBX1.edb
Where are the following keys:
-Name is the name of the mailbox database
-EdbFilePath is the path where it will be stored
The server will ask for data on which server to put this database
Select server MSK01 -PT-MB01
7) On the server to create a base, you must mount it.
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 You
need to check the status, enter the command:
Get-MailboxServer | Get-MailboxDatabaseCopyStatus
The command displays all copies of the databases on all servers. And we will see the following:
The base MBX1 is sorted on MSK01-PT-MB01 and in standby status on server MSK01-PT-MB02.
9) To add a server cluster to a DAG from another site, 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 you to enter the Identity parameter - enter the cluster name DAG1T
Similarly, add the second network:
Set-DatabaseAvailabilityGroupNetwork -Subnets 192.168.22.0/24 -ReplicationEnabled: $ true
You can verify that the networks are added either through the command:
Get-DatabaseAvailabilityGroupNetwork
And you can see in the cluster properties:
10) Now you can add a server cluster to the DAG from a different subnet.
Add-DatabaseAvailabilityGroupServer -MailboxServer MSK02-PT-MB03
Add-DatabaseAvailabilityGroupServer -MailboxServer MSK02-PT-MB04
11) Next, add database copies to all members of the DAG cluster.
Add-MailboxDatabaseCopy -MailboxServer MSK02-PT-MB04
The console asks for Identity - enter the appropriate database (in our case MBX1) - then similarly with MBX2).
12) As a result, all servers should have the following:
MSK01-PT-MBX01 - mounted MBX1 and wait MBX2
MSK01-PT-MBX02 - wait MBX1 and wait MBX2
MSK02-PT-MBX03 - wait MBX1 and mounted MBX2
MSK02-PT-MBX04 - waiting for MBX1 and waiting for MBX2
i.e. we have 1 active copy on each of the servers in different data centers.
13) Prioritization of the DAG cluster.
In order to give priority to activating database copies, you must 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 - highest value
Used by:
1) Technet section "Exchange 2010 Cmdlets"
technet.microsoft.com/en-us/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
The architecture scheme is as follows:
The article only considers the configuration of one DAG cluster for servers located in different data centers (DC01 and DC02) - this is necessary for fault tolerance in the event of failure of one of the data centers (the scheme is also possible in a single DC).
1) On all mailbox servers it is necessary to connect additional network drives, preferably via ISCSI (FC will work too). All databases will be stored on them.
This is made for fault tolerance.
2) You need to go to the mailbox server and start the Exchange management console from under the Administrator (Run as ....).
3) Creating a new DAG cluster is carried out by the command
New-DatabaseAvailabilityGroup -Name DAG1 -WitnessServer MSK02-PT-HCA01 -WitnessDirectory E: \ DAG1
Where the following parameters are used:
-Name - 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 availability group. The selected server cannot be a member of the database availability group configured using 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 role of the Mailbox server located in the Active Directory database availability group site. Usually some HCA server is used.
- WitnessDirectory - indicates the name of the directory on the witness server, which is used to store the data of the witness file resource. The directory and file resource 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, then the default tracking directory will be used.
<I’ll add that it’s also desirable to give an IP address for the DAG cluster, for this use the key - DatabaseAvailabilityGroupIpAddresses >
You can check whether the cluster was created using the Get-DatabaseAvailabilityGroup command:
You can see that there are 2 clusters in the network.
Two servers have already been added to one (it was created earlier), while the second has no added servers 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 main one is unavailable) on the server MSK01-PT-HCA01 in another site.
5) To add a server to the cluster, we use the command:
Add-DatabaseAvailabilityGroupServer -Identity DAG1T -MailboxServer MSK01-PT-MB01
Where the keys are used:
-Identity - indicates the name of the DAG to which the server is added.
-MailboxServer - Specifies the name of the Mailbox server to be added to the database availability group.
First, select the DAG cluster we need with the command:
Get-DatabaseAvaialbilityGroup |? {$ _. name -like "* DAG1T *"}
The console will return a cluster matching the request. Accordingly, it will be possible not to enter the –Identity parameter (required).
Enter the command to add the server to the cluster:
Get-DatabaseAvailabilityGroup |? {$ _. name -like "* DAG1T *"} | Add-DatabaseAvailabilityGroupServer -MailboxServer MSK01-PT-MB01
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 execute the command:
New-MailboxDatabase -Name "MBX1" -EdbFilePath E: \ DatabaseFiles \ MBX1.edb
Where are the following keys:
-Name is the name of the mailbox database
-EdbFilePath is the path where it will be stored
The server will ask for data on which server to put this database
Select server MSK01 -PT-MB01
7) On the server to create a base, you must mount it.
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 You
need to check the status, enter the command:
Get-MailboxServer | Get-MailboxDatabaseCopyStatus
The command displays all copies of the databases on all servers. And we will see the following:
The base MBX1 is sorted on MSK01-PT-MB01 and in standby status on server MSK01-PT-MB02.
9) To add a server cluster to a DAG from another site, 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 you to enter the Identity parameter - enter the cluster name DAG1T
Similarly, add the second network:
Set-DatabaseAvailabilityGroupNetwork -Subnets 192.168.22.0/24 -ReplicationEnabled: $ true
You can verify that the networks are added either through the command:
Get-DatabaseAvailabilityGroupNetwork
And you can see in the cluster properties:
10) Now you can add a server cluster to the DAG from a different subnet.
Add-DatabaseAvailabilityGroupServer -MailboxServer MSK02-PT-MB03
Add-DatabaseAvailabilityGroupServer -MailboxServer MSK02-PT-MB04
11) Next, add database copies to all members of the DAG cluster.
Add-MailboxDatabaseCopy -MailboxServer MSK02-PT-MB04
The console asks for Identity - enter the appropriate database (in our case MBX1) - then similarly with MBX2).
12) As a result, all servers should have the following:
MSK01-PT-MBX01 - mounted MBX1 and wait MBX2
MSK01-PT-MBX02 - wait MBX1 and wait MBX2
MSK02-PT-MBX03 - wait MBX1 and mounted MBX2
MSK02-PT-MBX04 - waiting for MBX1 and waiting for MBX2
i.e. we have 1 active copy on each of the servers in different data centers.
13) Prioritization of the DAG cluster.
In order to give priority to activating database copies, you must 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 - highest value
Used by:
1) Technet section "Exchange 2010 Cmdlets"
technet.microsoft.com/en-us/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