SharePoint 2019 Distributed Cache Crashes

If your Distributed Cache is crashing repeatedly in your brand new SharePoint 2019 farm, there is a fairly simple fix you can run. This script was provided by PSS – it has worked for myself and others who have used it. Review the script – there are manual steps as notated in the comments. These steps must be executed on a server hosting Distributed Cache.

Use-CacheCluster

# Stop the Caching Services on all cache hosts in the cluster.
Stop-CacheCluster

# Export existing cache cluster configuration
Export-CacheClusterConfig -Path C:\temp\appfabconfig.txt

# make a copy of "appfabconfig.txt" and name it "appfabconfig2.txt"
# Edit appfabconfig2.txt
# Change <caches partitionCount="256" to "128"

# Import the changes.
Import-CacheClusterConfig -Path c:\temp\appfabconfig2.txt

# Start the Caching Services on all cache hosts in the cluster.
Start-CacheCluster

# Stop the Caching Services on all cache hosts in the cluster.
Stop-CacheCluster

# Import the original settings
Import-CacheClusterConfig -Path c:\temp\appfabconfig.txt

# Start the Caching Services on all cache hosts in the cluster.
Start-CacheCluster

Trevor Seward is a Microsoft Office Apps and Services MVP who specializes in SharePoint Server administration, hybrid scenarios, and SharePoint Online. He has been working with SharePoint for 16 years from SharePoint 2003 on up, managing environments with terabytes of content for 150,000+ user organizations. Trevor is an author of Deploying SharePoint 2016 and Deploying SharePoint 2019. You can find him on Twitter and in /r/sharepoint.