Distributed Cache problems have been prevalent on SharePoint 2013. To
try to circumvent these issues, you should do an AppFabric update on all your servers as part of your initial SharePoint 2013 installation.
In the past, cache updates for SharePoint would be included as part of SharePoint patches. This time around, cache is separated from SharePoint in AppFabric updates. So add that to your list of patches to watch when you are updating SharePoint 2013.
Stop the Distributed Cache Service
If your SharePoint is in production, you should stop the distributed cache service first on the server you will update. Then the cache will move to another one of your servers set up with distributed cache. You may want to check out my post
The number of Distributed Cache hosts in the farm exceeds the recommended value (SharePoint 2013) to see where your cache
should be set up.
To stop the cache on a server, run SharePoint management shell as an administrator and run the following commands:
asnp *sharepoint*
Stop-SPDistributedCacheServiceInstance -Graceful
Install AppFabric CU
Now you're ready to install the latest AppFabric patch. At the time of this writing, they were up to
CU5 – KB2932678. This install is easy, just follow the directions.
Update DistributedCacheService.exe.config File
Next you need to update the DistributedCacheService.exe.config file. This is due to an update that was released in
CU3 – KB2787717. You wouldn't know you needed to update the config file unless you read all the write-ups on all the CUs. A new background garbage collector was implemented in this CU. The config file is located at C:\Program Files\AppFabric 1.1 for Windows Server folder and the update is:
<configuration>
...
<appsettings>
<add key="backgroundGC" value="true">
</add>
</appsettings>
</configuration>
Start Distributed Cache Service
Now your ready to start the Distributed Cache service again:
$instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache" -and $_.Server.Name -eq $env:computername}
$instance.Provision()
Lather, Rinse, Repeat
Now, do this on all your distributed cache servers one at a time.
Still Not Working?
For some people, this is enough and the service will work again. This didn't quite do it for me. I had to actually unprovision the distributed cache service and reprovision it again to it to work. Here are the steps to do that:
$instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache" -and $_.Server.Name -eq $env:computername}
$instance.Unprovision()
Then provision it again:
$instance.Provision()
References
http://www.wictorwilen.se/how-to-patch-the-distributed-cache-in-sharepoint-2013
http://msdn.microsoft.com/en-us/library/ee790928(v=azure.10).aspx