Patching Distributed Cache for SharePoint 2013 and SharePoint 2016

This post has been republished via RSS; it originally appeared at: SharePoint Support Blog articles.

Is your SharePoint 2013 or 2016 farms Distributed Cache services Healthy? If not you might need to patch. One way to validate your Distributed Cache service is healthy is to pull some ULS logs from one of the Distributed cache servers in the farm.

 

 

Using ULSViewer, Filter your ULS log files where Category equals DistributedCache, if you see something like the screenshot below. Then your Distributed cache is not healthy and should patch your farm using the steps in this article.

 

EventId Found - air4c, air4d, agyfw, air4c, air38, air39

 

dc004.png

 

 

Steps for Patching Distributed cache

Patching the distributed cache service on your SharePoint farm will cause user experience to be interrupted a bit and its recommended to be performed during a maintenance window. But It can be performed during production if its all ready down in some cases.

 

Step 1 - Shut down the Distributed Cache service on one of the distributed cache servers in your farm.

Run the following PowerShell command to stop the distributed cache on the server at a SharePoint command prompt.

 

Stop-SPDistributedCacheServiceInstance -Graceful

 

Step 2 - Patch AppFabric 1.1 on the one server you stopped the Distributed Cache service on. Patch the server with CU7 found in the following article where you can download it - https://support.microsoft.com/en-us/kb/3092423

 

Step 3 - Update the “DistributedCacheService.exe.config” file to run garbage collection process in the background on each Distributed Cache server. 

 

File location - C:\Program Files\AppFabric 1.1 for Windows Server\DistributedCacheService.exe.config

 

Update the file with the section below, see screen shot below – Make sure you put it in the right section or it will not work correctly.

 

 

<appSettings>

   <add key="backgroundGC" value="true"/>

</appSettings>

 

 

dc001.png

 

Step 4 - Repeat steps 1 through 3 on the next distributed cache sever in the farm, repeat these steps until you have patched all the Distributed cache servers using these steps. Once you have them all patched, move on to Step 5.

 

Step 5 - Fine-tune the Distributed Cache service by using a Windows PowerShell script found in this Microsoft article near the bottom in the section called:

Fine-tune the Distributed Cache service by using a Windows PowerShell script

 https://technet.microsoft.com/en-us/library/jj219613.aspx

 

Run the script found in the article on one of your SharePoint servers in the farm. This only has to be done once.

 

Note – there is a section for SharePoint 2013 and 2016 in the Microsoft article – Use the section that matches your farm.

 

dc003.png

 

Step 6 - Start the Distributed cache service using the below PowerShell script in a SharePoint PowerShell command prompt on one of the Distributed cache servers.

 

$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"

$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}

$serviceInstance.Provision() 

 

Step 7 – Verify the health of the Distributed cache server you started in Step 6 using the below PowerShell commands, Do not go to Step 8 until the server shows UP. You might have to wait a bit for it to come up, its usually slow on the first server to start up.

 

Use-CacheCluster

Get-CacheHost

 

 

NOTE - If you have servers listed as Down, try starting the Distributed cache service in Central admin and re-run the above commands to verify it came up.

 

 

 Step 8 – Repeat Step 6 through 7 on the rest of the Distributed cache servers until they are all started. 

 

 Step 9 – Once all the servers are up, check their health one more time to make sure they are all UP.

 

Use-CacheCluster

Get-CacheHost

 

dc005.png

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.