How to Manage Cluster Lifecycle With the REST API
Monitor node startup, initialize a cluster, and verify health using REST endpoints on GridGain 9.
Prerequisites
A running 3-node cluster from How to Start a Cluster with Docker Compose
curl and jq for JSON parsing
Ports 10300-10302 accessible on your machine
Overview
Every GridGain 9 node exposes a REST management API on port 10300. The API is available as soon as the node's HTTP server starts, before the cluster is initialized. This guide walks through each REST endpoint in the order you use them during startup: check node state, verify discovery, initialize the cluster, and confirm health. Both products share the same REST API paths and response formats. The differences are the license field in the GridGain 9 initialization request and the product name and version number in the version response.
Use this guide when you need scriptable cluster management, want to diagnose startup issues, or are building automation around cluster lifecycle.
Check Node State
Query the node state endpoint to confirm the REST API is reachable. This is the most reliable boot indicator across all product versions.
curl -s http://localhost:10300/management/v1/node/state | jq .Expected response (before initialization):
{
"name": "node1",
"state": "STARTING"
}A node reports one of three states:
STARTING
The node process is running but has not joined a cluster
STARTED
The node has joined a cluster and is fully operational
STOPPING
The node is shutting down
The REST server starts partway through the boot sequence, before all components are ready. If the connection is refused, the HTTP server has not started yet. Retry after a few seconds.
STARTING is expected at this point. It confirms the node is running and ready for further interaction.
Verify Node Identity and Version
Confirm you are talking to the expected node and check the product version.
Expected response:
Check the product version:
Confirm Node Discovery
Before initializing, verify that all nodes have discovered each other through the internal cluster network.
Expected response (abbreviated):
The physical topology lists every node that has announced itself over port 3344, whether or not the cluster is initialized. Each entry has the node's name (stable across restarts), its internal address, and REST metadata. In Docker, restHost is the container's hostname, not its IP address. The id (a UUID that changes on every restart) is omitted above.
Wait until all expected nodes appear before proceeding. Node names are case-sensitive and must match exactly when referenced in the initialization request. Nodes that have not discovered each other cannot participate in cluster formation.
Initialize the Cluster
Cluster initialization is a one-time operation that creates the Cluster Management Group (CMG) and MetaStorage RAFT groups, assigns a cluster name, and opens the cluster for client connections. Send the request to any single node. It propagates to all discovered nodes.
GridGain 9 requires a license in the initialization request. The license field is a JSON string, so encode the license file with jq -Rs, which escapes the quotes and line breaks in the file. Pasting the raw file content into the request fails with 400 Invalid JSON. A license token (a single line of text issued by MariaDB) is accepted in the same field and is encoded the same way:
A successful initialization returns HTTP 200 with an empty response body. The endpoint blocks until the receiving node has fully joined the cluster, so the response itself confirms that at least one node has transitioned to STARTED.
The request fields:
metaStorageNodes
No
Nodes hosting the MetaStorage RAFT group. Use an odd number (1, 3, or 5) for quorum.
cmgNodes
No
Nodes hosting the CMG RAFT group. Defaults to metaStorageNodes if omitted.
clusterName
Yes
Human-readable cluster name. Must not be blank.
clusterConfiguration
No
Initial cluster configuration in HOCON format.
license
Yes
License key content.
If you omit both metaStorageNodes and cmgNodes, the cluster auto-selects nodes: all nodes for clusters of 1-3, three nodes for clusters of 4, and five nodes for clusters of 5 or more. Nodes are selected alphabetically by name.
Verify Cluster Health
After initialization completes, verify that the cluster is operational and all nodes have joined.
Query the cluster state:
Expected response:
The cmgNodes field lists nodes hosting the Cluster Management Group and msNodes lists nodes hosting MetaStorage. Both should contain all three nodes for a standard 3-node development cluster. The igniteVersion field reflects the product version.
Verify that each node has transitioned to STARTED:
Expected output:
Explore Post-initialization Endpoints
Before initialization, most REST endpoints return 409 CONFLICT. After initialization, the full API becomes available. Query the logical topology to see nodes that are participating in distributed operations:
This returns the same node list as the physical topology, but only includes nodes that have successfully joined the cluster. Other endpoints now available include:
/management/v1/cluster/state- Cluster metadata (CMG nodes, MetaStorage nodes, version)/management/v1/configuration/cluster- Read and update cluster-wide configuration (HOCON)/management/v1/cluster/topology/logical- Nodes participating in distributed operations
Troubleshooting
These endpoints form the foundation for scripted cluster management. You can extend them into health-check scripts, CI/CD pipeline steps, or monitoring integrations that poll node state and cluster topology.
Related
How to Start a Cluster with Docker Compose - Set up the 3-node development cluster this guide manages.
Start Your Local GridGain 9 Development Cluster - Tutorial that walks through cluster setup with deeper context and loads the Music Store dataset.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

