This page is new in the latest version of GigaSpaces documentation.
This section assumes that you are familiar with the Amazon EC2 web services. If this is not the case, please visit the Amazon EC2 getting started guide.
Amazon EC2 is defined as a beta version, therefore the GigaSpaces-EC2 solution is also defined as beta.
Overview
GigaSpaces XAP, the scale-out application server, bridges the gap between on-demand hardware scalability and on-demand application scalability. GigaSpaces offers a pre-configured Amazon Machine Image (AMI) with GigaSpaces installation and scripts. You write your application once, deploy to any number of GigaSpaces-AMI nodes and scale on-demand by launching additional instances. This page will guide you how to configure and run your GigaSpaces application in the Amazon EC2 environment.
new! Watch the following screencast to learn how to setup and run the GigaSpaces image (AMI) on Amazon's EC2.
For efficient work with Amazon EC2, it is recommended to pre-install and to configure the SSH tool, FTP tool, VNC client, and the ElasticFox plugin.
The following steps guide you through installation and configuration of the Amazon-EC2 Firefox plugin and other required tools on Windows-based machines.
The SSH tool is used for remote logging into a running instance. Putty is used below as an example.
Amazon has developed ElasticFox, a user-friendly Firefox plugin that provides a GUI interface for managing and lunching AMIs. This plugin, together with the S3fox plugin, can help you interact with Amazon's web services offering.
You need to log into the GSM AMI, but you don't need to log into the GSC AMI.
1. Starting the GSM AMI
Launch the CLUSTER_MNG AMI (Instance Type=Large, Number of instances=1, KeyPair=your key).
Shortly after, new instances with a pending state are displayed in the your instances panel. As soon as the state changes to running, you can log into your running AMI (you might need to press the Refresh button in the instances panel).
In Your Instances Panel, choose the AMI and press the Open SSH Connection button (the green key button). You are then logged into the machine as root.
After logging into the machine, GigaSpaces XAP evaluation license agreement is presented. Read it carefully and approve by typing Yes at the bottom of the agreement. Note that typing No halts the machine.
After accepting the evaluation license agreement, The GSM process starts automatically.
In production environments, it is recommended that you use at least 2 GSM AMIs. To do this, see Start more than one GSM AMIs below.
2. Starting GSC AMIs
GigaSpaces enables running more than one cluster container in a given AMI instance.
To start your GSC AMIs:
Choose the CLUSTER_NODE AMI.
Obtain the GSM internal host name by right-clicking the running GSM instance and selecting Copy Private DNS Name to clipboard:
Specify the number of AMIs in your cluster, by setting the Minimum Number of Instances and Maximum Number of Instances fields in the Launch new instance(s) window.
In the User Data text field, specify: [the number of cluster containers per GSC AMI]#[The GSM internal hostname].
# is a separator symbol between the number of GSCs and the GSM internal host name. Do not include any spaces before and after the separator.
Shortly after, new instances with a pending state are displayed in the your instances panel.
As soon as the state changes to running on all the new instances, you can verify that the cluster is up and running by using the GigaSpaces Management Center. To do this, see Using the GigaSpaces Management Center for EC2 below.
Recommended number of GSCs (cluster containers):
For large AMI machines, 2 or 3 GSCs are recommended per instance.
For extra large AMI machines, up to 5 GSCs are recommended per instance.
In case the cluster contains more than one GSM, the GSM's internal host names should be separated by a comma.
2. Writing and Deploying Your Application to the GigaSpaces-EC2 Cluster
Running your application on the EC2 cluster involves two steps:
Develop and test you Processing Unit on your local machine. To learn how to do this, refer to the OpenSpaces Hello World Example.
Copy the Processing Unit folder from your local machine to the /deploy directory of the GSM AMI.
You can use Win SCP3 to FTP your Processing Unit to the GSM machine.
You can also deploy the Processing Unit using GigaSpaces CLI pudeploy command after logging into the GSM AMI. For more details, refer to the pudeploy - GigaSpaces CLI section.
Using GigaSpaces Small AMI for development purposes
GigaSpaces small AMI contains the GigaSpaces XAP installation, without the automated clustering scripts.
This AMI supports the Small and High-CPU Medium Instances.
It is recommended to use this AMI for development purposes.
Launch the DEVELOPMENT AMI (Instance Type=Small, Number of instances=1, KeyPair=your key).
Shortly after, new instances with a pending state are displayed in the Your Instances Panel. As soon as the state changes to running, you can login to your running AMI (you might need to press the Refresh button in the instances panel).
In Your Instances Panel, choose the AMI and press the Open SSH Connection button (the green key button). You are then logged into the machine as root.
After logging into the machine, GigaSpaces XAP evaluation license agreement is presented. Read it carefully and approve by typing Yes at the bottom of the agreement. Note that typing No halts the machine.
After accepting the evaluation license agreement, the machine is ready for use and you can start your development.
The GigaSpaces solution on EC2 is a "pay-per-use" model. Once you are done using the nodes in your cluster, you should terminate your instances. To do this, right-click the running instance in the Your Instances Panel, and choose Terminate.
Starting Multiple GSM AMIs
This section guides you through starting more than one GSM in your cluster (for redundancy). This section describes how to start the recommended number of GSMs (2 per cluster).
Launch 2 instances of the GS_AMI_CLUSTER_MNG AMI (Instance Type=Large, Number of instances=2, KeyPair=your key.
In the User Data text field, specify 2 (the number of GSMs per cluster).
Extract the machines' external and internal host names, and log on (as root) to these two machines (using the external host name), by right-clicking the running instances. Keep this host name for later usage.
Log onto the two running AMIs (SSH to the machines).
Accept the license agreement by typing Yes at the bottom of the agreement. Be aware that typing No halts the machine.
Run the gsm_start.sh script:
./gsm_start.sh
This prompts the following input:
Number of cluster managers (GSM AMI) you wish to deploy, two are recommended.
The internal host names for each cluster manager.
The GSM starts on each machine. Check the environment using the gs.sh script list command:
./[GIGASPACES_INSTALL_FOLDER]/bin/gs.sh
gs> list
Using GigaSpaces Management Center for EC2
Locate the GigaSpaces CLUSTER_UI AMI by typing GS6.5_ in the text field located in the top right corner of the Machine Images panel.
Obtain the internal host name of the CLUSTER_MNG AMI by right-clicking the running AMI instance and selecting Copy Private DNS Name to clipboard.
Launch the CLUSTER_UI AMI (Instance Type=Small, Number of instances=1, KeyPair=your key).
In the User Data text field, specify the GSMs internal hostname.
Shortly after, a new instance with pending state is displayed in the Your Instances Panel. Wait for the AMI state to change to running (you might need to press the Refresh button in the instances panel).
Right-click the CLUSTER_UI AMI running instance and select SSH to public DNS name.
Click Yes in the following dialog.
An SSH Putty window opens, you are automatically logged in.
After logging into the machine, GigaSpaces XAP evaluation license agreement is presented. Read it carefully and approve by typing Yes at the bottom of the agreement. Note that typing No halts the machine.
After a few seconds, the VNC server is started.
Right-click the top right corner of the Putty window and select Change Settings....
Select Connection > SSH > Tunnels and enter the information provided in the SSH console output.
Click Add and Apply.
Make sure a line is added to the Forward Ports window.
Click Apply.
Do not close the SSH window.
Launch the VNC client from your desktop.
In the Server dialog, type 'localhost:1', and click OK.
Type the password presented in SSH console output (no user name is required).
The GigaSpaces Management Center is started with the appropriate discovery settings.