Thanks to visit codestin.com
Credit goes to apacheignite.readme.io

Microsoft Azure Deployment

❗️

This is a legacy Apache Ignite documentation

The new documentation is hosted here: https://ignite.apache.org/docs/latest/

Azure Kubernetes Service Deployment

The first step is to configure Azure Kubernetes Service (AKS) cluster following one of the Microsoft guidelines:

In this documentation, we're going to use Azure portal for the AKS deployment.

AKS Configuration

Once you've created a Microsoft account, navigate to https://portal.azure.com and choose Create a resource > Kubernetes Service > Create.

On the next screen specify general parameters for your deployment:

2104

In our case, we're using IgniteCluster as a name of both Resource group and Kubernetes cluster name.

Pick the required number of nodes in your AKS cluster on the same screen:

1588

In our case, the cluster will consist of 4 nodes each with 2 vcpus and 8 GB RAM.

Next, navigate to Networking configuration screen and set up the network the way you need. If there are no network specific parameters then feel free to use the default settings as follows:

1420

After that, go to Monitoring configuration screen. It's suggested to have the monitoring enabled so that you can observe the state of the cluster from Azure portal:

1512

On the next screen, set any tags you need for your applications and click on Review + create button. Double check the configuration parameters and click on the Create button.

Go to All Resources > IgniteCluster and give Azure some time to deploy the cluster for you:

2106

Access to your Kubernetes cluster

Kubernetes Dashboard is a simple tool that helps to monitor the deployment from a local machine or another environment.

To start using the dashboard, you need to install Azure CLI. Follow these instructions if you don't have it configured.

Once Azure CLI is installed, perform the steps below.

First, get the credentials for your cluster by running the following command:

az aks get-credentials --resource-group IgniteCluster --name IgniteCluster

Next, check that all the nodes are in Ready state with this command:

kubectl get nodes

The output might be as follows:

aks-agentpool-41298956-0   Ready     agent     1m        v1.10.3
aks-agentpool-41298956-1   Ready     agent     1m        v1.10.3
aks-agentpool-41298956-2   Ready     agent     1m        v1.10.3
aks-agentpool-41298956-3   Ready     agent     1m        v1.10.3

Finally, launch Kubernetes dashboard by running the following command:

az aks browse --resource-group IgniteCluster --name IgniteCluster

Once the dashboard is opened, go to Cluster > Nodes to confirm that you can see all the nodes of your AKS cluster running:

2534

Ignite Cluster Deployment

To deploy Ignite cluster within Azure Kubernetes Service you need to perform at least three steps:

  • Set up RBAC authorization.
  • Deploy Ignite Service that is used for Ignite nodes auto-discovery within Kubernetes and that is also used as a LoadBalancer for your external applications.
  • Deploy Ignite cluster as a stateless or stateful solution.

All the yaml files required to perform these steps are provided for you on GitHub. Download these files to your Azure CLI shell.

RBAC Authorization

You need RBAC Authorization to create an Ignite-specific namespace, service account, and role. Run the following commands, in order, one-by-one:

kubectl create -f ignite-namespace.yaml
kubectl create -f ignite-service-account.yaml
kubectl create -f ignite-account-role.yaml
kubectl create -f ignite-role-binding.yaml

Refer to the RBAC Authorization guide for further details.

Once RBAC is configured open Kubernetes dashboard, go to Cluster > Roles to confirm that you have an Ignite-specific role there:

2534

Switch the current namespace to ignite in Kubernetes dashboard by selecting Namespace > ignite. Finally, switch the current namespace for your Azure CLI connection by running the following command:

kubectl config set-context $(kubectl config current-context) --namespace=ignite

Ignite Service Deployment

Deploy a special Ignite service that is used for Ignite nodes auto-discovery and as a LoadBalancer for external applications. Run the following command:

kubectl create -f ignite-service.yaml

Refer to the Ignite Service guide for further details.

Once the service is deployed, go to Discovery and Load Balancing > Services to confirm that the service is observable from Kubernetes dashboard:

2532

Ignite StatefulSet Deployment

Ignite Statefulset deployment can be used to deploy Ignite as a memory-centric database with Ignite persistence enabled. Two options are available depending upon where you wish to store the Write Ahead Log (WAL):

  1. Separate Disk for WAL (recommended)
  2. Same storage for the database and WAL files

Separate Disk for WAL

Run the following commands, in order, one-by-one:

kubectl create -f ignite-wal-storage-class.yaml
kubectl create -f ignite-persistence-storage-class.yaml
kubectl create -f ignite-stateful-set.yaml

Same storage for the database and WAL files

Refer to the Stateful Deployment guide for further details.

Go to Cluster > Persistence Volumes to see what type of drives were allocated for the cluster. For instance, this is how the screen might look like:

2532
🚧

StatefulSet Deployment Time

It might take a while for Microsoft Azure to allocate requested persistence volumes and, as a result, deploy all the pods successfully. While the volumes will be being assigned, the deployment status of the pods might show the message like this - "pod has unbound PersistentVolumeClaims (repeated 4 times)".

Once the pods are deployed try to scale out your Ignite deployment by running the following command:

kubectl scale sts ignite --replicas=4

Once the cluster is scaled and the disks are mounted to the pods, you'll be able to see a screen like that after navigating to Workloads > Pods in Kubernetes dashboard:

2516

Ignite Cluster Activation

Since we're using Ignite native persistence for our deployment we need to activate the Ignite cluster after it's started. To do that, connect to one of the pods:

kubectl exec -it ignite-0 --namespace=ignite -- /bin/bash

Go to the following folder:

cd /opt/ignite/apache-ignite-fabric/bin/

And activate the cluster by running the following command:

./control.sh --activate

Connecting from External Applications

Let's connect to our Ignite cluster from an external application (the one that's not deployed in Kubernetes). We're going to use JDBC driver to work with Ignite using SQL interface.

First, find out what's an external address of Ignite service. For instance, you can do that by going to Discovery and Load Balancing > Services and pick an external endpoint with port number 10800 (that port is used by default for SQL drivers in Ignite).

Next, download an Ignite release, go to {ignite_release}/bin and use the following command to connect to the cluster with SQLLine tool:

./sqlline.sh --verbose=true -u jdbc:ignite:thin://{EXTERNAL_IP}:10800

Once connected, preload the World Databases delivered with every Ignite release by running this command from SQLLine:

!run ../examples/sql/world.sql

After that, feel free to interact with your deployment by running SQL queries as follows:

SELECT country.name, city.name, MAX(city.population) as max_pop FROM country
    JOIN city ON city.countrycode = country.code
    WHERE country.code IN ('USA','RUS','CHN')
    GROUP BY country.name, city.name ORDER BY max_pop DESC LIMIT 3;

Installing Web Console

If you want to install Web Console in Kubernetes, please refer to the installation instructions.