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
Using NCache Web Manager
Launch NCache Web Manager by browsing to http://localhost:8251 or
<server-ip>:8251on Windows and Linux.
In the left navigation bar, click on Clustered Caches. This opens up a new page at
<server-ip>:8251/. The page shows any existing local or clustered caches and additional details like Server and Server Platform.
Against the cache name, click on View Details.
- This opens up the detailed configuration page for the cache. The Server Nodes tab displays a list and status of the existing server nodes of the cache.
- Check the box against the node to be removed. Click on the button. A success notification will be displayed.
You might get prompted with a dialog box upon these changes, asking whether to reload or overwrite the cache config file. For more detail on maintaining data integrity, refer to this chapter.
- The server node is removed from the Server nodes list.
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 220.127.116.11 from the cache named demoClusteredCache.
Remove-Node -CacheName demoClusteredCache -Server 18.104.22.168
Verify Successful Node Removal
To verify successful removal of the server node, open 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.