Distributed Systems

University of Edinburgh. Autumn 2016

Setting up Apache ignite in your DICE account

If you use one of the DICE machines, Java, idea and Maven will be already installed. However, you need to configure Apache ignite in them.

Setting up Apache Ignite

  1. Open a terminal.

  2. Download the latest binary relase of Apache Ignite from here.

    wget http://mirror.ox.ac.uk/sites/rsync.apache.org//ignite/1.7.0/apache-ignite-fabric-1.7.0-bin.zip
    This will download a zipped file. Alternatively, you can use your favorite browser to download the same.

  3. Unzip the archive into the installation folder in your system

    unzip apache-ignite-fabric-1.7.0-bin.zip
    This will unzip the archive in the diectory named as apache-ignite-fabric-1.7.0-bin.

  4. Go inside apache-ignite-fabric-1.7.0-bin directory and run the ignite.sh script using

    cd apache-ignite-fabric-1.7.0-bin
    bin/ignite.sh
    
    You should see the output in the terminal similar to:
    [12:06:57] Ignite node started OK (id=6a54a76f)
    [12:06:57] Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, heap=1.0GB] 
    If you see this output, then your apache ignite is running ok and you can proceed to the the next section.

Resources for more detail:

Running first cluster example - Hello World

  1. Open a terminal.

  2. Open Idea IDE

    idea-ce &

  3. First time usage for Idea would require you to setup launcher preferences. Setup as per your convinience.

  4. You should see welcome screen like this:

    Welcome Screen

    Select "Create New Project".

  5. Select "Maven" from the left side bar.

  6. To select Project SDK click "New". Select Java-1.7.0 from the file browser

    New project

    Click OK and then Next.

  7. Enter GroupId as "example.hello" and ArtifactId as "example-hello". For better understanding refer here. Click Next

  8. Select Project Name as "helloworld". Click Finish.

  9. A project screen will be opened. Click on the "Enable Auto-import" in the "Maven projects to be imported" popup.

    project screen

  10. Create new package "example.hello" in src->main->java in the project window in the left hand side. Then Create a new Java class "HelloWorld" in it.

  11. You need to add dependency for ignite-core, ignite-spring and h2 database. Your pom.xml should look like this.

  12. Your HelloWorld.java should look like this.

  13. Your project directory structure should look like this

    project structure

  14. Now make the project by clicking "Build->Make Project". On successful building the project, this would generate class files in target/classes directory.

  15. Edit the run configuration by clicking "Run->Edit Configurations". Click on "+" and select "Applicaiton".

    • Enter "HelloWorld" as the "Name" of the configuration.

    • Enter "example.hello.HelloWorld" in "Main Class".

    • In "Configuration" tab, Enter "-DIGNITE_HOME=[path to apache-ignite-fabric-1.7.0-bin without /]" in "VM options". As we have spacified the relative path for the config file, this settings is needed. The configuration screen should look similar to this:

      Run Configuration

  16. Open another terminal. Run ignite.sh with config file "examples/config/example-ignite.xml" as

    bin/ignite.sh examples/config/example-ignite.xml

  17. From Idea click Run->Run to run the program. You should see similar lines as below in the new terminal you have just opened in the previous step:

    [14:22:27] Topology snapshot [ver=2, servers=2, clients=0, CPUs=16, heap=11.0GB]
    >>> Hello Node: 0103935b-9eee-49ce-a1ef-16341a3b352a

Alternate configuration files

If you have difficulty with ignite start-up, please try the following config files instead: You would need to copy the XML files to the examples/config folder and change your application to make use of those (see the HelloWorld example).