• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Show / Hide Table of Contents
  • Administrator's Guide
  • NCache Architecture
    • Cache Topologies
    • Cache Cluster
    • Local Cache
    • Cache Client
    • Client Cache
    • Data Load Balancing
    • Cache Server Backward Compatibility
    • Client Backward Compatibility
    • Eviction
    • Indexing
    • Runtime Data Sharing
    • Portable Data Types
    • Class Versioning
    • IP Binding with Multiple NICs
    • Graceful Node Down
    • Separate Cache Host Process
    • Self Healing Dynamic Clustering
  • Configuring Caches
    • Create Cache
      • Creating Local Cache
        • Create New Cache
        • Add Existing Cache
      • Creating Clustered Cache
        • Create New Cache Cluster
        • Add Existing Cache Cluster
    • Remove Cache
    • Clear Cache Contents
    • Adding Server Node in Cache Cluster
    • Removing Server Node from Cache Cluster
    • Configuring Basic Cache Settings
      • Cache Size
      • Cache Isolation Levels
      • Cache Data Expiration
      • Cache Data Format
    • Configuring Cache Cluster Settings
      • Ports
      • Operation Timeout
      • Static Replication Interval
      • Connection Retries
      • Retry Interval
    • Add Test Data to Cache
    • Deploy Providers
    • Configuring Query Indexes
    • Registering Classes for Compact Serialization
      • Registering Non-Generic Classes
      • Unregistering Non-Generic Classes
      • Registering Generic Classes
      • Registering Generic Classes Using Generic Type Handler
    • Registering Classes for Portable Data Sharing
    • Configuring Data Source Providers
      • Read-Through Provider
      • Write-Through Provider
      • Write-Through Provider for Write-Behind Operations
    • Configuring Cache Startup Loader
    • Configuring Cache Level Events
    • Configuring Cache Activity Events
    • Configuring Eviction Policy
    • Configuring Compression
    • Configuring Email Notifications
    • Binding Cluster and Client/Server IP with Multiple NICs
      • Binding Cluster with a Dedicated IP
      • Binding Client/Server with a Dedicated IP
    • Configuring Heartbeat
    • Configuring MapReduce
    • Configuring Communication Reliability
    • Auto Start Cache on Boot
    • Nagling
    • Dual Socket
    • Error Logging
    • Configuration Files
      • Client Side Configurations
        • Client Config
        • EFCaching Config
      • Server Side Configurations
        • Cache Config
        • Bridge Config
        • Security Config
      • Cache Server Configuration
  • Management Operations
    • Start Cache
    • Stop Cache
    • Restart Cache
    • Manage Cache Service on a Server Node
    • Apply Configuration
    • Hot Apply Configuration
    • Reset Configuration
    • Data Load Balancing
  • Configuring Cache Clients
    • Adding Client Node in Cluster
    • Removing Client Node from Cluster
    • Configuring Client Node Settings
    • Creating Client Cache
    • Enable Client Cache on Client Nodes
    • Disable Client Cache on Client Nodes
    • Removing Client Cache
    • Configuring Client Cache Settings
  • Configuring Security
    • Configuring Security for Cache Management
    • Configuring Security for Cache
    • Configuring Security for Client Nodes
    • Configuring Encryption for Cache
    • Configure SSL/TLS Encryption in NCache
  • Configuring Bridge for WAN Replication
    • Creating Clustered Bridge
    • Adding Clustered Caches to Bridge
    • Configuring Bridge Settings
    • Configuring Conflict Resolver
    • Changing Cache Syncronization Modes
    • Configuring Master Cache
    • Force State Transfer
    • Connect/Disconnect Cache in Bridge
    • Remove Cache from Bridge
    • Bridge Management
  • NCache on Docker
    • Using NCache Docker Images
    • Customize NCache Dockerfile
  • Monitoring NCache
    • Cache Counters
    • Monitoring Caches using NCache Manager
      • Changing Management Port of Cache Node
      • Configuring Counters to Display
      • Browse Cache Statistics
      • Cluster Health
      • Monitoring Cache Clusters using NCache Email Alerts
    • Monitoring Caches using NCache Monitor
      • Monitoring with Built-In Dashboard
      • Monitoring with Custom Dashboard
    • Monitoring Bridge using NCache Manager
    • Monitoring NCache using Windows PerfMon Tool
      • Monitoring Cache Server Counters Using PerfMon
      • Monitoring Cache Client Counters Using PerfMon
      • Monitoring Bridge Counters Using PerfMon
    • Logging in NCache
      • NCache Log Viewer
      • NCache Monitor Logging
      • Performance Counters Logging
      • Windows Event Logging
      • Email Notifications on NCache Events
      • Cache Server Logging
      • Client Side API Logging
      • Cache Event IDs
    • Troubleshooting NCache Monitoring
      • Computer Name Not Found
      • Diskperf Not Installed
      • No READ Access to the Perflib Subkeys
      • Unable to Connect to Remote Server
    • IPV6 Support
  • Upgrading NCache Versions
    • Live Upgrade NCache Version
    • Upgrade NCache Version Offline
  • Apply Windows Patches on NCache Server

