I found it hard to follow and understand this article https://docs.microsoft.com/en-us/Exchange/high-availability/database-availability-groups/metacachedatabase-setup?view=exchserver-2019 and could not find actual step-by-step information on configuring Exchange Server MCDB anywhere. So, I created my own.
The process of setting up MCDB can be broken down into five basic steps:
- Set the correct values for the DAG you want to enable for MCDB.
- Update Active Directory (AD) settings and wait for propagation (by running
ConfigureMCDBPrerequisite
). - Allow MCDB acceleration for each server of the DAG (by running
ServerAllowMCDB
). - Create the necessary infrastructure (Volumes, Mount Points) for MCDB on each server (by running
ConfigureMCDBOnServer
). - Switch-over databases to pick up the new settings.
My Environment
Exchange 2019 DAG: EXCH19DAG01
Exchange 2019 Servers in DAG: E2019HQ3 and E2019HQ4
Exchange DAG Database Configuration: 16 databases, 4 databases per volume, 4 volumes with database, 2 AutoReseed volumes
MCDB per server: 256 GB SSD per server with nothing else done (no online, no initialize, no format). Device/Drive is 8 when issuing Get-PhysicalDisk.
Add the MCDB commands to your E2019 EMS
Make the Manage-MCDB CMDLet available in your Exchange Management Shell session. (The . . has a space in between them).
cd $exscripts
. .\Manage-MetaCacheDatabase.ps1
1. Set the Correct Values for the DAG you want to enable for MCDB
Set-DatabaseAvailabilityGroup EXCH19DAG01-AutoDagTotalNumberOfDatabases 16 -AutoDagDatabaseCopiesPerDatabase 4 -AutoDagTotalNumberOfServers 2 -AutoDagDatabaseCopiesPerVolume 4 -AutoDagDatabasesRootFolderPath E:\ExchangeDatabases -AutoDagVolumesRootFolderPath E:\ExchangeVolumes
2. Update Active Directory (AD) settings for MCDB
Find out the SSD drive will be used for MCDB (in my case it’s drive 8)
Get-PhysicalDisk
My DAG will have one MCDB SSD per server:
Manage-MCDB -DagName EXCH19DAG01 -ConfigureMCDBPrerequisite -SSDSizeInBytes (Get-PhysicalDisk -Uniqueid (Get-Disk 8).uniqueid).size -SSDCountPerServer 1 -Verbose
3. Allow MCDB acceleration for each server of the DAG
Run from elevated Exchange Management Shell for your first E2019 server:
Manage-MCDB -DagName EXCH19DAG01 -ServerAllowMCDB:$True -ServerName "E2019HQ3" -ForceFailover:$true
Wait for queues to return to 0
Get-MailboxDatabaseCopyStatus *
Run from elevated Exchange Management Shell for your second E2019 server:
Manage-MCDB -DagName EXCH19DAG01 -ServerAllowMCDB:$True -ServerName "E2019HQ4" -ForceFailover:$true
Wait for queues to return to 0
Get-MailboxDatabaseCopyStatus * | ?{($_.replayqueuelength -gt 1) -or ($_.copyqueuelength -gt 1)} |sort name
Repeat the two steps above for each additional DAG member in your DAG (mine only has two members).
4. Create the necessary infrastructure (Volumes, Mount Points) for MCDB on each server
Log onto E2019HQ3 Elevated EMS:
Start diskpart:
diskpart
Find the SSD drive (in my environment it is 8):
List Disk
Select disk 8:
select disk 8
Clean disk 8:
clean
Remove the Readonly flag:
attributes disk clear readonly
Bring the SSD disk online:
online disk
Convert to GPR:
convert gpt
Clean disk 8 again
clean
Exit from diskpart:
exit
Review the disks
Get-PhysicalDisk
Set all disks except the MCDB SSD to HDD
Get-PhysicalDisk | Set-PhysicalDisk -MediaType HDD
Get-PhysicalDisk -DeviceNumber 8 | Set-PhysicalDisk -MediaType SSD
Get-Disk
Get-Disk 8 | FT Size
Manage-MCDB -DagName EXCH19DAG01 -ConfigureMCDBOnServer -ServerName "E2019HQ3" -SSDSizeInBytes 274877906944 -Verbose
Log onto E2019HQ4 Elevated EMS:
Start diskpart:
diskpart
Find the SSD drive (in my environment it is 8):
List Disk
Select disk 8:
select disk 8
Clean disk 8:
clean
Remove the Readonly flag:
attributes disk clear readonly
Bring the SSD disk online:
online disk
Convert to GPT:
convert gpt
Clean disk 8 again
clean
Exit from diskpart:
exit
Review the disks
Get-PhysicalDisk
Set all disks except the MCDB SSD to HDD
Get-PhysicalDisk | Set-PhysicalDisk -MediaType HDD
Get-PhysicalDisk -DeviceNumber 8 | Set-PhysicalDisk -MediaType SSD
Get-Disk
Get-Disk 8 | FT Size
Manage-MCDB -DagName EXCH19DAG01 -ConfigureMCDBOnServer -ServerName "E2019HQ4" -SSDSizeInBytes 274877906944 -Verbose
Get-MailboxDatabaseCopyStatus * | FT Name,Status,*Meta*
5. Switch-over databases to pick up the new settings
Mounted Databases need to be moved off of the active server to start initialization:
Move-ActiveMailboxDatabase -Server E2019HQ3
Get-MailboxDatabaseCopyStatus * | FT Name,Status,*Meta*
MetaCacheDatabaseStatus should move from Initializing to, eventually, Healthy.
Repeat step 5, for additional DAG members, if you have more than two members in your DAG.