Try Playground
Show / Hide Table of Contents

Create Cache Cluster in Amazon Elastic Kubernetes Service

After deploying all necessary services, now you need to create a cache cluster inside your Amazon Elastic Kubernetes Service cluster. You can create a cache cluster either through NCache Management Center or through NCache PowerShell module (ncacheps).

Note

You can only use NCache PowerShell module if your NCache client image is deployed using .NET SDK instead of runtime.

Amazon Elastic Kubernetes Service: Using NCache Management Center

Follow the steps mentioned below to create a cache cluster through NCache Management Center.

  • To access the NCache Management Center within the Amazon Elastic Kubernetes Service cluster, you need the URL of the NCache ingress. Execute the following command to get this URL:
kubectl get ingresses

Assuming you’ve named your NCache ingress resource as ncache, you will get something like the following output if successful:

Name            HOSTS                    ADDRESS                           PORTS                    AGE
ncache            *             xxx.<eks-region>.elb.amazonaws.com          80                      32s
  • Copy the value under the ADDRESS into your browser address bar and you will be directed the NCache Management Center service on one of the cache nodes running inside the Amazon Elastic Kubernetes Service cluster.

ncweb-manager-gateway-access

From here you need to create a cache cluster. Follow the steps provided in Create New Clustered Cache to create a new cache cluster using NCache Management Center.

Important

Make sure the server IP addresses are the same as the ones shown in the result of the following command

kubectl get pods -l app=nccache -o wide

Using PowerShell

You can create a cluster and add nodes to it through NCache PowerShell tool. Follow the steps provided below:

  • Run NCache PowerShell by executing the following command in AWS command line interface:

    kubectl exec <client_pod_name> -- pwsh -NoExit
    
  • Follow the steps mentioned in Create Cache Cluster to create a cache cluster and add nodes to it through NCache PowerShell.

Important

The node IPs when adding server nodes to the cluster should be the same as the IPs mentioned when the following command is executed:

kubectl get pods -l app=ncache -o wide
Note

Start cache on all server nodes.

Connect Clients to Cache

After the cache cluster is created and the cache is started on all nodes, connect clients to the cache. You can do this by following any of the given methods:

Using GetCache() API

  • Connect to the cache using the GetCache() method of NCache.

  • To connect clients to your cache, follow the steps provided in Connect to Cache.

  • The following code snippet shows how the cache discovery service can be introduced when initializing the cache handle:

ICache cache = CacheManager.GetCache("democlusteredcache", new CacheConnectionOptions
{
    ServerList = new List<ServerInfo> { new ServerInfo("cacheserver")}, // other parameters
});

Using the Client Config File

  • Go to your client.ncconf file placed at %NCHOME%/config in Windows and at opt\ncache\config in Linux machines.
  • Add the name of the cache headless discovery service created earlier in Create Discovery Service in Amazon Elastic Kubernetes Service in the <server name> tag under the name of your cache cluster as shown below:
<cache id="democlusteredcache" ...">
    <server name="cacheserver"/>
</cache>

Run NCache Client

Now that you have your cluster set up, you need to run your client application by executing the following command in the AWS command line interface.

kubectl exec --namespace=ncache client-podname -- /app/clientapplication/run.sh democlusteredcache cacheserver

Once the cache cluster is formed and clients are connected to it, you can monitor your cache cluster and clients, explained in the next chapter.

See Also

Create NCache Client in EKS
Create NCache Client Deployment in EKS
Monitor NCache Cluster and Clients in EKS
Adding Cache Servers in EKS at Runtime
Removing Cache Servers in EKS at Runtime

In This Article
  • Amazon Elastic Kubernetes Service: Using NCache Management Center
  • Using PowerShell
  • Connect Clients to Cache
    • Using GetCache() API
    • Using the Client Config File
  • Run NCache Client
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top