> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/gridgain/gridgain-8/gridgain8-get-started/quick-start/cpp.md).

# C++

Install GridGain, start a cluster, build the C++ client, and run a simple Hello World example in C++.

This chapter explains system requirements for running GridGain and how to install GridGain, start a cluster, and run a simple Hello World example in C++.

Since GridGain is built on top of Apache Ignite, GridGain reuses Ignite's system properties, environment properties, startup scripts, etc. wherever possible.

## Prerequisites

GridGain C++ was officially tested on:

This section describes the platform requirements for machines running GridGain. GridGain system requirements scale depending on the size of the cluster.

| Requirement | Details                                                                                              |
| ----------- | ---------------------------------------------------------------------------------------------------- |
| JDK         | Oracle JDK 17 or later                                                                               |
| OS          | Linux (any flavor), Windows (10 and up). For Docker environment, we provide Linux docker containers. |
| ISA         | x86-64, SPARC, PowerPC                                                                               |
| Network     | No restrictions (10G recommended)                                                                    |

and:

| Software      | Version        |
| ------------- | -------------- |
| Visual Studio | 2010 and above |

### (Optional) Open Ports

Depending on your environment and what your plan is, you may want to open additional ports. GridGain uses the following ports:

* 47100-47200 — ports used by GridGain nodes to communicate. Specific ports used depend on node configuration.
* 47500-47600 — ports used by GridGain nodes to discover other nodes in the network. Specific ports used depend on node configuration.
* 10800 — the port used for [thin clients](/docs/connectors/gridgain-8/clients/getting-started-with-thin-clients.md), [JDBC](/docs/connectors/gridgain-8/sql/jdbc/jdbc-driver.md) and [ODBC](/docs/connectors/gridgain-8/sql/odbc/odbc-driver.md) connections.
* 8080 — the port used for [REST API](/docs/gridgain/gridgain-8/reference/rest-api.md).
* 11211 — the port used by [control script](/docs/gridgain/gridgain-8/reference/cli-tool.md) calls. This port should only be opened on nodes that need to send control script messages to other nodes.

## Installing GridGain

GridGain is distributed as binary, docker, and cloud images, and via RPM/DEB. This chapter explains how to install the binary distribution.

To get started with the GridGain binary distribution:

