Create a New Cache Cluster
Using NCache Manager
Select File ->New ->Clustered Cache option.
New Clustered cache wizard will open. Specify the name of the cache, select Data Format and click Next.
Cache with the specified name should not exist on the server; otherwise you get an error message that this cache already exists on this server.
In Select caching topology dialog, select the required cache topology. You can also change the Operation timeout (sec.) and Statistic replication interval (sec.) under the Advanced cluster options.
Specify the desired information and click Next.
If you selected the Partition Replica Cache topology, you have to select a Replication Strategy, either Asynchronous or Synchronous.
Specify the node IP address in text box or select from the Network Neighborhood and click on the > button to add it in the Selected Nodes list.
Click Next once all the required nodes are added.
Change the Cluster Port if required.
In the next dialog, you can change the cache size if required.
In Advanced options dialog, you can configure the following settings:
You can change the eviction policy. The eviction policy will be configured and can be turned on.
You can also change the eviction percentage; items will be evicted from the cache using this percentage value if eviction is enabled.
You can change the clean interval value. Default is 15 seconds.
This cache can be started automatically upon the completion of this process if you have checked the Start this cache on Finish checkbox on this dialog.
You can make the cache to start automatically after service restart by checking the checkbox Auto start this cache on service startup.
Click Finish. Created cache will appear in Cache Explorer under Clustered Caches section.
Using Windows PowerShell
New-Cache cmdlet enables the user to create a new cache on one or more server nodes
The following command creates demoClusteredCache of replicated topology on server 184.108.40.206 with size 1024MB on port 7802.
New-Cache demoClusteredCache -Server 220.127.116.11 -Size 1024 -Topology replicated -Port 7802
Manually Editing NCache Configuration
For Community Edition, you can manually edit config.ncconf and client.ncconf located at %NCHOME%/config.
Make sure Cache Host Process is stopped before making any configuration changes. If it is not stopped and the changes are made, kill the Cache Host process and then start it.
- In config.ncconf of EACH of your cache server, add the following configuration under the
<configuration>tag which creates a Partitioned cache named demoCache with the servers 18.104.22.168 and 22.214.171.124, and uses all default configurations:
<cache-config config-version="0"> <cache-settings cache-name="demoCache" alias="" inproc="False" last-modified="" auto-start="False" data-format="Binary"> <logging enable-logs="True" trace-errors="True" trace-notices="False" trace-warnings="False" trace-debug="False" log-path=""/> <performance-counters enable-counters="True" snmp-port="0"/> <storage type="heap" cache-size="1024mb"/> <eviction-policy enabled-eviction="True" default-priority="normal" policy="priority" eviction-ratio="5%"/> <cache-topology topology="partitioned"> <cluster-settings operation-timeout="60sec" stats-repl-interval="60sec" use-heart-beat="False"> <cluster-connection-settings cluster-port="7802" port-range="1" connection-retries="2" connection-retry-interval="2secs" join_retry_count="24" join_retry_timeout="5"/> </cluster-settings> </cache-topology> </cache-settings> <cache-deployment deployment-version="1"> <servers> <server-node ip="126.96.36.199"/> <server-node ip="188.8.131.52"/> </servers> </cache-deployment> </cache-config>
- In client.ncconf, add the following description about the servers in the cache under the
<cache id="demoCache" load-balance="True" enable-client-logs="False" log-level="error"> <server name="184.108.40.206"/> <server name="220.127.116.11"/> </cache>
Make sure all these steps are repeated on all server nodes.
- Once changes are made, start the Cache Host process.
If you wish to add client nodes to this cache cluster, refer to the section Add Client Node in Cluster.
To add more servers to this cache cluster, refer to the section Add Server Node in Cluster.
Sometimes a cluster can not be formed, or cluster nodes are unable to communicate with each other. It may happen when Server and Cluster ports are blocked by firewall. Following error messages can occur in this case:
Error: "No server available to process request"
Error: "Unable to communicate with server node"
"No server available to process request":
Make sure that the Server port (at which NCache Service starts and accepts different client connections) is not blocked by firewall. Default value of this port is '9800'. You can change the default value from Alachisoft.NCache.Service.exe.config file.
"Unable to communicate with server node":
See if your firewall is allowing the Cluster port. Cluster port is a port at which nodes in a cluster communicate. You can change the default value of these ports from NCache Manager. If you have specified a port range in NCache Manager, unblock all ports in range.
NCache Manager unable to connect with NCache Service:
If NCache Manager is unable to connect with NCache Service, even when it is started, then your system firewall might be blocking Service port. Unblock Service port from system firewall.