Remove Already Existing Cache
NCache allows you to remove an existing cache without stopping existing caches using the steps below. You can manually edit config.ncconf and client.ncconf located at %NCHOME%\config
through any text editor. %NCHOME%
is the NCache install directory.
Step 1: Remove Cache Configuration from All Nodes
To remove an 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 updating the associated configurations of the <cache-config>
. The cache-name
in your configuration will be the name of your cache.
<cache-config cache-name="demoClusteredCache">
...
</cache-config>
Step 2: Restart NCache Service on All Nodes
For the configuration changes made to take effect, restart the NCache Service. Ensure you have enough privileges to restart the service. If the user is not in the Administrator's group, run PowerShell as 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 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
To verify the successful cache removal, use PowerShell to run the Get-Caches command to get the list of the registered caches on the server. Removal will be successful if the cache list displayed does not contain its name.
Get-Caches
See Also
Create a Cache
Update Cache Config
Add Server Node
Remove Server Node