NCache uses TCP ports for communication. Default TCP port is 8250. These ports can be changed, if required, by changing the values of the registry key (TCP.PORT) written upon the installation of NCache.
This key can be found under the following path:
Please note that NCache Web Manager application assumes the default port. Therefore, upon changing the values of this port, Local Cache/Cluster cannot be administered through NCache Web Manager application. However, NCache command line utilities and tools provide the option to address the Local Caches/Clusters on other ports.
Cluster Port and Port Range
Cluster ports are the ports at which NCache clusters start. You can also specify the port range so that if the current port is unavailable, the server will automatically pick the next available port in the range. You can change the default value of these ports. For installed caches (myReplicatedCache, myPartitionedCache), NCache looks for ports starting from 7800 onwards and allots the available ports to these caches in the available port range.
Using NCache Web Manager
Launch NCache Web Manager by browsing to
<server-ip>:8251(Windows + Linux).
In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to configure.
Make sure the cache is stopped before proceeding.
- Against the cache name, click on View Details.
This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Cluster Settings in the left bar.
Change the Cluster Port and Port Range, as required.
Click on Save Changes to apply this configuration to the cache.
Start the cache to resume operations.
Manually Editing NCache Configuration
Make sure the cache is stopped before making any configuration changes.
- Specify port range through config.ncconf by specifying the
port-rangekeys in the
<cluster-settings ...> <cluster-connection-settings cluster-port="7806" port-range="1" .../> </cluster-settings>
- Once changes are made, start the cache and restart NCache service.
At the NCache Server Port, NCache Server starts and accepts different client connections. Default value of this port is 9800. You can change the default value through Service Configuration file as follows:
<add key="NCacheServer.Port" value="9800" />
This will change the value at Server side. This change must also be made in client.ncconf to make client aware of this change, as follows:
<ncache-server port="9800" .../>