New-NCAzCache
The New-NCAzCache PowerShell cmdlet creates a new cache on all servers within a specified environment and saves the cache configuration information in the environment.
New-NCAzCache -EnvName -Name [-Servers] [-Topology] [-CleanupInterval] [-ClusterPort] [-DefaultPriority] [-EvictionPolicy] [-EvictionRatio] [-SerializationFormat] [-NoLogo] [-Path] [-Port] [-ReplicationStrategy] [-Size] [-Credentials] [-InMemoryStoreType] [-UseExistingIndex]
Examples
- Create a new cache named demoCache on all the servers with size 1024 MB in the Production environment:
New-NCAzCache -EnvName Production -Name demoCache -Size 1024
- This command creates a new cache named demoCache on the 10.0.0.4 server with the size of 1024 MB, with the configuration that exists on the specified path.
New-NCAzCache -EnvName Production -Name demoCache -Server 10.0.0.4 -Size 1024 –Path C:\config.xml
- This command creates a new cache named demoCache on the 10.0.0.4 server with the size of 1024 MB, with the Replicated topology, occupying the port 7800.
New-NCAzCache -EnvName Production -Name demoCache -Server 10.0.0.4 -Size 1024 –Topology Replicated –ClusterPort 7800
- This command creates a new cache named demoCache on the 10.0.0.4 server with the size of 1024 MB, with the Partitioned topology, a priority-based eviction policy, a high default priority, as well as a eviction ratio set as 10%. The cleanup interval of the cache will be 20 seconds and port 7800.
New-NCAzCache -EnvName Production -Name demoCache -Server 10.0.0.4 -Size 1024 –Topology Partitioned –EvictionPolicy priority –DefaultPriority high –EvictionRatio 10 –CleanupInterval 20 -ClusterPort 7800
- This command creates a new cache named demoCache on the 10.0.0.4 server with the size of 1024 MB, with the Partitioned topology as a PubSubMessaging store type.
New-NCAzCache -EnvName Production -Name demoCache -Server 10.0.0.4 -Size 1024 –Topology Partitioned -InMemoryStoreType PubSubMessaging
Properties
Note
Parameters marked with an asterisk (*) are required. All others are optional.
| Parameter | Data Type | Description | Default Value |
|---|---|---|---|
-EnvName* |
<String> |
Name of the environment where the cache is created. | - |
-Name* |
<String> |
Name of the cache to create. | - |
-Server |
<String> |
Comma-separated list of NCache servers where the cache should be configured, e.g., "10.0.0.4, 10.0.0.5". |
Local Machine |
-CleanupInterval |
<Integer> |
Interval in seconds for cache cleanup to clear expired items. | 15 seconds |
-ClusterPort |
<Integer> |
Port number where the server listens. | 8250 |
-DefaultPriority |
<String> |
Default priority for Priority-based eviction policy. Possible values: High, Above Normal, Normal, Below Normal, Low. |
Normal |
-EvictionPolicy |
<String> |
Eviction policy for cache items. Possible values: Priority Based, LFU, LRU. LFU and LRU are Enterprise edition only. |
LRU |
-EvictionRatio |
<Decimal> |
Percentage of items to evict when eviction triggers. | 5% |
-SerializationFormat |
<String> |
Serialization format of cached objects. Possible values: Binary, JSON. Defaults: Binary for DistributedCache and PubSubMessaging, JSON for DistributedCacheWithPersistence. |
Binary |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |
-Path |
<String> |
Path to a configuration file if default settings are not used. | - |
-Port |
<Integer> |
Server port where NCache service listens. | 8250 |
-ReplicationStrategy |
<String> |
Replication strategy for Partitioned Replica topology. Possible values: Async, Sync. |
Async |
-Size* |
<Long> |
Size of the cache to create (in MB). | 1024 (for local cache) |
-Topology |
<String> |
Cache topology. Possible values: Mirror, Replicated, Partitioned, PartitionReplica (Enterprise edition only). |
Local |
-Credentials |
<PSCredential> |
Credentials to access servers (if required). | - |
-InMemoryStoreType |
<String> |
Specifies the type of in-memory store. | - |
-UseExistingIndex |
<SwitchParameter> |
Use existing index files if available. | False |