.NET Distributed Caching Solution Part 3: Common Commands for Windows Server AppFabric

Jun 25, 2012

In this part, we will see the various common commands that can be used with Windows AppFabric Distributed Caching Solution. This is the Part 3 of the AppFabric Distribution Caching blog post series.

  •  Part 1 - Installation of Windows Server AppFabric Distributed Caching Solution
  •  Part 2 - Configuration Options for Windows Server AppFabric Distributed Caching Solution
  •  Part 3 - Common Commands for Windows Server AppFabric Distributed Caching Solution
  •  Part 4 - Configuring Sitecore with Windows Server AppFabric Distributed Caching Solution and Cache Eviction using Sitecore Events.
  •  Part 5 - Production Configuration for Windows Server AppFabric Distributed Caching Solution

In this post, I would be talking about the common commands that help in this Distribution Cache Solution Land. All the commands for AppFabric are run in the windows powershell command tool. This can be launched by going to Start -> All Programs -> Windows Server App Fabric -> Caching Administration Windows PowerShell

To get all the commands related to cache
Get-Command *cache*

To get help on  a command
Get-Help New-Cache -full

To create cache with Name "DEV_Cache"
New-Cache -CacheName DEV_Cache -TimeToLive 60 -Expirable true

To get cache
Get-Cache

To get cache host which provides the cache hosts and their status and the cacheserver host name and port on which it is running.
Get-CacheHost

To grant access to cache cluster (local and the domain scenarios)
Grant-CacheAllowedClientAccount -Account "NT AUTHORITY\NETWORK SERVICE"
Grant-CacheAllowedClientAccount -Account "domainname\machinename$"

To get client accounts that can access Cache
Get-CacheAllowedClientAccount

To Set cache-cluster security on the server, there are different levels are ProtectionLevel and SecurityMode.
Set-CacheClusterSecurity -ProtectionLevel None -SecurityMode None

To Start cache-cluster
Start-CacheCluster

To Stop cache-cluster
Stop-CacheCluster

To get cache Statistics, which provides details of no of misses, no of hits, no of items in cache, size of the cache and other details. Enter the following command and enter the cachename when prompted for it.
Get-CacheStatistics

To get cache cluster health, this provides the different parameters about state of the cluster like throttle and so on.
Get-CacheClusterHealth

There are several other commands that one can run for the cache cluster. Apart from this,there is a cache administration tool that one can use which allows to access cache through GUI.