1. Lab 1
1.1 Install
Environment
- OS: MacOS Ventura
- bash: iTerm with zsh
- Download File
Download from VMware GemFire
Then select the RELEASE version, i.e.,9.10.13
And click the file marked VMware Tanzu GemFire
- 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
- 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
- Check the installation
gfsh version
1.2 gfsh
- Start the gfsh
- Start locator
start locator --name=LOCATOR_NAME
User can check the member via
list members
- Start server
start server --name=SERVER_NAME
- Create replicate region on server
create region --name=REGION_NAME --type=REGION_TYPE
PS, user can use
list region
to see all region list
- Put data into region
put --key=KEY --value=VALUE --region=REGION
Qeruy via
OQL
, which is a query language very similar to sql. And we can use thedescribe region
to see the detail. What need to be emphasized here is that the hosting members is onlyserver1
.
- 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.
Then we use describe region
to check the hosting memebers again, and can see that there are two data servers that hosted the region.
In order to better verify the results, we use stop server
to close the data server1:
Then we query the region data again via OQL, and can see the data on the data server 2:
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.
- 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
.