Using NCache Images

NCache provides Docker images for the following editions and components located at Alachisoft NCache’s repository on Docker Hub:

  • NCache 4.9 Enterprise Server
  • NCache 4.9 Enterprise Client
  • NCache 4.9 Community Server
  • NCache 4.9 Community Client

Pull Image from Source

Once the Docker environment has been set, pull the NCache hosted images from Docker Hub.

The following command pulls the ncache:server-enterprise-4.9 image and uses it throughout the chapter.

docker pull alachisoft/ncache:enterprise-server-4.9

NCache 4.9 Enterprise Server can also be downloaded from the following commands:

docker pull alachisoft/ncache

docker pull alachisoft/ncache:latest

Configure Transparent Network

Transparent network uses IPs from host network and each container is assigned a separate virtual NIC. This network best suits network configuration needed for NCache. Each container acts as a separate node and can communicate across hosts on the same network, meaning that the NCache cluster can be managed anywhere from that network. Containers attached to a network created with the transparent driver will be directly connected to the physical network. IPs from physical network can be assigned statically or dynamically.

Important

It is highly recommended to use static IPs for each container as all future connections will take place using this IP. These IPs should exist in the IP range specified in the transparent network created.

Following script creates a transparent network called transNet which contains subnet 20.200.20.0/24 and specifies the gateway as 20.200.20.1.

docker network create -d transparent --subnet=20.200.20.0/24 --gateway=20.200.20.1 transNet

Create Container from Image

Once the image is pulled, you can create containers which host NCache and use it. You can limit the container’s resources at this point, as Windows container does not support altering container’s CPU or memory once it is created. Moreover, you can assign different network interfaces to the container and mount shared volumes between containers and host.

The container can be created with either docker run or docker create command, the difference being docker run starts the container when it is created.

Important

It is highly recommended to use static IPs for each container as all future connections will take place using this IP. These IPs should exist in the IP range specified in the transparent network created.

Note that while creating containers, the image specified should exist locally. If not, the image is then fetched from Docker Hub if the name of the repository is specified.

The following commands create the containers named ncache-server-01 and ncache-server-02 in the shipped image (alachisoft/ncache:server-enterprise-4.9) in detached mode using the configured transparent network:

docker run -d --name=ncache-ent-server-01 --net=transNet --ip=20.200.20.251 alachisoft/ncache:server-enterprise-4.9

docker run -d --name=ncache—ent-server-02 --net=transNet --ip=20.200.20.252 alachisoft/ncache:server-enterprise-4.9

Connect to Container

You can now access these containers remotely, by using Enter-PSSession command and specifying the container name of the newly created container. The get-container command returns the container ID which is used as a value for the ContainerId parameter.

Enter-PSSession -ContainerId (get-container -Name ncache-ent-server-01).ID –RunAsAdministrator

You will be directed to the container instance and can seamlessly perform NCache tasks through this container.

Use NCache in Docker (Examples)

Once connected to the container, you can perform administrative tasks through NCache PowerShell commands. This includes managing caches, clusters, security and deploying providers and much more.

For starters, you can verify NCache installation through Get-NCacheVersion cmdlet. This lists the NCache version detail along with licensing information. You can proceed to using NCache within Docker now.

For example, the following commands perform the following tasks:

  • Displays status of the NCache service.
  • Create a new partitioned cache and add a new node to it.
  • Start the cache and add test data of 50 items to it.
  • Verify the cache count.
Get-Service -Name "NCacheSvc"

New-Cache -CacheName democache -Topology Partitioned -Server 20.200.20.251 -Size 1024

Add-Node -CacheName demoCache -ExistingServer 20.200.20.251 -NewServer 20.200.20.252

Start-Cache -CacheName democache

Add-TestData -CacheName democache –ItemCount 50

Get-CacheCount -CacheName democache
Back to top Copyright © 2017 Alachisoft