NCache 4.3 - Online Documentation

Using NCache in Amazon AWS cloud

Amazon cloud is called Amazon Web Services (AWS) and is a collection of remote computing services that together make up cloud computing platform, offered over the Internet by NCache provides support to deploy and use NCache distributed caching system in AWS cloud.
Here are main deployment scenarios for NCache.
Deployment scenarios:
Following are NCache deployment scenarios in cloud:
Deploy as EC2 Virtual Cloud Servers
This is single-site deployment of NCache in AWS cloud: NCache servers and remote clients is within same subnet in a virtual private cloud: (Most recommended)
Figure 1: Deploy as EC2 Virtual Cloud Servers
This is the most recommended scenario where NCache servers form a cache cluster and NCache clients (Applications deployed on EC2 virtual severs), everything is within one virtual private cloud and also within same Subnet. This ensures that there are no extra hops between NCache clients and servers for NCache communications which greatly improve performance.
Multi Site Deployment:
This is a multi-site deployment of NCache in AWS cloud: NCache servers and remote clients are on different virtual private cloud:
NCache cluster is created on EC2 virtual sever instances which are created in one virtual private cloud whereas NCache clients belong to another virtual private cloud.
Figure 2: Deploy as Cache Service (Multiple Apps Sharing Common Cache)
Configuration steps for “Deploy as EC2 Virtual Cloud Servers” Scenario:
Here is a step by step guide on how to configure NCache in AWS cloud for Deploy a virtual machines using Amazon EC2 instances. You will follow these steps for all cache servers and clients that are going to be part of the NCache and application deployment.
Step1: Create a Virtual private Cloud (VPC) for NCache:
NCache uses TCP/IP based communication protocol for cache server-server and client-server communications. You need to create a Virtual Private Cloud (VPC) that will be used for all NCache deployments (EC2 instances that are used for NCache cache servers and remote clients) later on.
Here is step by step guide on how to create VPC for NCache.
  • Create a new VPC by starting VPC wizard by opening the Amazon VPC console
  • Select the first option, VPC with a Single Public Subnet Only, and click Continue.
Note:  VPC with  Single Public Subnet Only is the most recommended option for NCache as all your instances run in a private, isolated section of the AWS cloud with direct access to the Internet.  You can use security groups to restrict any external traffic to NCache and only open application ports to external world.
There is another option, “VPC with Public and Private Subnets” where NCache instances run in private subnet and the application instances run in public subnet but this will involve security Groups to open communication ports between cache servers and applications and an extra hop for communication.
On next screen, verify the network settings (IP addresses) and then select “Create VPC”, this will create a VPC with selected network settings. This VPC will be assigned later on while creating EC2 cache server and remote client instances.
Here is a link that explains this in more details.
Step2: Create Security Group for NCache communication:
A security group acts as a virtual firewall to control the traffic allowed in and out of its associated instances and act at the instance level. It is generally recommended that there is no firewall between cache servers and remote clients and if there is firewall then you need to make sure that NCache ports are opened for communication.
Here is a step by step guide on how to create a security Group for NCache communication with details on Inbound and outbound communication ports.
  1. Open the Amazon EC2 console.
  2. In the VPC navigation pane, click Security Groups.
  3. Click Create Security Group.
  4. Specify the name (e.g. NCacheSecurityGroup) and description for the security group and then specify the VPC, select a VPC ID of the VPC created in above step and then choose Yes, Create.
  5. You can start adding rules by selecting the security Group on next screen and then add following NCache ports for both inbound and outbound communication of NCache. You can also add additional ports as needed within your environment.
NCache ports:
Cluster Ports: Cluster ports are assigned as 7802, 7804 for each new cluster. Make sure that cluster ports TCP (7800 to 7815) are open for inbound and outbound communication on all instances.
NCache Manager Ports: By default, NCache Manager uses TCP port 8250 and HTTP port 8251 for management activities. These should be open for inbound and outbound communications on all instances.
Client-Server Port: By default, NCache server listens to all requests from cache clients on port 9800. Open it for inbound and outbound communication on all instances.
6. Once rules are added for above mentioned NCache ports, you can assign this security group to our EC2 instances that you will create next.
Here is a link that explains this in more details.
Step3: Configure and Launch NCache EC2 instances:
Now configure Amazon EC2 virtual machine instances that you will use for NCache cache servers.
  • Specify VPC and Security Group for this AMI which is created in step1 and step2 above respectively. Here is a step by step guide on this.
  • Open the Amazon EC2 console at and click Launch Instance on Amazon EC2 dashboard.
  • On the Choose an Amazon Machine Image (AMI) page, select the AWS Marketplace category on the left.
  • Search “NCache” on this screen and then click Select NCache Enterprise AMI.
  • A dialog displays an overview of the product you've selected. You can view the pricing information, as well as any other information that the vendor has provided. When you're ready, click Continue.
  • On Choose an Instance Type page, select the hardware configuration and size of instance to launch. When you're done, click Next: Configure Instance Details.
  • On the next pages of the wizard, you can configure your instance, add storage, and add tags etc. Click next until you reach the Configure Security Group page.
  • Choose “Select Existing Security Group” and then specify the security group for this instance that you have created in Step2 above.
When you are ready, click Review and Launch
  • On the Review Instance Launch page, check AMI details as well as the other configuration details and then click launch to choose or create a key pair, and launch your instance.
  • It may take a few minutes or more to launch. When your instance is in the running state, you can connect to it. To do this, select your instance in the list and click Connect.
  • Follow same steps to launch all NCache instances.
Here is a more detailed link on how to launch an EC2 instance using AWS marketplace.
Step4: Configure NCache Service IP binding on cache server instances:
Once connected to your EC2 virtual machine instances then go ahead with NCache configurations. First step is to update NCache service IP bindings on cache server instances. This is required because NCache service needs an IP address for communication and NCache AWS AMI comes with a pre-configured IP address that needs to be updated with the current IP address of cache server instance. Here are steps for this.
  • Please do an “ipconfig” to know the current IP address of your NCache EC2 instances.
  • Open the NCache service configuration file (start->Programs->NCache-Configuration Files->Alachisoft.NCache.service.exe.config) in notepad. 
  • Update following two lines with your current IP address;
    <add key="NCacheServer.BindToClusterIP" value="" />
    <add key="NCacheServer.BindToClientServerIP" value=" " />
For example if your current IP address is you will update them as follows;
    <add key="NCacheServer.BindToClusterIP" value="" />
    <add key="NCacheServer.BindToClientServerIP" value="" />
  • Start NCache service from windows service control manager.
Step5: Configure a Clustered cache:
You can create a clustered cache choosing any caching topology preferably partitioned-Replica topology and then add client machines.
You can refer to configurations options for more details on NCache configurations.
See Also

© Copyright  2014 Alachisoft. All rights reserved.