Remove Server Node from Cache Cluster
A cache can be removed at runtime without stopping the cache.
NCache cluster is dynamic and supports removing server nodes from a running cache cluster at runtime. When a cache server is removed, the existing cache cluster automatically updates its cluster membership and notifies all the clients about it.
Remove Node from Cache
Remove-Node PowerShell cmdlet enables removing an existing 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 removes existing node 184.108.40.206 from the cache named demoClusteredCache.
Remove-Node -CacheName demoClusteredCache -Server 220.127.116.11
Verify Successful Node Removal
To verify successful removal of the server node, open Windows PowerShell and use Get-Caches cmdlet (shipped with NCache) with
-Detail parameter which gives a detailed status of all caches registered on the cache server.
If the node has been successfully removed from the cache, the list will display the
Cluster Size for the cache along with all registered nodes. The node which has been removed will not exist in the list now.
Topology Wise Behavior
Topology specific behavior on removing a cache server is mentioned below:
In Partitioned Cache, data is partitioned among all the running cache servers. So when a cache server leaves the cluster, data residing on the cache server that is leaving is lost. Data distribution map also changes and cache clients are notified about the removal of this cache server.
In Replicated Cache, each cache server holds the same set of data. So no data loss occurs when a cache sever is removed from the cluster. However, all the clients that were connected to this leaving cache server detect this and move on to connect to other servers in the cluster.