Coherence CLI 1.4.1 Released

Tim Middleton
Oracle Coherence
Published in
3 min readOct 4, 2022

We are pleased to announce that the latest version of the Coherence CLI has been released!

Coherence CLI — Creating a cluster
Creating a cluster

As well as a few bug fixes, this version of the CLI introduces a new experimental feature that allows you to create, scale and manage local development Coherence clusters. This feature is available for Coherence CE 22.06.x and Commercial 14.1.1.2206.x versions and above.

This is a great way to quickly get started using Coherence.

Pre-requisites

To use this feature you must have the following configured:

  1. Java 17+ executable on the PATH, if you are using the default Coherence CE 22.09 or above.
  2. Maven 3.6+ or JDK compatible Gradle version 7.+ executable on the PATH.

Note: Maven is used by default for dependency resolution and classpath generation, but if you prefer Gradle, then use the following: cohctl set use-grade true

Creating a Cluster

Once you have installed the latest CLI version, to create a Coherence cluster, simply use the cohctl create cluster cluster-name command.

By default, the CLI includes coherence and coherence-json artefacts. The coherence-json dependency is the minimum required to enable management over REST. Jline is also included for command history in CohQL, but you can also include your own Maven dependencies by using the -a option. See the documentation for full examples.

Note: The CLI uses mvn or gradle under the covers to download the required artefacts and generate the classpath using these. The initial cluster creation may take a few minutes if you do not have these artefacts locally.

When creating clusters, there are sensible defaults including: using the latest CE 22.09 release, enabling management on port 30000 and starting 3 servers.

Next, we set the context, get the clusters and show the members.

Note: Once the cluster is running, you can manage and monitor in exactly the same way as for clusters you have previously discovered and worked with using the CLI.

Stopping, Starting & Scaling Clusters

Once you have a cluster running, you are able to stop, start and scale up the cluster using various flags to set memory, replicas, log-levels and more. You can see below the options for starting a cluster.

Below, we start the cluster with 4 replicas and only using 256m instead of the default of 512m and then scale it out to 5 cluster members.

Note: The log files are stored in a directory under ~/.cohctl/logs/ for each cluster.

Starting Coherence Query Language or Console

Once a local development cluster is running you can run CohQL to add or modify data in you cluster.

In the following, we start the Coherence console and use the bulkput , equivalent to a putAll() to add 100,000 objects of size 100.

Next Steps

This is a short introduction to this experimental new feature but there are many other options to explore when creating and starting clusters with the new CLI:

  1. Changing persistence modes
  2. Startup up with metrics enabled and auto-incrementing metrics port
  3. Using commercial groupId
  4. Changing management ports if you have multiple clusters running
  5. Using profiles to modify your startup parameters
  6. Including your own dependencies, and more…

Have a try of these new features and let us know of any feedback, or any features you might like added.

For more information, please see:

--

--