Skip to content

Latest commit

 

History

History

quickstart

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

#Apache Geode Quickstart

  1. To begin, first we need to install Apache Geode.

On a mac with homebrew installed, simply run:

brew tap pivotal/tap && brew install geode

For other systems, see How To Install Geode.

  1. Once Geode is installed, we can start a locator for our first Geode cluster:
$ gfsh
gfsh> start locator --name=locator1 --port=10334
  1. With a locator running, we can start spinning up our Geode servers. For this example, we'll just start two server processes running on our local machine.
gfsh> start server --name=server1 --server-port=40411
gfsh> start server --name=server2 --server-port=40412 
  1. We can verify that everything so far has started up as expected:
gfsh>list members
  Name   | Id
-------- | -------------------------------------------------
locator1 | 192.168.1.19(locator1:24390:locator)<ec><v0>:1024
server1  | 192.168.1.19(server1:24393)<ec><v1>:1025
server2  | 192.168.1.19(server2:24396)<ec><v2>:1026

  1. Everything is now in place to create our first Region. You can think of a Region as a distributed java.util.HashMap. There are some choices to be made about how exactly to distribute the entries in our Map. We could let each server maintain a full copy of the Map (this would be a replicated region), or if we had a very large map we might want to choose a partitioned region where each server only stores a subset of the entires. Full details about Regions and Region Shortcuts are available in the Geode documentation. For now, we'll create a replicated region:
gfsh>create region --name=regionA --type=REPLICATE
  1. Let's start the simulation:
$ ./gradlew :quickstart:run
  1. We can query our stock simulation data on Geode
gfsh> query --region=regionA --query="select key, value from /regionA.entrySet"
  1. Press enter to end the simulation, and then shut down Geode:
gfsh> shutdown --include-locators=true