Create NCache Containers for Windows Server
Once you have set your Docker environment, you can now proceed to create containers for NCache Cache Server images hosted on Docker Hub for Enterprise and Professional editions.
Pull Docker Image
Execute the following command in Windows PowerShell or a shell of your choice to pull NCache Enterprise Server for Windows.
docker pull alachisoft/ncache:latest
NCache 5.0 Enterprise Server can also be downloaded from the following commands:
docker pull alachisoft/ncache
docker pull alachisoft/ncache:enterprise-server-5.0
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.
The following docker network create command creates a transparent network called transNet which contains subnet 20.200.20.0/24 and specifies the gateway as 20.200.20.1. You can change the values according to your own environment.
docker network create -d transparent --subnet=20.200.20.0/24 --gateway=20.200.20.1 transNet
Create Container from Image
Once the NCache image is pulled and the network is configured as transparent, you can create containers which host NCache and use them as cache servers.
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.
Note
NCache Enterprise container is created in Evaluation trial mode for 10 days. You can activate NCache license once you purchase it.
The following commands create the containers named ncache-ent-server-01
and
ncache-ent-server-02
in the shipped image
(alachisoft/ncache:enterprise-server-5.0) in detached mode using the configured
transparent network.
Important
mac-address
is a compulsory parameter. Failing to provide it will return in license activation being lost in case of container restart. This is a Docker limitation.
Note
Make sure that the sequence of parameters provided is as follows.
docker run -d --name=ncache-ent-server-01 --net=transNet --ip=20.200.20.201 --mac-address="xx:xx:xx:xx:xx:xx" alachisoft/ncache:enterprise-server-5.0
docker run -d --name=ncache-ent-server-02 --net=transNet --ip=20.200.20.202 --mac-address="xx:xx:xx:xx:xx:xx" alachisoft/ncache:enterprise-server-5.0
Activate NCache License
NCache Enterprise is installed in Evaluation mode for 10 days. Once that period is up, you can purchase NCache licenses. To activate the license for NCache Docker on Windows Server, you need to do the following:
Important
It is assumed you have obtained the license key from Alachisoft.
Change directory to %NCHOME%\bin\NActivate while in the container’s command line.
Execute the following command:
./NActivate.exe /f John /l Smith /e john@alachisoft.com /k XXXXXXXXX-XXXXXX-XXXXXXXX
This activates the license for John Smith.
For more details, you can refer to documentation on command line license activation here.