Repair corrupted SharePoint 2013 Distributed Cache cluster

Before you begin, please check if your SharePoint farm SQL servers are using Dynamic memory on ESX or Hyper-V. If yes - Turn it OFF! And check if it helped.

Launch AppFabric PowerShell console and execute:
Use-CacheCluster
Get-CacheHost
Check if Cluster is 'UP'
If not then:
Start-CacheHost –ComputerName [yourServerName] –CachePort 22233
then get your SharePoint farm GUID
$spFarm=[Microsoft.SharePoint.Administration.SPfarm]::Local
$spFarm.Id
Export your current cluster configuration as backup. For reference and just in case..
Export-CacheClusterConfig c:\Backup.xml
Replace text in XML bellow:
YOUR-FARM-ID to your farm GUID,
CONTOSO\ClusterServiceAccount to your cluster service account,
SERVER1.COM to your cluster host.
Copy host section if you have multiple cluster hosts and change server name.
Change hostid like in Backup.xml and refer to other configuration details in this file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    <dataCache size="Medium">
        <caches partitionCount="256">
            <cache consistency="StrongConsistency" name="DistributedAccessCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedActivityFeedCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedActivityFeedLMTCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="None" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedBouncerCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedDefaultCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedLogonTokenCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedSearchCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedSecurityTrimmingCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedServerToAppServerAccessTokenCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
            <cache consistency="StrongConsistency" name="DistributedViewStateCache_YOUR-FARM-ID"
                minSecondaries="0">
                <policy>
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
                </policy>
            </cache>
        </caches>
        <hosts>
            <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
                hostId="280822625" size="1229" leadHost="true" account="CONTOSO\ClusterServiceAccount"
                cacheHostName="AppFabricCachingService" name="SERVER1.COM"
                cachePort="22233" />
        </hosts>
        <advancedProperties>
            <partitionStoreConnectionSettings leadHostManagement="false" />
            <securityProperties>
                <authorization>
                    <allow users="WSS_ADMIN_WPG" />
                    <allow users="WSS_WPG" />
                </authorization>
            </securityProperties>
        </advancedProperties>
        <deploymentSettings>
            <deploymentMode value="RoutingClient" />
        </deploymentSettings>
    </dataCache>
</configuration>

Save it to file c:\NewConfig.xml
Then stop cluster, import edited config file to cluster configuration and start it again:
Stop-CacheCluster
Import-CacheClusterConfig C:\NewConfig.xml
Start-CacheCluster
Then after several minutes try
Get-Cache
You should get:
CacheName            [Host]                      Regions
———————–
 default
 DistributedAccessCache_
 DistributedActivityFeedCache_
 DistributedActivityFeedLMTCache_
 .....

Comments

Popular posts from this blog

"There's a configuration problem preventing us from getting your document. If possible, try opening this document in Microsoft Word." Office WebApp Error

"We’re sorry. We ran into a problem completing your request. Please try that again in few minutes." Excel Service SharePoint

Deployment error "The web.config is invalid on this IIS Web Site"