Around the Storage Block
Showing results for 
Search instead for 
Did you mean: 

Microsoft Exchange 2019 Metacache Database setup

This article is a quick overview for setting the Exchange 2019 MCDB. Complete configuration details can be found at this link - HPE Apollo 4200 Gen10 Server with Microsoft Exchange 2019 - Setup and configuration of MetaCacheDatabase.

Exchange.pngA new feature of Exchange 2019 is the MetaCacheDatabase (MCDB), which is essentially simply storage. Solid-state drives are used for fast in-mailbox searches and recent emails, while the main Exchange database is still on the higher capacity spinning drives. The MCDB is a smaller database copy of recent information used in conjunction with the full Exchange databases.

The official Microsoft documentation for setting up the MCDB can be found here:

Please note that these directions differ from the official Microsoft documentation for setting up the MetaCacheDatabase. I was unable to get the MCDB running following their documentation.

Two of the main points of contention I ran across were:
• MCDB volumes needed to be mapped and formatted
• No mention of MCDB default directories C:\ExchangeMCDBVolumes or C:\ExchangeMetaCacheDBs - likely because the Microsoft documentation states these will be automatically created by DiskReclaimer (which didn't happen in my testing).

Firstly, AutoReseed must be correctly configured for the MCDB to work properly, as Disk Reclaimer (part of AutoReseed) handles MCDB creation. AutoReseed best practices include mapping databases and database volumes to specific directories and may require configuration changes for existing databases that are not following these mapping standards.
The following links detail configuring AutoReseed:
Information about AutoReseed
Configuring AutoReseed for a database availability group

Once AutoReseed is properly setup, we can start the MCDB creation process.
The Manage-MCDB command must be imported from the Exchange scripts directory:

Import-Module 'C:\Program Files\Microsoft\Exchange Server\V15\Scripts\Manage-MetaCacheDatabase.ps1'

The default MCDB directories for each database can be found with the following command (in this example, the database is db01

Get-MailboxDatabase DATABASENAME | fl *Meta*

MCDB paths - Get_mailboxDatabase.png

The MCDB root folder directories are not created automatically and needed to be manually created.
SSD volumes were mapped to the root folder path C:\ExchangeMCDBVolumes within Windows disk management.

IMPORTANT - using unmapped, unformatted RAW volumes, as stated in the Microsoft documentation, didn't auto-configure for me. I had to manually format and mount the SSD volumes for this process to work

Having unformatted and/or unmapped volumes will cause an error in Disk Reclaimer:

syntax error.png

The first step in setting up the MCDB is to configure the prerequisites with the following command (using 2 SSDs):

Manage-MCDB -DagName dag -ConfigureMCDBPrerequisite -SSDSizeInBytes 1500000000000 -SSDCountPerServer 2

Microsoft documentation states that SSDs on all servers need to be exactly the same, but I found that MCDB SSDs can be dissimilar for each server if the SSDsize in Manage-MCDB is set to the size of (or less than) the smallest SSD. In this configuration, the size of 1.5 TB was used, as both the SATA and NVME SSDs were greater than that size.

When SSD volumes are correctly formatted and mounted, the following command will configure the MCDB (done on each server):

Manage-MCDB -DagName dag -ConfigureMCDBOnServer -ServerName "SERVERNAME" -SSDSizeInBytes 1500000000000 -verbose

SSD setup corect.png

MCDB mount points will automatically be created within a few minutes of MCDB being configured correctly (this is the view from disk management after they are created).

creating MCDB volumes 2.png

Now that MCDB is configured correctly, we can enable it on a server with the following command:

MCDB-Manage -DagName dag -ServerAllowMCDB:$true -Servername SERVERNAME

Checking on the Mailbox copy status after running the previous command will show the storage being offline. This is because the MCDB is not running on any server (it has only been enabled at this point).

MCDB creation -storage offline.png

A server failover must occur for MCDB databases to be created on the active server (and will disable it on the passive side). In this case, the following command will fail server sse-exch01 and force the MCDB to be created on the secondary server.

MCDB-Manage -DagName dag -Servername SERVERNAME -ForceFailover:$true

MCDB failover.png

After the failover has occurred, the MCDB should be online on the active server after a few minutes. Checking the MailboxDatabaseCopyStatus now shows a Healthy MCDB.

Get-MailboxDatabaseCopyStatus -Server SERVERNAME | fl MetaCache*

MCDB status healthy final.png

The server that was failed over from will now show MCDB as disabled.

MCDB disabled on passive side 2.png

From here, be patient - MCDB database mapping and creation will take a few minutes.
Once finally running, MCDB will auto-assign volume mappings to the available number of configured SSDs (which again, must have been manually formatted and assigned a mount point in C:\ExchangeMCDBVolumes). This Exchange installation had 20 database files and used 2 SSDs, so 10 MCDB files were created per SSD.
The MCDB directory structure after proper configuration should look something like this:

Populated Exchange MCDBVolumes.png

MCDB should now be working properly.

If the MCDB ever needs to be disabled on a server, run the following command:

MCDB-Manage -DagName dag -ServerAllowMCDB:$false -Servername SERVERNAME

DiskReclaimer will eventually clean up and remove the old MCDB files and volume mappings from this server. If MCDB is re-enabled and failed over to on this server again, the databases will be recreated.

About the Author