1. Download the [GridGain binary](https://www.gridgain.com/resources/download) as a zip archive.
2. Unzip the zip archive into the installation folder in your system.
3. Move the `ignite-rest-http` folder from `{gridgain}/libs/optional` to `{gridgain}/libs` to enable the Ignite REST library for the cluster. The library is used by GridGain Control Center for cluster management and monitoring needs.
4. (Optional) Enable required [modules](/docs/gridgain/gridgain-8/gridgain8-development/project-setup.md#enabling-modules).
5. (Optional) Set the `IGNITE_HOME` environment variable or Windows PATH to point to the installation folder and make sure there is no trailing `/` (or `\` for Windows) in the path.

## Starting a GridGain Node

You can start a GridGain node from the command line using the default configuration or by passing a custom configuration file. You can start as many nodes as you like and they will all automatically discover each other.

Navigate into the `bin` folder of GridGain installation directory from the command shell. Your command might look like this:

{% tabs %}
{% tab title="Unix" %}

```shell
cd {gridgain}/bin/
```

{% endtab %}

{% tab title="Windows" %}

```shell
cd {gridgain}\bin\
```

{% endtab %}
{% endtabs %}

Start a node with a custom configuration file that is passed as a parameter to `ignite.sh|bat` like this:

{% tabs %}
{% tab title="Unix" %}

```shell
./ignite.sh ../examples/config/example-ignite.xml
```

{% endtab %}

{% tab title="Windows" %}

```shell
ignite.bat ..\examples\config\example-ignite.xml
```

{% endtab %}
{% endtabs %}

You will see output similar to this:

```
[08:53:45] Ignite node started OK (id=7b30bc8e)
[08:53:45] Topology snapshot [ver=1, locNode=7b30bc8e, servers=1, clients=0, state=ACTIVE, CPUs=4, offheap=1.6GB, heap=2.0GB]
```

Open another tab from your command shell and run the same command again:

{% tabs %}
{% tab title="Unix" %}

```shell
./ignite.sh ../examples/config/example-ignite.xml
```

{% endtab %}

{% tab title="Windows" %}

```shell
ignite.bat ..\examples\config\example-ignite.xml
```

{% endtab %}
{% endtabs %}

Check the `Topology snapshot` line in the output. Now you have a cluster of two server nodes with more CPUs and RAM available cluster-wide:

```
[08:54:34] Ignite node started OK (id=3a30b7a4)
[08:54:34] Topology snapshot [ver=2, locNode=3a30b7a4, servers=2, clients=0, state=ACTIVE, CPUs=4, offheap=3.2GB, heap=4.0GB]
```

{% hint style="info" %}
By default, `ignite.sh|bat` starts a node with the default configuration file: `config/default-config.xml`.
{% endhint %}

{% hint style="info" %}
GridGain for C++ supports a thick client and a thin client. Because this guide focuses on the thin client, you can run the examples below, connecting to the Java-based nodes you just started. See [this section](https://mariadb.com/docs/gridgain/gridgain-8/gridgain8-get-started/quick-start/pages/OUSGdNs5HGVTk0HR0E50#thick-vs.-thin-clients) for more information about the differences between thick and thin clients in GridGain.
{% endhint %}

Once the cluster is started, you can use the GridGain C++ thin client to perform cache operations (things like getting or putting data, or using SQL).

## Building GridGain C++

GridGain ships with a robust `C++` client. To get started with GridGain `C++`, you will need to be familiar with building `C++` applications so that you can build GGCE for `C++` from the source files.

We suggest CMake for the GridGain `C++` build.

### Requirements

Common requirements:

* CMake 3.6 or later
* For Linux and macOS X, one of the following:
  * Clang 3.9 or later
  * GCC 3.6 or later
* For Windows:
  * Visual Studio 2010 or later
  * Windows SDK 7.1 or later

Core module requirements: [JDK](https://java.com/en/download/index.jsp)

{% hint style="info" %}
Building the core module is enabled by default. You can disable it by setting CMake option `-DWITH_CORE=OFF`.
{% endhint %}

Thin client module requirements: OpenSSL 1.0 or later

{% hint style="info" %}
Thin client module is disabled by default. You can enable it by setting CMake option `-DWITH_THIN_CLIENT=ON`.
{% endhint %}

### Building

Proceed as follows:

1. `cd $IGNITE_HOME/platforms/cpp`
2. `mkdir cmake-build-[release|debug]`
3. `cd ./cmake-build-[release|debug]`
4. Run the CMake configuration:
5. Build GridGain `C++`:

   ```shell
   cmake --build . --config [Release|Debug]
   ```

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Installing GridGain in the default installation directory is likely to require super-user privileges. If you don't have those, or if you don't want to install GridGain <code>C++</code> using those, make sure you have set the <code>CMAKE_INSTALL_PREFIX</code> as required in the previous step.</p></div>
6. Install GridGain `C++`:

   ```shell
   cmake --build . --target install --config [Release|Debug]
   ```

## Running the Thick Client Example

Proceed as follows:

1. `cd {gridgain_dir}/platforms/cpp/examples`
2. `libtoolize && aclocal && autoheader && automake --add-missing && autoreconf`
3. `./configure`
4. `cd put-get-example`
5. `make`
6. `./ignite-put-get-example`

## Next Steps

From here, you may want to:

* Read more about using [GridGain](/docs/gridgain/gridgain-8/gridgain8-development.md)
* Use [Control Center](/docs/tools/enterprise/control-center.md) to monitor your cluster
