GemFire Learning Lab 1

35 阅读1分钟

1. Lab 1

1.1 Install

Environment

  • OS: MacOS Ventura
  • bash: iTerm with zsh
  1. Download File

Download from VMware GemFire
Then select the RELEASE version, i.e.,9.10.13
And click the file marked VMware Tanzu GemFire

  1. expand the compressed TAR file

Navigate to the deirctory where you downloaded the GemFile software, and execute this via bash:

$ tar -xzvf pivotal-gemfire-N.N.N.tgz -C path_to_product

PS, the path_to_product corresponds to the location where you want to install the GemFire, and N.N.N is the version number, i.e., 9.10.13

  1. Config the env params

If you use the zsh as bash, then try to export GemFire path in the ~/.zshrc, else if you use the bash as default, then try to change the ~/.bash_profile.

export GEMFIRE=path_to_product/pivotal-gemfire-N.N.N
PATH=$PATH:$GEMFIRE/bin
  1. Check the installation
gfsh version

1.2 gfsh

  1. Start the gfsh

image.png

  1. Start locator
start locator --name=LOCATOR_NAME

image.png

User can check the member via list members image.png

  1. Start server
start server --name=SERVER_NAME

image.png

  1. Create replicate region on server
create region --name=REGION_NAME --type=REGION_TYPE

PS, user can use list region to see all region list image.png

  1. Put data into region
put --key=KEY --value=VALUE --region=REGION

image.png

image.png

Qeruy via OQL, which is a query language very similar to sql. And we can use the describe region to see the detail. What need to be emphasized here is that the hosting members is only server1.
image.png

  1. Create other data server

It should be emphasized that we are trying to start diff server in one host, so the port need to be diff, then use --server-port=0 to tell GemFire to find a specific port to use.
image.png

Then we use describe region to check the hosting memebers again, and can see that there are two data servers that hosted the region.
image.png

In order to better verify the results, we use stop server to close the data server1:

image.png

Then we query the region data again via OQL, and can see the data on the data server 2: image.png

Since we selected the replicate type of reigon, each time a new data server is started, the original reigon will be copied to the new member.

  1. Leave and stop env

If you are try to execute exit, then you will be back to your bash, without any stop of GemFile, you can use gfsh and connect to be the old env.

The whole env will be stop only when you execute shutdown --include-locators.