Cache Administration with PowerShell (Velocity)
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
PowerShell 1.0 is the exclusive management tool for Microsoft project code named "Velocity." With more than 130 standard command line tools, this new administration-focused scripting language helps you achieve control and productivity. In addition to the standard command line tools that come with PowerShell, "Velocity" provides additional commands for managing your distributed cache environment.
By using PowerShell, you can administer the cache cluster, cache hosts, and the cache itself. You can start this tool from the PowerShell shortcut that is installed on the desktop of each cache server.
The tables in this document describe the PowerShell commands available for administering "Velocity." Some commands appear in more than one table, showing different parameters as they apply to each of the three categories of commands:
Cache Cluster-related Commands
Cache Host-related Commands
Cache-related Commands
Console Management Commands
Important Considerations
When using the PowerShell commands described in this topic, it is important to consider the following points:
The security identity of the person using these PowerShell commands must have administrator privileges on all cache servers in the cache cluster.
Parameter values for the commands are case sensitive. For example, if you create a cache called
NamedCache1
, the commandGet-CacheConfig -CacheName namedcache1
will not work. You must match the case, as inGet-CacheConfig -CacheName NamedCache1
.When making XML-based cluster configuration changes with the
Export-CacheClusterConfig
andImport-CacheClusterConfig
commands, you can change cluster configuration settings (XML attributes) in the XML file, but adding or removing named caches and cache hosts by inserting or removing XML elements is not supported.Start-CacheCluster
,Stop-CacheCluster
, andRestart-CacheCluster
cache cluster commands involve coordinating the state of the cache host Windows service on all cache servers in the cluster. These commands may take longer when lead hosts perform the cluster management role; there must be a majority of lead host running while the rest of the cache hosts stop and start.Stop-CacheCluster
orRestart-CacheCluster
cache cluster commands cause all data to be flushed from the memory of all cache hosts in the cluster.Set-CacheConfig
andImport-CacheClusterConfig
commands require you to restart the cache cluster with Restart-CacheCluster in order for changes to take effect.Remove-Cache
andNew-Cache
commands can be used to change a named cache configuration without impacting other named caches in the cluster.
Note
On Microsoft Windows Vista and Microsoft Windows Server 2008 operating systems, you must right-click the "Velocity" PowerShell shortcut and select Run as administrator for the cache administration tool to work correctly.
Cache Cluster-related Commands
The following table lists the "Velocity" PowerShell commands available to perform cluster-related operations.
Command | Description |
---|---|
|
Sets the context of your PowerShell session to the desired cache cluster. When starting a PowerShell session on a cache host, this command runs automatically, by using the connection parameters specified in the cache host configuration file. Parameter (alias) descriptions are as follows:
|
|
Starts all cache host services in the cluster. Lead hosts are started first. |
|
Stops all cache host services in the cluster. |
|
Restarts all cache host services in the cluster in the correct sequence. |
|
Designed to be used in tandem with This command exports the cluster configuration settings, as they currently exist in the cluster, to the specified XML-based configuration file. This command can be used regardless of where you chose to store your cluster configuration settings (SQL Server or shared network folder). Parameter (alias) description is:
Example: |
|
Designed to be used in tandem with This command imports the cluster configuration settings as described in the specified XML-based configuration file. This command can be used regardless of where you chose to store your cluster configuration settings (SQL Server or shared network folder). You must restart the cluster with the Parameter (alias) description is:
Example: |
Cache Host-related Commands
The following table lists commands available to perform cluster-related operations in PowerShell.
Command | Description |
---|---|
|
Lists all cache host services that are members of the cache cluster. Example: |
(cache host-related parameters) |
Returns the configuration information about the specified cache host. Note: See the next table for information about how to use this command with the Parameter (alias) descriptions are as follows:
Example: |
(cache host-related parameters) |
Updates the cache host configuration to the values specified in the command parameters Except for Note: See the next table for information about how to use this command with the Parameter (alias) descriptions are as follows:
Example: |
|
Starts the specified cache host service. After a cache server reboot, this command is required to allow the cache host service to re-join a running cache cluster. Parameter (alias) descriptions are as follows:
Example: |
|
Stops the specified cache host service. Note: The Parameter (alias) descriptions are as follows:
Example: |
(cache host-related parameters) |
Shows statistics for the specified cache host including: size (in bytes), number of caches, regions, cached objects, and cache misses. Note: See the next table for information about how to use this command with the Parameter (alias) descriptions are as follows:
Example: |
(cache host-related parameters) |
Lists all caches and regions that reside on the specified cache host. Note: See the next table for information about using this command with no parameters. Parameter (alias) descriptions are as follows:
Example: |
(cache host-related parameters) |
Returns a list of all regions in the cache cluster or only those on a cache host, as specified by the Note: See the next table for information about how to use this command with the Parameter (alias) descriptions are as follows:
Example: |
Cache-related Commands
The following table lists commands available to perform cache-related operations using PowerShell.
Command | Description |
---|---|
|
Creates a new named cache when the cluster is running. All values except for For more information, see How to: Edit Cache Configuration Settings with PowerShell (Velocity). Parameter (alias) descriptions are as follows:
Example: |
|
Removes a named cache, as specified by the Parameter (alias) description is:
Example: |
(with no parameters) |
Lists all caches and regions in the cluster and the cache host where each region resides. |
(cache host-related parameters) |
Lists all caches and regions that reside on the specified cache host. Parameter (alias) descriptions are as follows:
Example: |
(cache-related parameters) |
Returns the configuration details for the named cache specified by the Note: See the previous table for information about how to use this command with the Parameter (alias) description is:
Example: |
(cache-related parameters) |
Updates the configuration settings of the named cache, as specified by the The cache cluster may not be running when using the For more information, see How to: Edit Cache Configuration Settings with PowerShell (Velocity). Note: See the previous table for information about how to use this command with the Parameter (alias) descriptions are as follows:
Example: |
(cache-related parameters) |
Returns statistics of a named cache, as specified by the Note: See the previous table for information about how to use this command with the Parameter (alias) description is:
Example: |
(cache-related parameters) |
Returns a list of all regions in the cache cluster or only those in a named cache, as specified by the Note: See the previous table for information about how to use this command with the Parameter (alias) description is:
Example: |
Console Management Commands
The following table lists commands available to perform operations related to managing the PowerShell-based cache administration tool.
Command | Description |
---|---|
|
This command enables file-based logging for your PowerShell-based cache administration tool session. The event tracing initiated by this command lasts only for the duration of the PowerShell sessions from which it was called. By default, logging is enabled with a If a file by the same name is already present, PowerShell tries to append to the log file. Parameter (alias) descriptions are:
This example creates the file
This command tracks events only for the PowerShell session, not the cache client or cache host. For information about log sinks on the cache client and cache host, see Log Sink Settings (Velocity). |
|
Provides Help information for all supported commands. This keyword may also be used with a "
|
|
Provides a summary of "Velocity"-specific commands. |
|
Quits the PowerShell session. |
|
Clears the PowerShell screen. |
See Also
Concepts
Configuration (Velocity)
Troubleshooting (Velocity)
Other Resources
Installation and Deployment (Velocity)
Configuration Settings (Velocity)
Cache Concepts (Velocity)
Programming Guide (Velocity)