GridGain Developers Hub
GitHub logo GridGain iso GridGain.com
GridGain Software Documentation

Using GridGain AMI

GridGain provides an AMI with the latest version of GridGain Enterprise Edition preinstalled.

Prerequisites

  • An existing AWS account

Considerations

Choose the right type of instances that suit your needs. Consider the following points:

  • RAM: If you are going to use GridGain as an in-memory storage, make sure to select an instance with enough RAM to fit all your data.

  • Disk space: If you are launching a cluster with a persistent storage, provide enough size to accommodate all your data when configuring the instance’s volume.

    You may want to uncheck the Delete on Termination option for your storage.

  • Networking: GridGain nodes discover and communicate with each other by TCP/IP. A number of ports must be open for this communication. See Configuring Security Group.

Visit our Capacity Planning page for information about ways to estimate hardware requirements for your use case.

Obtaining GridGain AMI

Visit the GridGain product page on AWS Marketplace and launch the AMI from there.

Configuring Security Group

When configuring the instances, you will be asked to specify a security group. The security group must allow connection to the following ports:

Protocol Port Description

TCP

47500-47600

Discovery ports.

TCP

47100-47200

Communication ports.

TCP

10800

Optional. Thin client port.

TCP

8080

Optional. For REST API requests.

These are the default ports that GridGain nodes use for discovery and communication purposes. If you want to use values other than the default ones, open them.

This is what our security group should look like:

aws security group

Launching GridGain Nodes

Connect to the EC2 instance via ssh as per the AWS documentation. Make sure to provide the same credentials that were used to launch the EC2 instance.

The default user name is 'gridgain'. The ssh command would look like (change the IP address with the actual public IP of your image):

ssh -i your_key.pem gridgain@@54.173.158.228

You can change the user name after first login, if needed. For information on how to create a custom user name, see AWS documentation for Linux user accounts.

GridGain is installed in the /home/gridgain/gridgain-enterprise-8.7.21 directory. You can start it with the default settings by running the following command:

$ gridgain-enterprise-8.7.21/bin/ignite.sh

If you use a custom GridGain configuration, make sure that the IgniteConfiguration instance contains the following attribute:

<property name="userAttributes">
    <map>
        <entry key="iaas.vendor" value="amazonaws"/>
    </map>
</property>

This attribute is required when using GridGain Enterprise Edition license.

Configuring Discovery

Cluster nodes launched in different EC2 instances must be able to connect to each other. This is achieved by configuring the discovery mechanisms on each node. There are two ways you can do that:

Discovering Nodes by TCP/IP

To configure discovery by TCP/IP, specify the private IP addresses of each instance in the node’s configuration file.

aws-static-ip-finder.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:util="http://www.springframework.org/schema/util"
    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
    http://www.springframework.org/schema/util
    http://www.springframework.org/schema/util/spring-util.xsd">
    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="userAttributes">
            <map>
                <entry key="iaas.vendor" value="amazonaws"/>
            </map>
        </property>

        <!-- other properties -->

        <!-- Discovery configuration -->
        <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>
                                <value>172.31.28.36</value>
                                <value>172.31.23.105</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Connect to each instance via ssh and start a node as follows:

$ ./gridgain-enterprise-8.7.21/bin/ignite.sh aws-static-ip-finder.xml

After starting the second node, you should see the following message in the console:

aws successful launch

server=2 means that the nodes were able to connect to each other and form a cluster.

Automatic Discovery Using Amazon S3

You can use the Amazon S3 IP Finder to configure automatic discovery of nodes.

Enable the 'ignite-aws' module:

$ cp -r gridgain-enterprise-8.7.21/libs/optional/ignite-aws/ gridgain-enterprise-8.7.21/libs/

Go to the Amazon S3 Management Console and create a simple bucket with default settings. Our bucket is named 'gg-ip-finder-bucket':

aws s3 bucket

Provide the name of the bucket in the node’s configuration file as follows.

aws-s3-ip-finder.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:util="http://www.springframework.org/schema/util"
    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
    http://www.springframework.org/schema/util
    http://www.springframework.org/schema/util/spring-util.xsd">
    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="userAttributes">
            <map>
                <entry key="iaas.vendor" value="amazonaws"/>
            </map>
        </property>
        <!-- other properties -->
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">
                        <property name="awsCredentials" ref="aws.creds"/>
                        <property name="bucketName" value="gg-ip-finder-bucket"/>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
    <!-- AWS credentials. Provide your access key ID and secret access key. -->
    <bean class="com.amazonaws.auth.BasicAWSCredentials" id="aws.creds">
        <constructor-arg value="YOUR_ACCESS_KEY_ID"/>
        <constructor-arg value="YOUR_SECRET_ACCESS_KEY"/>
    </bean>
</beans>

Replace the YOUR_ACCESS_KEY_ID and YOUR_SECRET_ACCESS_KEY values with your access key and secret access key. Refer to the Where’s My Secret Access Key? page for details.

Use the following configuration to start nodes:

$ ./gridgain-enterprise-8.7.21/bin/ignite.sh aws-s3-ip-finder.xml

After starting the second node, you should see the following message in the console:

aws successful launch

server=2 means that the nodes were able to connect to each other and form a cluster.

Troubleshooting Your AWS Deployment

GridGain Systems offers 14 days of free GridGain Standard Enterprise Support to new organizations that deploy the GridGain Enterprise Edition on AWS through the AWS Marketplace. This offer is limited to one 14-day period of free support per organization. Our standard annual support subscriptions are available at any time. Just complete the form to register for your 14 days of complementary support services.