Maintenance Mode for Cache Management
NCache provides support for maintenance mode in the Partition-Replica caching topology, a commonly used caching configuration. Maintenance mode is designed to facilitate patching or upgrade process and other cache management acivities without any application downtime.
During an upgrade, the typical procedure involves stopping one cache node at a time, upgrading the server, and restarting the cache(s) on it. However, stopping a cache node triggers state transfer across the entire cache cluster, leading to increased resource usage. NCache's maintenance mode addresses this issue by pausing state transfer when a node is temporarily stopped for maintenance.
To learn more about maintainance mode, please refer to the NCache Architecture.
How to Stop Node for Maintenance
You can stop a server node for maintenance without triggering state transfer. During this time, you can perform maintenance on your server node. You can stop a server node for maintenance/cache mangement in the following ways:
Important
You need to start your node within the timeframe of the maintenance mode, failing to do so will result in the state transfer being triggered after the time of maintenance runs out.
Using the NCache Management Centre
Launch the NCache Management Centre by browsing to http://localhost:8251 or
<server-ip>:8251
on Windows and Linux.In the left navigation bar, click on Clustered Caches. Against the cache name, click on View Details.
This opens up the detailed configuration page for the cache.
Under Server Nodes tab, check the box against the server node IP.
Click on "..." against the server IP and select Stop for Maintenance.
- The node status will change from Running to Stopped.
Important
No other node on the same clustered cache can be stopped during the maintenance mode. If you attempt to do so, it will give you an error saying "cluster is already under maintenance".
Using Command Line Tools
The IsStopForMaintenance/isstopformaintenance
flag of the Stop Cache Command Line Tool stops a server node for maintenance.
The following command stops the node 20.200.20.39 of the cache demoClusteredCache for maintenance for a time of 30 minutes:
Stop-Cache demoClusteredCache -Server 20.200.20.39 -IsStopForMaintenance -Timeout 30
How to Exit Maintenance Mode
You can exit the maintenance mode for a cluster through the following steps:
Using the NCache Management Centre
Launch the NCache Management Centre by browsing to http://localhost:8251 or
<server-ip>:8251
on Windows and Linux.In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to be configured.
Check the box against the cache on which the maintenance mode needs to be exited.
Click on "..." against the cache and select Exit Maintenance Mode.
- The clustered cache will exit the maintenance mode.