GridGain Developers Hub

High Availability and Fault-Tolerance

Overview

In order to deploy a highly available, fault-tolerant Web Console, GridGain provides two special Docker images: gridgain/gridgain-web-console-frontend and gridgain/gridgain-web-console-backend.

The gridgain/gridgain-web-console-frontend image contains the following service:

  • Nginx based Web Console Frontend

The gridgain/gridgain-web-console-backend image contains the following services:

  • Java Based Web Console Backend

  • GridGain client node

Web Console High Availability and Fault Tolerance

Requirements

  1. Register on Docker Hub.

  2. Provide your Docker Hub account name to the GridGain support team in order to configure access to private Docker images with GridGain Web Console.

  3. Create a folder where you will be deploying GridGain Web Console, and open this folder in the terminal.

  4. From the terminal window, login to the Docker Hub with your account.

    sudo docker login -u your_docker_hub_account

Minimal Requirements for HA and FT Cluster

  • At least 2 Frontend nodes

  • At least 2 Backend nodes

  • At least 2 GridGain server nodes

  • Load Balancers in front of Frontend and Backend services

Configuration

Each Frontend Service should have a Load Balancer in front of it.

In your web-console.conf configuration file for the Frontend service, set the IP address or hostname of the Load Balancer in front of the Backend service.

upstream backend-endpoint {
     server <LOAD_BALANCER_IP_ADDRESS_OR_HOSTNAME>:8008;
  }

For the Backend service, add a configuration file with the appropriate IpFinder configuration based on your GridGain Server Nodes deployment. Here’s an example ignite-config.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/util
       http://www.springframework.org/schema/util/spring-util.xsd">
    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                <!-- In distributed environment, replace with actual host IP address. -->
                                <value>localhost:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Start

  1. If your Linux distribution does not contain the ip_vs module in the kernel, you will need to start it manually with the following command: modprobe ip_vs.

  2. Start Frontend servers (you can use a single configuration file for multiple servers by specifying a different --name):

    docker run -d --name frontend-1 -v $PWD/web-console.conf:/etc/nginx/web-console.conf gridgain/gridgain-web-console-frontend:2021.04.00
    
    docker run -d --name frontend-2 -v $PWD/web-console.conf:/etc/nginx/web-console.conf gridgain/gridgain-web-console-frontend:2021.04.00
  3. Start Backend servers (you can use a single configuration file for multiple servers by specifying a different --name):

    docker run -d --name backend-1 -v $PWD/ignite_config.xml:/opt/gridgain-web-console-server/ignite-config.xml gridgain/gridgain-web-console-backend:2021.04.00
    
    docker run -d --name backend-2 -v $PWD/ignite_config.xml:/opt/gridgain-web-console-server/ignite-config.xml gridgain/gridgain-web-console-backend:2021.04.00
  4. Open http://<CLUSTER_FLOAT_IP> (CLUSTER_FLOAT_IP is the IP address of the Load Balancer in front of the Frontend service) in a browser, and register your first user. Admin rights will be granted to the first registered user.

Recovery

You may use docker start <id> to restart the container. Use docker logs <id> to see docker container logs.