GridGain Developers Hub

Connecting a GridGain Cluster

This page explains how to connect a GridGain cluster to Control Center. You can connect as many clusters as you want. Control Center allows you to switch between clusters at will.

A standard procedure for connecting a GridGain cluster to Control Center involves the following steps:

  1. Configure your cluster

    1. Enable the Control Center Agent module

    2. Enable metrics

    3. Optionally, enable tracing

    4. Optionally, assign a user-friendly name to the cluster

    5. In case of a custom installation of Control Center, set the URI of Control Center in your cluster

  2. Register the cluster in Control Center

The following diagram illustrates how Control Center interacts with the cluster and the web browser.

Connect GridGain Cluster to Control Center

Configuring Your Cluster

Enabling the Control Center Module

The connection between the cluster and Control Center is initiated from the cluster side.

For this to happen, you need to enable the control-center-agent module in the cluster. The module must be enabled on all server nodes. If you plan to connect client nodes to your cluster, enable the module on the client nodes as well. Otherwise, you will get the following exception on the client node:

java.lang.ClassNotFoundException: org.gridgain.control.agent.configuration.ControlCenterAgentConfiguration

Depending on how you deploy your cluster, you can enable the module in different ways:

  • If you start nodes from the distribution package by executing ignite.sh, copy the {GRIDGAIN_HOME}/libs/optional/control-center-agent folder to {GRIDGAIN_HOME}/libs/.

  • If you start nodes using Maven, see this section for the information on how to enable modules.

  • If you use a GridGain Docker image, see Enabling Modules.

When you start your cluster with the Control Center Agent enabled, you can use the management script to enable and disable management capabilities. The management script is located in the bin directory of the distribution package.

As the cluster tries to connect to Control Center, you should see the following messages in the console output of the coordinator node (the oldest node in the cluster):

node output

You can copy the link and open it in your browser, or you can copy the token and add the cluster in Control Center.

Enabling Metrics

Control Center collects metrics from the GridGain/Ignite cluster that are running. Most metrics are available by default, but some metrics must be enabled in the cluster before you can view them in Control Center.

You can enable metrics in two ways:

  • In the cluster configuration, or

  • Via JMX Beans at runtime

Refer to this page for details.

Enabling Tracing

If you want to enable tracing capabilities and view traces in Control Center:

  1. Enable the ignite-opencensus module. The module is enabled by default if you use the GridGain binary distribution. If you use Maven to start GridGain nodes, follow this instruction.

  2. Add the following property to your cluster configuration:

    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
    
        <property name="tracingSpi">
            <bean class="org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi"/>
        </property>
    
    </bean>
    IgniteConfiguration cfg = new IgniteConfiguration();
    
    cfg.setTracingSpi(new org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi());
  3. Enable tracing via the control script:

    JVM_OPTS="-DIGNITE_ENABLE_EXPERIMENTAL_COMMAND=true" ./control.sh --tracing-configuration set --scope DISCOVERY --sampling-rate 1

    The -scope parameter specifies the APIs you want to trace. The following APIs are instrumented for tracing:

    • DISCOVERY — discovery events

    • EXCHANGE — exchange events

    • COMMUNICATION — communication events

    • TX — transactions

    The --sampling-rate is the probabilistic sampling rate, a number between “0” and “1”. “0” means no sampling, “1” means always sampling.

Control Center URI

The Control Center URI is the URI where the GridGain Control Center is running. Your cluster must know that URI to be able to establish connection with Control Center.

When started with "control-center-agent" enabled, the cluster tries to connect to the following URLs:

  1. http://localhost:3000.

  2. https://control.gridgain.com

If connection to one of the addresses is established, you should see the following messages in the output of the coordinator node:

node console output

If your Control Center instance is running on a different machine or on different port, you can set the Control Center URI at runtime using the management script:

{GRIDGAIN_HOME}/bin/management.sh --uri https://control_center_uri:8008

Note the ID of the cluster in the node output. You will need it to add the cluster in the Control Center UI. See Connecting a Cluster.

Assigning Cluster Name

You can assign a user-friendly name to your cluster. The name is displayed in Control Center. Use the following command to assign a name:

{IGNITE_HOME}/bin/control.sh --change-tag newTagValue [--yes]

If you don’t set the cluster name, the auto-generated cluster name is displayed instead.