For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quick Start

Install and start GridGain 9, then run SQL queries against the cluster using the CLI tool.

This guide shows you how to start working with GridGain: install it, start the database, and run some simple SQL queries by using the provided CLI tool.

This guide uses the zip archive to demonstrate how to use GridGain. When using deb or rpm packages, or when running GridGain in Docker, some steps may be different.

If you are more comfortable with running the database from Java code, you can try starting GridGain from code.

Prerequisites

GridGain provides the database and CLI archives (gridgain9-db-<version>.zip and gridgain9-cli-<version>.zip). If you do not have them yet, or if you are interested in trying out GridGain 9, contact our support.

Install GridGain

1

Make sure you have the GridGain 9 database archive. It contains everything related to the GridGain database itself.

2

Make sure you have a GridGain 9 license.

3

Also make sure you have the archive with the GridGain command line interface. This tool is the main way of interacting with the GridGain database and is used in this tutorial.

4

Unpack the archives you received:

unzip gridgain9-db-9.1.zip
unzip gridgain9-cli-9.1.zip
Expand-Archive gridgain9-db-9.1.zip -DestinationPath .
Expand-Archive gridgain9-cli-9.1.zip -DestinationPath .
unzip -xf gridgain9-db-9.1.zip
unzip -xf gridgain9-cli-9.1.zip

Verify that the gridgain9-db-9.1 and gridgain9-cli-9.1 directories exist, along with the license file provided via e-mail.

Start GridGain Node

GridGain is a distributed database that runs on a collection of nodes - GridGain database instances that contain data. When running GridGain, you typically run multiple nodes - a cluster that shares information and evenly distributes data across its nodes. This part of the tutorial runs only one node, but a later part shows how to start multiple.

To start a locally running node:

1

Navigate to the gridgain9-db-9.1 directory.

2

Run the gridgain9db script:

bin/gridgain9db

You need to install Java in the Bash environment to run GridGain on Windows.

bash bin\gridgain9db

Start the GridGain CLI

The primary means of interacting with your nodes and cluster is the GridGain CLI. It can connect to a node running on a local or remote machine, and is the main tool that is used to manually configure and manage the database. In this example, you connect to a local node.

To start the GridGain CLI:

1

Navigate to the gridgain9-cli-9.1 directory.

2

Run the following command:

You need to install Java in the Bash environment to run GridGain on Windows.

3

Confirm the connection the CLI tool attempts to establish with the node running on the default URI.

4

If your node is running at a different address, use the connect command to connect to the node. For example:

Initialize Your Cluster

GridGain database functions as a cluster. Even if you are currently only running a single node, theoretically you could start another node and have it join the already running cluster. When the nodes are started for the first time, they find each other, form the physical topology and wait for the user to start the cluster.

The process of starting a cluster is called initialization. When the cluster is initialized, GridGain creates 2 RAFT groups, the cluster management group (nodes responsible for managing cluster operation) and the metastorage group (nodes storing authoritative copy of the cluster's metadata). Once these groups are formed, they validate other nodes in the cluster, which establishes logical topology. Once the initialization process is complete, the cluster is ready.

You need a GridGain 9 license to initialize your cluster. If you are interested in trying out GridGain 9, contact our support.

To initialize the cluster with the node you have started (see Start GridGain Node), run the following command. Replace $PATH_TO_LICENSE with the actual path to the directory where your configuration file is located:

  • The --license parameter specifies the path to the license file.

  • The --name parameter sets the cluster name. It can be changed later with the cluster rename CLI command or the cluster/rename REST endpoint.

Run SQL Statements Against the Cluster

Once your cluster has been initialized, you can start working with it. In this tutorial, you use the CLI tool to create a table, insert some rows, and retrieve data. In most real scenarios, a client writes data to a cluster and retrieves it, but the CLI tool can still be used for debugging or minor adjustments.

To work with the SQL in CLI:

1

Enter the SQL REPL mode. In this mode, you have access to SQL hints and command completion:

2

Use the CREATE TABLE statement to create a new table:

3

Fill the table with data using the INSERT statement:

4

Get all the data you inserted in the previous step:

5

If needed, exit the REPL mode with the exit command.

For more information about available SQL statements, see the SQL Reference section.

Stop the Node

After you are done working with your cluster, you need to stop the node by stopping the gridgain9db process:

  • Unix: Control + C

  • Windows: Ctrl+C

You can also exit the CLI tool with the exit command.

The cluster remains initialized and is ready again when you restart the node.

Extended Cluster Startup Tutorial

GridGain 9 is designed to work in a cluster of 3 or more nodes at once. While a single node can be used in some scenarios and can be used for the tutorial, having multiple nodes in a cluster is the most common use case. The steps below provide optional alternatives to starting your cluster, in case you want to run the tutorial on multiple nodes in a cluster that is closer to what would be encountered in real scenarios.

Optional: Starting Multiple GridGain Nodes in Docker

Docker installation does not persist data by default, and all data will be lost when the container is deleted. To learn how to persist data, see Getting Started with GridGain 9 Persistent Storage.

To run multiple instances of GridGain, you normally install it on multiple machines before starting a cluster. If you want to run a GridGain cluster on local VMs for this tutorial, we recommend using a Docker image:

1

Download the docker-compose file.

Docker compose version 2.23.1 or later is required to use the provided compose file.

2

Download the Docker image:

3

Run the Docker compose command, providing the previously downloaded compose file:

3 nodes start in Docker and become available through the CLI tool that can be run locally.

4

Initialize your cluster before attempting to work with it. Replace $PATH_TO_LICENSE with the actual path to the directory where your configuration file is located:

This tutorial assumes that you are running the CLI tool locally. If you are running it from Docker, make sure to mount a volume for the license.

Optional: Start Multiple GridGain Nodes on Different Hosts

In the examples above, you ran a single node or a small cluster that used predefined configuration. Creating a GridGain cluster on several hosts involves adjustments to its configuration.

List all Nodes in NodeFinder

When nodes are running, they use the node finder configuration. When the node starts, it loads the configuration file from /etc/gridgain-config.conf. Add the addresses to the network.nodeFinder configuration, for example for the 3-node cluster:

Now, when the node starts, it automatically tries to find nodes at the listed addresses. You can see the current configuration of a running node at any point by running the following command from the CLI tool:

If the node is already running, you can also use the CLI tool to change node configuration, for example:

This change requires a node restart to take effect.

Change Node Names

You need to make sure that all nodes in the cluster have different names. The node name is defined in the /etc/vars.env file. Change the NODE_NAME variable so that each node in the cluster has a unique name; nodes with conflicting names cannot enter the same cluster.

Start all Nodes

Start each node as described in Start GridGain Node.

Initialize Your Cluster

Before initializing the cluster, it is important to check that all nodes found each other and can connect into a cluster. Nodes visible to each other, but not necessarily connected into a cluster form physical topology. You can check it by connecting to any node using the CLI tool and executing the following command:

The command lists the nodes visible to the node you are connecting to, their addresses, names, and IDs. Once you are certain all nodes are running and visible, initialize your cluster. Replace $PATH_TO_LICENSE with the actual path to the directory where your configuration file is located:

Once the cluster starts, the nodes in it form the logical topology. You can check whether all nodes have entered the cluster by using the following command:

If all nodes are in the command output, the cluster is now started and can be worked with.

Next Steps

From here, you may want to:

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?