Create a Cache
NCache Enterprise edition allows you to create the following caches:
- Local Cache (meaning a standalone cache)
- Mirror Cache
- Partitioned Cache
- Replicated Cache
- Partitioned-Replica Cache
See more details on edition comparison between NCache Open Source, Community and Enterprise. We’ll create a Partitioned-Replica Cache here in both ways - NCache Manager and PowerShell tool.
Right-click on Clustered Caches and select Create New Clustered Cache...
New Clustered Cache wizard will open. Specify the name of the cache, select Data Format and click Next.
Cache with the specified name should not exist on the server; otherwise you get an error message that this cache already exists on this server.
In Select caching topology dialog, select the required cache topology. You can also change the Operation timeout (sec.) and Statistic replication interval (sec.) under the Advanced cluster options.
Specify the desired information and click Next.
If you selected the Partition Replica Cache topology, you have to select a Replication Strategy, either Asynchronous or Synchronous.
Specify the node IP address in text box or select from the Network Neighborhood and click on the > button to add it in the Selected Nodes list.
Click Next once all the required nodes are added.
Change the Cluster Port and Port Range if required.
In the next dialog, you can change the Maximum Size of the cache, if required.
In Advanced options dialog, you can configure the following settings:
You can change the Eviction Policy. The eviction policy will be configured and can be turned on.
You can also change the Eviction Percentage; items will be evicted from the cache using this percentage value if eviction is enabled.
You can change the Clean interval value. Default is 15 seconds.
This cache can be started automatically upon the completion of this process if you have checked the Start this cache on Finish checkbox on this dialog. You can later start the cache by right-clicking on the cache name if you do not start the cache now.
You can make the cache start automatically after service restart by checking the checkbox Auto start this cache on service startup.
Click Finish. Created cache will appear in Cache Explorer under Clustered Caches section. The blue icons next to the server nodes indicate that the cache has been started on these servers.
Using Windows PowerShell
New-Cache cmdlet enables the user to create a new cache on one or more server nodes.
This Command creates demoClusteredCache of local topology of size 1024MB on node 220.127.116.11.
New-Cache demoClusteredCache -Server 18.104.22.168 -Size 1024
Add Node to Cache
Add-Node cmdlet enables the users to add a new server node to the existing clustered cache on specified server. It also enables users to have multiple server nodes in a clustered cache.
This command adds a new node 22.214.171.124 to the cache named demoCache existing on server node 126.96.36.199 which already exists.
Add-Node -CacheName demoClusteredCache -ExistingServer 188.8.131.52 -NewServer 184.108.40.206
Once the cache is created, you need to start a clustered cache on all the server nodes so that operations can be performed on it. Start-Cache cmdlet enables the user to start the registered cache and Cache process on the nodes.
Perform this step on all server nodes.
Start-Cache -Name demoClusteredCache