Apache Ignite Installation on Windows

Raymond Tang Raymond Tang 0 2343 1.83 index 1/3/2022

I love Apache open source frameworks and you probably have noticed that I spent a lot time in the past to publish detailed installation guides on Windows for products like Hadoop, Spark, Hive, Kafka, Ambari, Zeppelin, etc. Apache Ignite is a distributed database for high‑performance applications with in‑memory speed. The core capabilities include multi-tier storage, distributed SQL, ACID transactions, compute APIs in Java, Scala, Kotlin, C# and C++, machine learning and continuous queries.

This article provides a simple guide to install Ignite on your Windows machine for learning and practice purposes. You can also use Docker or Kubernetes to install Apache Ignite.

Prerequisites

  • JDK: Oracle JDK 8 or 11, Open JDK 8 or 11, IBM JDK 8 or 11.
  • .NET SDK: only required if you want to run the .NET thin client example.

You can follow section 'Step 4 - (Optional) Java JDK installation' in article Install Hadoop 3.3.1 on Windows 10 Step by Step Guide.

Install Ignite

Follow these steps to install Apache Ignite:

  1. Download binary: https://ignite.apache.org/download.cgi#binaries. For this article, I am downloading 2.11.1 version (apache-ignite-2.11.1-bin.zip).
  2. Unzip the binary to the installation folder using PowerShell: unzip  apache-ignite-2.11.1-bin.zip
  3. (Optional) Enable required modules. Follow this official link to learn more about enabling required modules: Enabling Modules.
  4. Setup Ignite environment variable IGNITE_HOME: 2022010310700-image.png Make sure there is no trailing path separator ('' or '/') in the value.

Configure Ignite

Now we can configure Ignite based accordingly.

Configure working directory

Working directory is the place where your application data is stored.

SETX IGNITE_WORK_DIR=F:\big-data\apache-ignite-2.11.1-bin\work

By default, it locates at %IGNITE_HOME%\work. You can also customize in your applications or using environment variable IGNITE_WORK_DIR.

Configure logging

Ignite supports many different logging libraries and frameworks including JUL (default), Log4j, Log4j2, JCL and SLF4J. By default JUL is used. You can use The following environment variables can be configured:

System property Description Default value
IGNITE_LOG_INSTANCE_NAME If the property is set, Ignite includes its instance name in log messages. Not set
IGNITE_QUIET Set to falseto disable the quiet mode and enable the verbose mode. true
IGNITE_LOG_DIR The directory where Ignite writes log files. %IGNITE_HOME%\work\log
IGNITE_DUMP_THREADS_ON_FAILURE Set to true to output thread dumps to the log when a critical error is caught. true

By default, Ignite uses %IGNITE_HOME%\config\java.util.logging.properties as logging configuration file.

Start Ignite nodes

Start server node

After all the configurations, we can start server node using the following command line in Command Prompt:

%IGNITE_HOME%\bin\ignite.bat

2022010313928-image.png

Enable client node

We can enable client node by configuring the default config file or enable it programmatically in your Java, .NET or C++ applications.

To use XML configuration file, configure property clientModeas true.

<?xml version="1.0" encoding="UTF-8"?><!--  Licensed to the Apache Software Foundation (ASF) under one or more  contributor license agreements.  See the NOTICE file distributed with  this work for additional information regarding copyright ownership.  The ASF licenses this file to You under the Apache License, Version 2.0  (the "License"); you may not use this file except in compliance with  the License.  You may obtain a copy of the License at       http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software  distributed under the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and  limitations under the License.--><beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xsi:schemaLocation="       http://www.springframework.org/schema/beans       http://www.springframework.org/schema/beans/spring-beans.xsd">    <!--        Alter configuration below as needed.    -->    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">       <property name="clientMode" value="true"/> </bean></beans>

Start client node

Once you configured to enable client mode in your computer, you can then start it using same command.

Stop nodes

You can directly press Ctrl + C to stop the node services.

(Optional) .NET thin client example

Now we can implement an example following page .NET Thin Client.

  1. Create a dotnetapplication:
mkdir ignite-dotnet-examplecd ignite-dotnet-exampledotnet new console
  1. Add package reference

The required package is already part of Ignite binary distribution and locates at: %IGNITE_HOME%\platforms\dotnet\bin\Apache.Ignite.Core.dll.

Edit project file to reference this local library by adding the following element:

<ItemGroup>  <Reference Include="Apache.Ignite.Core">    <HintPath>F:\big-data\apache-ignite-2.11.1-bin\platforms\dotnet\bin\Apache.Ignite.Core.dll</HintPath>  </Reference></ItemGroup>

* Remember to change the path accordingly.

  1. Edit Program.cs file with the following content:
using Apache.Ignite.Core;using Apache.Ignite.Core.Client;
var cfg = new IgniteClientConfiguration{    Endpoints = new[] { "127.0.0.1:10800" }};
using (var client = Ignition.StartClient(cfg)){    var cache = client.GetOrCreateCache<int, string>("cache");    cache.Put(1, "Hello, World!");    foreach (var cacheName in client.GetCacheNames())        Console.WriteLine(cacheName);    Thread.Sleep(1000);    foreach (IClientConnection connection in client.GetConnections())    {        Console.WriteLine(connection.RemoteEndPoint);    }}
  1. Run the program:
dotnet run

Output:

cache

127.0.0.1:10800

References

Ignite Documentation Overview

.net c# data-engineering

Join the Discussion

View or add your thoughts below

Comments