Just released, the latest version of the Coherence CLI allows you to create and start a development cluster with just a few key-strokes!
The Coherence CLI was initially released in January 2022 and allows you to manage and monitor Coherence clusters from a command line. Over the last 8 months or so we have added news features and functionality to the CLI.
With the latest release (1.4.2), we have added a new experimental feature which allows you to easily create, start and managed local development clusters. See the original Medium post. Once you have created the clusters, you can manage and monitor them using the CLI.
You must have the following installed to use the CLI.
- JDK 17 and Maven 3.6+ available on your PATH.
- Latest Coherence CLI version for your platform – installation instructions
Creating a Cluster
To create a cluster with the name my-cluster, issue the following:
$ cohctl create cluster my-cluster Cluster name: my-cluster Cluster version: 22.09 Cluster port: 7574 Management port: 30000 Replica count: 3 Initial memory: 512m Persistence mode: on-demand Group ID: com.oracle.coherence.ce Additional artifacts: Startup Profile: Dependency Tool: mvn Are you sure you want to create the cluster with the above details? (y/n)
Once you confirm this operation, the CLI will download the required dependencies using Maven and configure and start the cluster.
Checking 3 Maven dependencies... - com.oracle.coherence.ce:coherence:22.09 - com.oracle.coherence.ce:coherence-json:22.09 - org.jline:jline:3.20.0 Starting 3 cluster members for cluster my-cluster Starting cluster member storage-0... Starting cluster member storage-1... Starting cluster member storage-2... Current context is now my-cluster Cluster added and started
Note: The cluster created is scoped to the local machine by using the loopback address for the cluster address.
Displaying the Members
You can issue the following command to display the members in the created clusters:
$ cohctl get members
Scaling the Cluster
You can scale the cluster to 6 members by using the following:
$ cohctl scale cluster my-cluster -r 6
Exploring More Commands
Once your cluster is up and running, you can manage monitor and work with the cluster using the vast number of CLI commands, a few of which are included below:
- Start the Coherence console against the newly created cluster –
cohctl start console
- Start CohQL –
cohctl start cohql
- Display services –
cohctl get services
- Display caches –
cohctl get caches
- Show the cluster information –
cohctl describe cluster my-cluster
- Retrieve Thread Dumps –
cohctl retrieve thread-dumps
- Display Coherence Reporters –
cohctl get reporters
- Display Persistence information –
cohctl get persistence
There are many more commands available for monitoring and managing Coherence clusters, both manually created development clusters and your production clusters.
For an extensive list of these commands, see the online command reference.
This is only a short introduction to the new features of the CLI. If you would like to know more information, see the following resources: