Hi,
A few weeks ago I wrote an article about AppFabric Cache aka Distributed Cache. It’s time to continue about AppFabric Cache. If you didn’t read the previous article please hit the following link: https://gokanx.wordpress.com/2013/06/15/distributed-cache-appfabrikcache-on-sharepoint-server-2013-part-12/
A little reminder about AppFabric Cache: This new way of caching was originally based on the “Cloud” of Microsoft (Azure) but has been integrated on the On Premise systems of Microsoft. The Distributed Cache can be deployed on 2 different ways
On the dedicated mode only this service is running on the application server and all other services are stopped who is hosting the AppFabric Cache Service.
On The Collocated mode the Distributed Cache is running with all other Service Applications on the Application Server. This is the recommended mode for deploying Distributed Cache.
Via Central Administration:
Via PowerShell:
At the Windows PowerShell command prompt, run the following command:
$instanceName = “SPDistributedCacheService Name = AppFabricCachingService”
$serviceInstance = Get-SPServiceInstance | ? {( $_.service.tostring()) –eq $instanceName –and ($_.server.name) –eq $env:computername
$serviceInstance.Provision()
OR
$serviceInstance.Unprovision()
When SharePoint Server 2013 is installed, 10% of the total physical memory is allocated. The Distributed Cache service use 50% of this memory as storage and the other to manage the memory.
This cache size can be increased when:
Use this procedure to reconfigure the memory allocation of Cache Size
Use-CacheCluster
Get-APCacheHostConfiguration –ComputerName –CachePort « 22233 »
Or
When you want to delete an AppFabric Server from the cluster, be aware that the service is stopped from the
Central Administration and then execute the folling commands via PowerShell:
Adding: Add-SPDistributedCacheServiceInstance
Deleting: Remove- SPDistributedCacheServiceInstance
In SharePoint 2013, a cluster cache exists when one or many machines are running the Distributed Cache Service.
When you have to do maintenance on your platform, the possibility exists that you have to remove a server from the Distributed Cache Cluster.
You have to run the following command (graceful) on the server that you want to remove.
Stop-SPDistributedCacheServiceInstance – Graceful
Remove-SPDistributedCacheServiceInstance
This operation can take more than 15 minutes. The graceful option will prevent losing any data.
When SharePoint Server 2013 is installed the Managed Account of Distributed Cache is the same as the Installation Account (PEGASUS\SPInstall_GA). You can change this with Powershell commands:
$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name –eq “AppFabricCachingService”}
$account = Get-SPManagedAccount –Identity Pegasus\USER_NAME
$cacheService.ProcessIdentity.CurrentIdentityType = “USER”
$cacheService.ProcessIdentity.ManagedAccount = $account
$cacheService.ProcessIdentity.Update()
$CacheService.ProcessIdentity.Deploy()
After an installation or maintenance of your cluster, the Distributed Cache can be non-operational. You can repair this again with PowerShell:
$Get-SPServiceInstance
$var = Get-SPServiceInstance GUID OF APPFABRICK
$var.delete()
Add-SPDistributedCacheServiceInstance