Coherence CLI
The Coherence command line interface, cohctl, is a lightweight tool, in the tradition of tools such as kubectl, which can be scripted or used interactively to manage and monitor Coherence clusters. You can use cohctl to view cluster information such as services, caches, members, etc, as well as perform various management operations against clusters.
The Coherence CLI is installable on a variety of platforms and architectures including macOS, Linux and Windows. For more details, see Coherence CLI Installation.
Check the installation process for your operating system. For Linux or macOS, run the following command:
curl -sL https://raw.githubusercontent.com/oracle/coherence-cli/main/scripts/install.sh | bash
The 'add cluster' command adds a new connection to a Coherence cluster. For more details, see Clusters.
cohctl add cluster local -u http://<IP>:7001/management/coherence/latest/clusters
The Coherence CLI contains many commands to manage and monitor Coherence clusters. Given below are 2 commands that can be helpful in fetching details about the cluster named “local” and the service “callstate”. See the Commands reference.
The output of cohctl describe cluster local
is shown below.
CLUSTER
-------
Cluster Name: Coherence-Default
Version: 14.1.2.0.0
Cluster TotalSize: 2
License Mode: Development
Departure Count: 0
Running: true
MACHINES
--------
MACHINE PROCESSORS LOAD TOTAL MEMORY FREE MEMORY % FREE OS ARCH VERSION
n/a 11 1.8305664 36,864 MB 691 MB 1.88% Mac OS X aarch64 15.3.2
MEMBERS
-------
Total cluster members: 2
Storage enabled count: 1
Departure count: 0
Cluster Heap - Total: 1,024 MB Used: 324 MB Available: 700 MB (68.4%)
Storage Heap - Total: 512 MB Used: 169 MB Available: 343 MB (67.0%)
SERVICES
--------
SERVICE NAME TYPE MEMBERS STATUS HA STORAGE SENIOR PARTITIONS STATUS
"fabric:FabricPartitionedCache" DistributedCache 1 ENDANGERED 1 2 257 StatusHA is ENDANGERED
"fabric:FabricReplicatedCache" ReplicatedCache 1 ENDANGERED 1 2 1 StatusHA is ENDANGERED
InvocationService Invocation 1 n/a 0 2 - n/a
ReplicatedCache ReplicatedCache 1 ENDANGERED 1 2 1 StatusHA is ENDANGERED
callstate DistributedCache 1 ENDANGERED 1 2 257 StatusHA is ENDANGERED
flowstate DistributedCache 1 ENDANGERED 1 2 257 StatusHA is ENDANGERED
PERSISTENCE
-----------
Total Active Space Used: 0 MB
Total Backup Space Used: 0 MB
SERVICE NAME STORAGE COUNT PERSISTENCE MODE ACTIVE SPACE BACKUP SPACE AVG LATENCY MAX LATENCY SNAPSHOTS STATUS
"fabric:FabricPartitionedCache" 1 on-demand 0 MB 0 MB 0.000ms 0ms 0 Idle
callstate 1 on-demand 0 MB 0 MB 0.000ms 0ms 0 Idle
flowstate 1 on-demand 0 MB 0 MB 0.000ms 0ms 0 Idle
CACHES
------
Total Caches: 6, Total primary storage: 0 MB
SERVICE CACHE COUNT SIZE
"fabric:FabricPartitionedCache" "fabric-storage_near-occas-stats-FabricKey:SimpleData" 0 0 MB
"fabric:FabricPartitionedCache" fabric-ngstats-SYSTEM 0 0 MB
"fabric:FabricReplicatedCache" fabric-members 0 0 MB
callstate CallState 0 0 MB
callstate CallState.idx 0 0 MB
callstate CallState.meta 0 0 MB
TOPICS
------
The output of cohctl describe service callstate
is showen below.
SERVICE DETAILS
---------------
Name : callstate
Type : [DistributedCache]
Backup Count : [1]
Backup Count After Writebehind : [1]
Event Backlog : 0
Event Count : 1
Event Interceptor Info : [[Interceptors: [EventsHelper] ExceptionCount: 0 LastException: ]]
Indexing Total Millis : 7
Join Time : [2025-04-02T10:09:30.494+00:00]
Member Count : [1]
Messages Local : 55
Messages Received : 55
Messages Sent : 64
Outgoing Transfer Count : 0
Owned Partitions Backup : [0]
Owned Partitions Primary : [257]
Partitions All : [257]
Partitions Endangered : [257]
Partitions Unbalanced : [0]
Partitions Vulnerable : [257]
Persistence Environment : [SafeBerkeleyDBEnvironment(ActiveDirectory=null, SnapshotDirectory=/Users/srsvn/my_data/Projects/deployment/latest_installation/user_projects/domains/replicated_domain/coherence/snapshots/Coherence-Default/callstate)]
Persistence Latency Average : map[average:0 count:1 max:0 min:0 sum:0]
Persistence Latency Max : 0
Persistence Mode : [on-demand]
Persistence Snapshot Space Available: [0]
Persistence Snapshot Space Total : [0]
Quorum Status : [allowed-actions=distribution, restore, read, write, recover]
Refresh Time : [2025-04-02T11:32:04.935+00:00]
Request Average Duration : map[average:3 count:1 max:3 min:3 sum:3]
Request Max Duration : 16
Request Pending Count : 0
Request Pending Duration : 0
Request Timeout Count : 0
Request Timeout Millis : [0]
Request Total Count : 25
Running : map[true:1]
Senior Member Id : [2]
Statistics : [Cpu=1078ms (0.0%), Messages=55, Throughput=51.02041msg/sec, AverageActiveThreadCount=2.0179546E-7, Tasks=3, AverageTaskDuration=0.33333334ms, MaximumBacklog=0]
Status HA : [ENDANGERED]
Storage Enabled : map[true:1]
Task Average Duration : map[average:0.3333333432674408 count:1 max:0.3333333432674408 min:0.3333333432674408 sum:0.3333333432674408]
Task Backlog : 0
Task Count : 3
Task Hung Count : 0
Task Hung Duration : 0
Task Hung Threshold Millis : [30000]
Task Max Backlog : 0
Task Timeout Count : 0
Task Timeout Millis : [3000]
Thread Abandoned Count : 0
Thread Average Active Count : map[average:2.0179545856535697e-07 count:1 max:2.0179545856535697e-07 min:2.0179545856535697e-07 sum:2.0179545856535697e-07]
Thread Count : [20]
Thread Count Update Time : [1970-01-01T00:00:00.000+00:00]
Thread Idle Count : 20
Thread Pool Sizing Enabled : map[false:1]
Transport Backlogged Connection List: [[]]
Transport Status : [SocketMessageBus(tmb://192.168.0.103:63586.56838, state=OPEN, connections active=1/1)]
SERVICE MEMBERS
---------------
NODE ID THREADS IDLE THREAD UTIL MIN THREADS MAX THREADS
2 20 20 0.00% -1 -1
SERVICE CACHES
--------------
Total Caches: 3, Total primary storage: 0 MB
SERVICE CACHE COUNT SIZE
callstate CallState 0 0 MB
callstate CallState.idx 0 0 MB
callstate CallState.meta 0 0 MB
PERSISTENCE FOR SERVICE
-----------------------
Total Active Space Used: 0 MB
Total Backup Space Used: 0 MB
NODE ID PERSISTENCE MODE ACTIVE SPACE BACKUP SPACE AVG LATENCY MAX LATENCY
2 on-demand 0 MB 0 MB 0.000ms 0ms
PERSISTENCE COORDINATOR
-----------------------
Coordinator Id : 2
Idle : true
Operation Status: Idle
Snapshots : []
DISTRIBUTION INFORMATION
------------------------
Scheduled Distributions: No distributions are currently scheduled for this service.
PARTITION INFORMATION
---------------------
Service : callstate
Strategy Name : SimpleAssignmentStrategy
Average Partition Size KB : 0
Average Storage Size KB : 0
Backup Count : 1
Cluster : Coherence-Default
Coordinator Id : 2
Fair Share Backup : 0
Fair Share Primary : 0
HA Status : ENDANGERED
HA Status Code : 0
HA Target : There are no distribution analysis results.
Last Analysis Time : 1970-01-01T05:30:00.000+05:30
Location : AdminServer
Max Load Node Id : 0
Max Partition Size KB : 0
Max Storage Size KB : 0
Partition Count : 257
Remaining Distribution Count: 0
Responsibility : DistributionCoordinator
Service Machine Count : 0
Service Node Count : 1
Service Rack Count : 0
Service Site Count : 0
Type : PartitionAssignment