Add Server Node
A Server Node can be added in cluster any time. After adding a server node in a cluster, you need to start that node so that it can join the cluster.
Pre-Requisite
Make sure NCache Service is started. If it is not started, do the following:
In PowerShell, enter the following command:
Start-Service -Name NCacheSvc
For .NET Core, make sure that you run NCache service as an administrator. Here are the steps to do so:
- Open 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 NCache Web Manager
Launch NCache Web Manager by browsing to
http://localhost:8251
(Windows) or<server-ip>:8251
(Windows + 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 up the detailed configuration page for the cache. The Server Nodes tab displays a list and status of the existing server nodes of the cache.
Click on the button and specify the server node IP. Click on + to add it to the cache. 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. For more detail on maintaining data integrity, refer to this chapter.
- The newly added node is displayed in the Server nodes list.
Using PowerShell
Add-Node cmdlet enables the users to add a new server node to the existing Clustered cache on specified server.
This command adds a new server node '20.200.20.29' to a cache named demolusteredCache on existing server '20.200.20.38'.
Add-Node demoClusteredCache -ExistingServer 20.200.20.38 -NewServer 20.200.20.29
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 server.
The following example adds a new node 20.200.20.29 to the cache named demoClusteredCache existing on server node 20.200.20.38:
<cache-deployment>
...
<servers>
<server-node ip="20.200.20.38"/>
<server-node ip="20.200.20.29"/>
</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="demoClusteredCache" load-balance="True" enable-client-logs="False" log-level="error">
<server name="20.200.20.38"/>
<server name="20.200.20.29"/>
</cache>
- Once changes are made, start the cache and restart NCache service.