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
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
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
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 126.96.36.199 -Size 1024 Add-Node -CacheName demoCache -ExistingServer 188.8.131.52 -NewServer 184.108.40.206 Start-Cache -CacheName democache Add-TestData -CacheName democache –ItemCount 50 Get-CacheCount -CacheName democache