Add Cache Server Node
You can add a cache server node to the cluster at any time. After adding a server node to the cluster, you need to start that node so that it can join the cluster.
Note
This feature is also available in NCache Professional.
Prerequisites
Make sure the NCache Service is running. If it is not, do the following:
In any Command Line Tool of your choice, enter the following command:
Start-Service -Name NCacheSvc
For .NET Core, ensure that you are running the NCache Service as an administrator. Here are the steps to do so:
- Open the Services Window and look for NCache in the list.
- Right click on NCacheSvc from the list and choose Properties.
- Go to the Log On tab and click on the Browse button.
- In the object name field, type Administrator and click on the Check Names button.
- It will pick the appropriate Administrator, then click OK.
- Now, set a Password and click OK.
- Right click on the NCache Service and choose the Restart option. Now your service will start running as administrator.
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 Servers 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 of IP statuses on the existing server nodes of the cache.
Click on the
button and specify the server node's IP. Click on
to add it to the cache. Upon which you will get a success notification.
Note
You might get prompted with a dialog box upon these changes, asking whether to reload or overwrite the cache config file.
- The newly added node is displayed in the Server Nodes List.
Note
You also have the option to download logs to monitor a specific server node.
Using Command Line
The Add Node enables the users to add a new server node to the existing cache on the specified server.
This cmdlet enables the users to add a new server node to the existing cache on the specified server. It also enables users to have multiple server nodes in a clustered cache.
Manually Editing NCache Configuration
Important
Make sure the cache is stopped before making any configuration changes.
- To add a server node to a cache cluster, add a new
<server-node>
tag within the<servers>
tag in config.ncconf of each of your cache servers. The following example adds a new node 20.200.20.39 to the cache named demoCache existing on server node 20.200.20.40:
<cache-deployment>
...
<servers>
<server-node ip="20.200.20.40"/>
<server-node ip="20.200.20.39"/>
</servers>
...
</cache-deployment>
Note
Repeat this step on all server nodes.
- In client.ncconf of the server node from where the client is being executed, add the following information about the node under the
<configuration>
tag:
<cache id="demoCache" load-balance="True" enable-client-logs="False" log-level="error">
<server name="20.200.20.40"/>
<server name="20.200.20.39"/>
</cache>
- Once changes are made, start the cache and restart the NCache Service.
Verify Successful Addition of Node
To verify the successful addition of the server node, open the Command Line and use the Get-Caches cmdlet (shipped with NCache) with the -Detail
parameter which gives a detailed status of all caches registered on the cache server.
For example, in this case, the demoCache has a Cluster size of 2 with the IP address of each cache server listed with it. The node which has been added will exist in the list now. The output also displays additional cache information like Item Count and Status.
Get-Caches -Detail