Remove Cache Server Node
A pre-existing, already registered server node can be simply removed from the cache it is a part of, using the NCache Management Center and Command Line Tools like PowerShell, etc., as detailed below.
Note
This feature is also available in NCache Professional.
Using Management Center
Launch the NCache Management Center by browsing to http://localhost:8251 or
<server-ip>:8251
on 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 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.
Note
You might get prompted with a dialog box upon these changes, asking whether to reload or overwrite the cache config file.
- The server node is removed from the Server Nodes List.
Using Command Line
The Remove Node tool enables the user to remove a particular node from the existing cache on a server or a specified node from the provided clustered cache.
The following command removes node 20.200.20.39 from demoCache.
Manually Editing Configuration for Node to Be Removed
To manually remove a node from the configuration, follow these steps carefully to ensure a smooth update.
Warning
This is only recommended for OSS.
Step 1: Stop Cache
Stop the cache on the server node, which is to be removed (20.200.20.39 in this case) through PowerShell using the Stop-Cache cmdlet.
Stop-Cache -Name demoCache
Step 2: Remove Cache Configuration using config.ncconf
All server node information is stored in configuration files. To remove a node from the cache, remove the entire cache configuration from config.ncconf of the node to be removed.
For example, in this scenario, the complete configuration of the demoCache in the <cache-config>
section will be removed from 20.200.20.39.
Important
Note that the server IPs and cache name will be according to your own environment.
<cache-config cache-name="demoCache">
...
<cache-deployment>
<servers>
<server-node ip="20.200.20.39"/>
<server-node ip="20.200.20.40"/>
</servers>
</cache-deployment>
</cache-config>
Step 3: Restart NCache Service
For the configuration changes made to take effect, restart the NCache Service. Make sure you have enough privileges to restart the service. If the user is not part of the Administrator's group, run PowerShell as an administrator, or you might get an error message that "Cannot open NCacheSvc service on computer."
Execute the following command in PowerShell to restart the NCache Service:
Restart-Service -Name NCacheSvc
Step 4: Verify Successful Removal of Cache
To verify that the node is absent from the clustered cache, open PowerShell and use the Get-Caches cmdlet on the server node.
Get-Caches
If the server node is successfully removed, the list will not contain the name of the cache demoCache.
See Also
Create a Cache
Remove Cache
Clear Cache
Configure Query Indexes