Install and Configure NCache RESP Server on Windows
NCache RESP Server enables Redis client applications to connect to an NCache cache using the Redis Serialization Protocol (RESP). The following steps explain how to install and configure NCache RESP Server on Windows, create a clustered cache, review its automatically configured RESP listener, and verify Redis client connectivity.
Step 1: Install NCache on Windows
Install NCache on both Windows servers that will host the distributed cache. You can install NCache silently using the MSI installer:
- Obtain an evaluation license key from the NCache Downloads page.
- Open Command Prompt using Run as Administrator.
- Run the following command, replacing the placeholder with your evaluation license key:
msiexec.exe /i https://download.alachisoft.com/ncache/ncache-5.3.8.msi KEY="xxxxxxxx" /qn
- Repeat the installation on each participating server node. The
/qnoption runs the installation without displaying the Setup Wizard.
For the complete download, registration, and installation procedure, see Getting Started with NCache on Windows and Windows Installation.
Step 2: Create a Distributed Cache
Create a distributed cache on the NCache servers. The following example creates a two-node Partition-Replica cache named defaultCache on 20.200.20.11 and 20.200.20.12. The following steps verify that both servers expose the cache through RESP with CRC16 routing enabled.
Note
For the best RESP performance and scalability, configure your Redis clients to use the CRC-Compliant Cluster connection model. It routes requests directly to the server that owns each key, avoiding unnecessary server-to-server forwarding.
- Open PowerShell on a machine that can access the NCache servers.
- Run the following command to create a distributed cache with a size of 1024 MB:
New-Cache -Name defaultCache -Server "20.200.20.11,20.200.20.12" `
-Size 1024 -Topology PartitionReplica -ClusterPort 9851 `
-InMemoryStoreType DistributedCache
- Once the cache is created, NCache automatically adds the corresponding RESP listener entry to resp.ncconf and assigns an available RESP port.
You can also create a distributed cache using the NCache Management Center. For detailed procedures, see Create a Distributed Cache or the New-Cache PowerShell reference.
Step 3: Verify NCache RESP Server Configuration
When a cache is created through NCache Management Center or the New-Cache PowerShell cmdlet, NCache automatically enables its RESP listener and adds the corresponding entry to resp.ncconf. An available port is assigned from the reserved RESP range 9981–9989, without requiring manual listener or port allocation within that range. Before using CRC-Compliant Cluster routing, verify that crc-enabled="true" is configured for defaultCache on both servers.
Open <InstallDir>\config\resp.ncconf on both 20.200.20.11 and 20.200.20.12, and locate the entry for defaultCache. The example below shows an enabled RESP listener with CRC16 routing on port 9981. In a new deployment, both servers may use port 9981 if it is available on each; otherwise, use the actual port assigned on each server.
<configuration>
<resp-servers>
<resp-server cache-id="defaultCache" enabled="true" crc-enabled="true" port="9981" max-connections="1000" idle-timeout="0"/>
</resp-servers>
</configuration>
The listener attributes are described below. Confirm that the defaultCache entry has enabled="true" and crc-enabled="true" on both nodes before testing. CRC-Compliant Cluster also requires Redis-compatible CRC16 key hashing across the cluster; see CRC-Compliant Cluster for the routing model. Do not assume that automatic RESP listener creation alone verifies CRC16 cluster routing.
| Attribute | Description |
|---|---|
cache-id |
Specifies the cache exposed through the RESP listener. |
enabled |
Enables or disables the RESP listener for the specified cache. |
crc-enabled |
Enables Redis-compatible CRC16 cluster routing when set to true. Set it to false to use server-side request forwarding. |
port |
Specifies the TCP port used by Redis clients to connect to the listener. |
max-connections |
Specifies the configured maximum number of client connections. |
idle-timeout |
Specifies the idle connection timeout in seconds. A value of 0 disables the idle timeout. |
Important
The crc-enabled attribute is not supported in NCache Open Source. Omit this attribute when configuring the RESP listener in that edition.
RESP Port Allocation and Cache Removal
NCache automatically assigns RESP ports for up to nine caches per server, using the reserved range 9981–9989. Each cache listener on the same server receives a separate available port. If all nine ports are allocated, configuring RESP for additional caches requires manual changes to the port mapping. When a cache is removed through NCache Management Center or the corresponding PowerShell cmdlet, NCache automatically removes its RESP listener entry from resp.ncconf, making its assigned port available for reuse.
Step 4: Start the Distributed Cache
Start the newly created distributed cache on its server nodes before connecting Redis clients.
- Open PowerShell.
- Run the following command to start
defaultCacheon both server nodes:
Start-Cache -Name defaultCache -Server "20.200.20.11,20.200.20.12"
- Verify that the cache is running on the participating nodes.
You can also start the cache using the NCache Management Center. For detailed instructions, see Start Cache or the Start-Cache PowerShell reference. To stop a running cache, see Stop-Cache.
Step 5: Verify Redis Connectivity
Once the cache is running, use redis-cli to verify that each node responds through its RESP listener. For the example in which both servers have port 9981 available, run the following commands separately:
redis-cli -h 20.200.20.11 -p 9981 PING
redis-cli -h 20.200.20.12 -p 9981 PING
Each command should return PONG if the listener is reachable and does not require authentication. If your cache uses different assigned ports, substitute the values from resp.ncconf; for application connection examples, see Connect to NCache RESP Server.
See Also
NCache RESP Guide
What is NCache RESP Server?
Connect to NCache RESP Server
NCache RESP Server Security