Summary: This page describes the GigaSpaces Elastic Data Grid deployment on Rackspace using the Elastic Service Manager

Overview

The GigaSpaces Elastic Service Manager allows a user to deploy a data grid that can scale out and in to meet changing demands. A simple handler interface is used to request additional computing resources and to release ones that are no longer used.

 

This page describes the ESM integration with the Rackspace Cloud.

Rackspace Cloud Hosting

Rackspace cloud hosting offers on-demand provisioning of virtual servers. As such, it is an ideal solution for scaling out data intensive applications to meet demand peaks.
For more information, please go to the Rackspace web site.

The GigaSpaces Cloud Enabled Platform

The following presentation was part of a joint GigaSpaces/Rackspace webinar showcasing the integration and included a live demonstration of a GigaSpaces data grid scaling out to new Rackspace servers on demand.

PowerPoint Presentation
View more presentations or Upload your own.

Prerequisites

  • Set up your Rackspace account and create an API access key (see Rackspace documentation for more details)
  • Update the 'rackspace.properties' file with your Rackspace user name and access key.

Data Grid deployment control flow

Deployment of a data grid is initiated by connecting to a running instance of the ESM, and requesting a new data grid deployment. From this point on, the ESM controls the provisioning and removal of resources.

Here is the control flow of a typical deployment

  1. Client looks up an existing ESM.
  2. If an existing machine is not available, a new one is provisioned from the Rackspace cloud. An initialization script downloads all application files and starts a GigaSpaces Agent, Lookup Service, GSM and ESM.
  3. Client connects to the ESM via the GigaSpaces Admin API and requests a new Data Grid deployment, specifying the scaling handler to use.
  4. ESM provisions new servers from the Rackspace cloud as required to meet the grid requirements. If no longer required, the ESM will shut down these machines.

How to Run the Demo

The project source code includes a demo application called com.gigaspaces.rackspace.examples.ESMDemo. This class will initialize a data grid and performs some basic operations on it. This is the best place to start. Here you can change the test grid's settings, like its capacity and availability, and see how they affect the grid deployment.

The code

Deploy
final Admin admin = new AdminFactory().addLocator(locator).createAdmin();
final String gridName = "myElasticDataGrid";
// Use the Admin API to deploy an elastic grid
final ElasticServiceManager esm = admin.getElasticServiceManagers().waitForAtLeastOne();
final ProcessingUnit pu = esm.deploy(new ElasticDataGridDeployment(gridName)
.elasticScaleHandler(new ElasticScaleHandlerConfig("com.gigaspaces.rackspace.esm.RackspaceElasticHandler")
.addProperty("user", user)
.addProperty("apiKei", apiKey)
.addProperty("machineNamePrefix", "gs-esm-gsa")
.addProperty("gridName", gridName)
).capacity("1G", "2G").highlyAvailable(false).publicDeploymentIsolation()
.maximumJavaHeapSize("250m").initialJavaHeapSize("250m"));

Handler Interface
public interface ElasticScaleHandler {
public void init(ElasticScaleHandlerConfig config);

public boolean accept(Machine machine);

public void scaleOut(ElasticScaleHandlerContext context);

public void scaleIn(Machine machine);
}

Seeing it in action

A video file attached to this page shows the demo code in action.

Considerations

  • Rackspace cloud servers are charged at an hourly rate, so it's a good idea to shut down all servers once you are done working with them.
  • Rackspace does not currently support public machine images, so installation of the GigaSpaces libraries is performed after a new server has started. This is done by calling a script ('start-esm.sh') that downloads application files from the Rackspace CloudFiles storage system.
    If you wish to make any changes to the deployment, you may want to modify these scripts to fit your needs.
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence