Use NCache on Docker for Windows Server
Once the containers for NCache are created and started, you need to connect to the container and can use NCache using PowerShell cmdlets.
Connect to Container
Once the containers are created, you can 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 ContainerName).ID –RunAsAdministrator
You will be directed to the container instance and can seamlessly perform NCache tasks through this container.
Use NCache in Container
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:
- Import NCache PowerShell module.
- 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.
Import-Module ncacheps
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
See Also
Create NCache Containers on Windows Server
NCache Docker on Nano Server
NCache Docker on Linux