From http://technet.microsoft.com/en-us/library/jj219613.aspx
Change the service account running the Distributed Cache
It is recommended to use a SharePoint managed account for this service.$spfarm = Get-SPFarm
$spcacheService = $spfarm.Services | where {$_.Name -eq “AppFabricCachingService”}
$spaccount = Get-SPManagedAccount -Identity domain\spdistcache$spcacheService.ProcessIdentity.CurrentIdentityType = “SpecificUser”
$spcacheService.ProcessIdentity.ManagedAccount = $spaccount
$spcacheService.ProcessIdentity.Update()
$spcacheService.ProcessIdentity.Deploy()
Graceful stop and deattach local server (No lost cache data)
Stop-SPDistributedCacheServiceInstance -GracefulRemove-SPDistributedCacheServiceInstance
Deattach local server from a cache cluster (Multiple Distributed Cache servers)
Remove-SPDistributedCacheServiceInstanceReattach local server to a cache cluster (Multiple Distributed Cache servers)
Add-SPDistributedCacheServiceInstanceDelete the service
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.delete()
Verify in Central Admin, System Settings, Manage Services on Server. It should be gone from this list when it has been completely deleted.
In a multi server farm, you will have to select which server to show the services from in the top-right dropdown.
Create a new service
Add-SPDistributedCacheServiceInstanceVerify in Central Admin, System Settings, Manage Services on Server. It should appear in this list when it has been created. In a multi server farm, you will have to select which server to show the services from in the top-right dropdown.
Start the service on a server
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()
Stop the service on a server
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}$serviceInstance.Unprovision()
Check current Cache memory allocation
Use-CacheCluster Get-AFCacheHostConfiguration -ComputerName $env:computername -CachePort “22233″Change the Cache memory allocation
On all Cache servers in the farm stop the service$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()
Update the memory allocation
Update-SPDistributedCacheSize -CacheSizeInMB CacheSize
Start the service on all Cache servers
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()
Remove a host from the cluster: if all else failes
Stop-CacheHost -HostName <servername> -CachePort 22233
Unregister-CacheHost -HostName <servername> -RemoveServicePermissions -ProviderType SPDistributedCacheClusterProvider -ConnectionString 'Data Source=<dbservername>;Initial Catalog=<SharePoint_Config>;Integrated Security=True;Enlist=False'
No comments:
Post a Comment