Remove Already Existing Cache
Note
NCache allows you to remove an existing cache. You can remove a cache without stopping any of the existing caches on this server.
An already registered cache can be removed using the following steps.
You can manually edit config.ncconf and client.ncconf located at %NCHOME%/config. %NCHOME% is NCache install directory. These files can be edited through any text editor of your choice.
Step 1: Remove Cache Configuration from All Nodes
In order to remove a existing cache on a server, remove the entire configurations of that particular cache from config.ncconf of each server node (in case of clustered cache) and the local server (in case of local cache).
In the sample configuration below, the cache named demoClusteredCache is removed by removing the associated configurations of the <cache-config>
. The cache-name
in your configuration will be the name of your own cache to be removed.
<cache-config cache-name="demoClusteredCache">
...
</cache-config>
Step 2: Restart NCache Service on All Nodes
For the configuration changes made to take effect, restart NCache Service:
- Windows:
Make sure you have enough privileges to restart the service. If the user is not the part of the Administrator's group, make sure to run PowerShell as administrator, otherwise you might get an error message that "Cannot open ncachesvc service on computer".
Execute the following command in PowerShell to restart NCache Service:
Restart-Service -Name NCacheSvc
Step 3: Remove cache from client.ncconf
Once the node is removed from config.ncconf, you need to update client.ncconf. In client.ncconf of EACH server node, remove the entire <cache>
configuration associated to the cache.
<cache id="demoClusteredCache..."/>
...
</cache>
Please refer to the Remove Client from Cache section for more detail.
Step 5: Verify Successful Cache Removal on All Nodes
In order to verify the successful removal of the cache, use PowerShell to run the Get-Caches command to get the list of the registered caches on the server. Successful removal of the cache will be verified if the cache list displayed does not contain the cache name.
Get-caches
See Also
Create a Cache
Update Cache Config
Add Server Node
Remove Server Node