This is an example of:

There are two ways to run this demo:

  1. Single Node Stand Alone Mode
  2. Geode Cluster Running On AWS

Single Node Stand-Alone Mode


With this option all artifacts can be downloaded to run a Geode cluster as well as the sample application on Mac OSX or Linux machine. There is no support for Windows at this time.


  1. All scripts to run the samples are written in Bash, as a result the target machine needs to be Mac OSX or Linux
  2. Java JDK 1.7+ (Oracle is recommended) needs to be installed on the machine, and the JAVA_HOME variable should be set
  3. Port 8080 is free for the demo application to run on (if port 8080 is not free the application can be configured to use another port, however its default in 8080)

Set Up

  1. Download and uncompress the project zip

  2. cd into the directory geode-demo-application-master/demo/single-machine-mode

  3. All scripts to run the demo and any dependencies are found in this folder

    geode-demo-application-master$ cd demo/single-machine-mode
    single-machine-mode$ ls client-apps   fastfootshoes    derby-server
  4. Ensure all *.sh scripts are executable

    single-machine-mode$ chmod +x *.sh

    To run the demo you will need 2 terminal sessions open. These will be for

  5. Running the Derby database. The cluster will use this for Write Through operations

  6. Running the Geode Cluster, Demo Application and Transaction Simulator

Starting The Cluster

  1. If JAVA_HOME has not been set the script can be run. It will look for a JDK version 1.7 to add to JAVA_HOME. It will look in the /usr/libexec/java_home folder. If JAVA_HOME is already set, this step can be skipped.
  2. Execute ./ which will
    • Start Derby DB
    • Start a Geode cluster with 2 locators and 4 servers, on
    • Start a Spring Boot application that will connect to the cluster in step 1, and generate historic data

The follow messages will appear in a successful start (log output shortened for brevity):

This first part will show the members starting up and their classpaths

single-machine-mode$ ./
Ensure that has been run in a seperate window before running the demo
Is derby running? (type Y to confirm):
Starting Cluster
Starting Up: Locator A, Locator B and Server A, Server B, Server C and Server D with the FastFoot Shoes Grid Configuration
Locator in /Users/lshannon/Downloads/geode-demo-application-master/demo/geode-server-package/locatorA on[10334] as locatorA is currently online.
Process ID: 22092
Uptime: 15 seconds
GemFire Version:
Java Version: 1.7.0_71
Log File: /Users/lshannon/Downloads/geode-demo-application-master/demo/geode-server-package/locatorA/locatorA.log
JVM Arguments: -Dgemfire.enable-cluster-configuration=false -Dgemfire.load-cluster-configuration-from-dir=false -Dgemfire.log-level=config -Xms256m -Xmx256m -Dgemfire.launcher.registerSignalHandlers=true -Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
Class-Path: /Users/lshannon/Downloads/geode-demo-application-master/demo/geode-server-package/geode-

Successfully connected to: [host=, port=1099]

... more messages like this as the rest of the members start up...

After the members have started a message from gfsh will show the members:

(1) Executing - connect

Connecting to Locator at [host=localhost, port=10334] ..
Connecting to Manager at [host=, port=1099] ..
Successfully connected to: [host=, port=1099]

(2) Executing - list members

  Name   | Id
-------- | -----------------------------------------------------------
serverC  | Luke-Shannons-Macbook-Pro(serverC:68598)<v4>:6908
locatorA | Luke-Shannons-Macbook-Pro(locatorA:68544:locator)<v0>:10231
serverB  | Luke-Shannons-Macbook-Pro(serverB:68585)<v3>:29758
serverA  | Luke-Shannons-Macbook-Pro(serverA:68573)<v2>:36452
serverD  | Luke-Shannons-Macbook-Pro(serverD:68610)<v5>:39490
locatorB | Luke-Shannons-Macbook-Pro(locatorB:68561:locator)<v1>:60760

Next the Spring Boot application will start and connect as a cluster to the cluster to put in historic data.

Loading Historic Data

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 :: Spring Boot ::        (v1.2.2.RELEASE)

2015-07-29 11:34:53.610  INFO 68623 --- [           main] o.a.g.d.f.dataloader.Application         : Starting Application v0.0.1-SNAPSHOT on Luke-Shannons-Macbook-Pro.local with PID 68623 (/Users/lshannon/Downloads/geode-demo-application-master/scripts/app/ShoeDataLoader-0.0.1-SNAPSHOT.jar started by lshannon in /Users/lshannon/Downloads/geode-demo-application-master/scripts)
2015-07-29 11:34:53.652  INFO 68623 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]4e4574df: startup date [Wed Jul 29 11:34:53 EDT 2015]; root of context hierarchy
2015-07-29 11:34:54.115  INFO 68623 --- [           main] o.s.b.f.xml.XmlBeanDefinitionReader      : Loading XML bean definitions from class path resource [client-cache.xml]

[info 2015/07/29 11:34:54.842 EDT  <main> tid=0x9] 

    Copyright (C) 1997-2014 Pivotal Software, Inc. All rights reserved. This
    product is protected by U.S. and international copyright and intellectual
    property laws. Pivotal products are covered by one or more patents listed
    at  Pivotal is a registered trademark
    of trademark of GoPivotal, Inc. in the United States and/or other
    jurisdictions.  All other marks and names mentioned herein may be
    trademarks of their respective companies.


As the Boot Application loads data there will be messages that look like stack traces, these are infact messages generated as the objects are serialized into Geode and are totally normal:

Started loading the products

[info 2015/07/29 11:34:56.156 EDT  <main> tid=0x9] Auto serializer generating type for class org.apache.geode.demo.fastfootshoes.model.Product for fields: 
      stockOnHand: private int org.apache.geode.demo.fastfootshoes.model.Product.stockOnHand
      wholeSalePrice: private double org.apache.geode.demo.fastfootshoes.model.Product.wholeSalePrice
      size: private double org.apache.geode.demo.fastfootshoes.model.Product.size
      brand: private java.lang.String org.apache.geode.demo.fastfootshoes.model.Product.brand
      name: private java.lang.String
      type: private java.lang.String org.apache.geode.demo.fastfootshoes.model.Product.type
      color: private java.lang.String org.apache.geode.demo.fastfootshoes.model.Product.color
      gender: private java.lang.String org.apache.geode.demo.fastfootshoes.model.Product.gender
      id: private java.lang.String

The final message is a summary of the data that was loaded.

********************DATA LOADING SUMMARY*********************
Customers: Records Read: 1000 Records Added To GemFire: 1000
Products: Records Read: 1000 Records Added To GemFire: 1000
Transactions: Records Read: 10000 Records Added To GemFire: 10000
Mark Ups: Records Read: 6 Records Added To GemFire: 6
Total Loading Time: 10 seconds
********************ERROR LOGS*******************************
No errors were recorded
**********Loading Completed**********
**********Press Enter To Exit**********

Press enter to exit.

  1. Execute to begin simulating transactions against the cluster.
    single-machine-mode$ ./
    Starting Transactions

Starting the Demo Application

  1. Run the script in another terminal window
  2. This will start a Spring Boot Application that connects to the cluster and a client and demonstrates some of the functionality of Geode

The final message in the window should show that the application has started and is listening on port 8080

HandlerMapping     : Mapped "{[/dump],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2015-07-29 11:47:26.914  INFO 68731 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2015-07-29 11:47:26.921  INFO 68731 --- [           main]  : Starting beans in phase 0
2015-07-29 11:47:27.062  INFO 68731 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2015-07-29 11:47:27.064  INFO 68731 --- [           main] o.a.g.d.f.application.Application        : Started Application in 5.246 seconds (JVM running for 5.677)

The application should now be started and can be tested by loading in a browser. demo application

Starting the Cluster and Client App Manually


geode-demo-application-master$ cd demo/geode-server-package
geode-server-package$ ./

The parameter is the IP address of the locators.

Historic Data (Initializing inventory data)

geode-demo-application-master$ cd demo/geode-server-package/app
app$ java -jar FastFootShoesHistoricDataLoader-0.0.1-SNAPSHOT.jar 

Client app

geode-demo-application-master$ cd demo/geode-server-package/app
app$ java -jar FastFootShoesRetail-0.0.1-RELEASE.jar --cluster.location= [--server.port=8080]

Use the same IP address for the cluster.location as when starting the cluster.


geode-demo-application-master$ cd demo/geode-server-package/app
app$ java -jar FastFootShoesTransactionSimulator-0.0.1-SNAPSHOT.jar --server.port=8383


single-machine-mode$ ./
Stopping Derby DB
Stopping the Cluster

(1) Executing - connect

Connecting to Locator at [host=localhost, port=10334] ..
Connecting to Manager at [, port=1099] ..
Successfully connected to: [, port=1099]

(2) Executing - shutdown --include-locators=true

Shutdown is triggered

Press any key to close this window...

Non-Graceful Full Teardown

If a situation arises were processes and running and the shutdown script is not working, run the script. If there are Locators and Servers running it will list the PID(s) and offer a prompt to kill these processes.

single-machine-mode$ ./
Locators Running:
22092 22108
Servers Running:
22121 22134 22147 22160
Would you like to kill these processes? ('Y' to kill)
Locators have been killed
Servers have been killed

Entering a 'Y' at the prompt will kill all these processes.

Geode Cluster Running On AWS

This demonstration uses two Amazon Linux EC2 instances. One acts as the client, and one acts as the Geode cluster. Start by creating two high-memory instances in the AWS console.

Instance Setup

In order for this demo to run correctly, specific ports need to be opened on at least the cluster instance. Open the following port range within the security group settings for the instance(s):

Protocol: TCP  Range: 1024-65535
Protocol: TCP  Port: 22

For the client app instance, the following ports are sufficient:

Protocol: TCP  Port: 22
Protocol: TCP  Port: 80

Using provided AMIs

There are two AMIs provided to assist with running the demo on two EC2 instances:

Using the distribution package

  1. Upload the geode-server-package to a suitable high-memory EC2 instance

    $ cd demo
    $ scp -r -i <certificate.pem> geode-server-package [email protected]<instance location>:
  2. Upload the client app on the other instance

    $ scp -i <certificate.pem> geode-server-package/app/FastFootShoesRetail-0.0.1-RELEASE.jar [email protected]<instance location>:

On the instance designated to be the cluster

$ cd ~/geode-server-package
$ ./startDerby
$ ./startCluster <public DNS for EC2 instance eg.>
$ ./ ... <enter>
$ ./

The log file for the transaction simulator is written in the same directory.

Shut down the cluster
$ ./

On the instance designated to be the client

$ sudo java -jar FastFootShoesRetail-0.0.1-RELEASE.jar --server.port=80 --cluster.location=<public DNS for EC2 instance above. eg.>

Visit the demo app in your browser via the public address of the client instance.