-
Notifications
You must be signed in to change notification settings - Fork 1
Geode WAN Example
This article describes a complete set of steps for creating a local WAN environment. We'll create two (2) Geode clusters named ny
and ln
running on localhost
. We'll then configure the ny
cluster to replicate transactional data to the ln
cluster and run the perf_test
apps to generate transactional data.
A complementary bundle that has WAN clusters preconfigured and ready to be run is available in the geode-bundles repo. If you want to skip this article and just run the bundle, then you can install the bundle from a Geode/GemFire workspace as follows.
# To see instructions
show_bundle bundle-geode-1-app-perf_test_wan-cluster-ln-ny
# To install bundle
install_bundle -download -workspace bundle-geode-1-app-perf_test_wan-cluster-ln-ny
The steps we'll take are typical steps that you would take when preparing PadoGrid for your local environment.
- Install
padogrid
- Create Workspace
- Create Clusters
- Update Configuration Files
- Start Clusters
- Monitor Clusters
- Ingest Data
- Tear Down
- Summary
You can skip this section if you already have a workspace in which you want to walk through this tutorial.
Let's create a new workspace where we can create and test WAN clusters. Run the create_workspace
command which will prompt for Java, Geode, workspace name, default cluster, and VM prompts. Make sure to take the default value of false
for the Enable VM?
prompt. We'll be running clusters locally on your laptop.
create_workspace -name ws-wan
Make sure to switch workspace into the new workspace you just created.
switch_workspace ws-wan
Create the ny
and ln
clusters with different locator start port numbers as shown below.
# Create the ny cluster
create_cluster -cluster ny -port 10334
# Create the ln cluster
create_cluster -cluster ln -port 10344
Let's now configure the cache.xml
files to configure the summary
region to replicate over the WAN.
-
perf_test
performs transactions oneligibility
andprofile
data and inserts the results in thesummary
map, which we'll replicate over the WAN.
To enable WAN gateways, we must first assign a unique number defined by the GemFire property, distributed-system-id
to each cluster. This number must in the the range of 1 to 255, inclusive. The GemFire properties are set in the etc/gemfire.properties
file.
switch_cluster ny
vi etc/gemfire.properties
In addition to distributed-system-id
, we also need to set the remote-locators
property to the remote locators that this cluster will connect to. For our example, we set it to the ln
locator.
# ny ID
distributed-system-id=1
# ln locator (for multiple locators, separate them with comma)
remote-locators=localhost[10344]
We also need to configure the WAN gateway. This is done in the etc/cache.xml
file. Let's configure the ny
cluster as the sender as by adding the <gateway-sender>
element just below the <cache>
element and adding the <region-attributes>
element as shown below. It is important that the order of XML elements defined in the cache.xml
must be kept in the order they are defined in the schema file.
<cache ...>
<!-- Gateway sender -->
<gateway-sender id="ny-to-ln" remote-distributed-system-id="2" parallel="true"
dispatcher-threads="2" maximum-queue-memory="150" order-policy="partition">
</gateway-sender>
...
<cache-server port="${geode-addon.server.port}" />
...
<region name="summary" refid="PARTITION">
<region-attributes gateway-sender-ids="ln-to-ny"></region-attributes>
</region>
...
</cache>
As with the ny
cluster, the ln
cluster also requires the unique number set to the distributed-system-id
property.
switch_cluster ny
vi etc/gemfire.properties
Set distributed-system-id
to 2. Unlike ny
, we don't need to set the remote-locators
for ln
since it will not be sending but receiving data only.
# ln ID
distributed-system-id=2
Let's now configure the WAN gateway for ln
.
switch_cluster ln
vi etc/cache.xml
We only need to define it as the receiver as shown below. The start-port
and end-port
attributes are optional attributes that define the range of TCP ports that the receiver will listen on.
<cache ...>
<!-- Gateway receiver -->
<gateway-receiver start-port="50510" end-port="50520">
</gateway-receiver>
...
<cache-server port="${geode-addon.server.port}" />
...
</cache>
Let's start both clusters.
start_cluster -cluster ny
start_cluster -cluster ln
The clusters can be monitored in a number of ways, i.e., by Pulse, gfsh, VSD, JMX, Grafana, PadoGrid, etc. Let's use Pulse for our example. You can view the gateway sender activities from Pulse. To get the Pulse URLs for both clusters run the following:
show_cluster -long -cluster ny
show_cluster -long -cluster ln
You should see the following URLs from the command outputs.
Let's create and change directory to the perf_test
app's bin_sh
directory.
create_app
cd_app perf_test; cd bin_sh
The perf_test
app has already been properly configured to ingest data into the ny
cluster. By default, it connects to the locator at localhost[10334]
, which is the ny
locator in our example.
We first need to ingest data into the eligibility
and profile
regions before we can perform transactions. Run the following to populate these regions in the ny
cluster.
./test_ingestion -run
We are now ready to generate transactional data into the summary
region which we have configured to replicate over the WAN. The following command aggregates the eligibiliy
and profile
regions by the groupNumber
field and inserts the GroupSummary
objects that contain the aggregation information.
./test_tx -run
From Pulse, you should now see the summary
region populated in both clusters. Note that the eligibility
and profile
regions are only populated in the ny
cluster. This is because we have not configured them with the WAN gateway.
stop_cluster -all -cluster ny
stop_cluster -all -cluster ln
Replicating data over the WAN between Geode/GemFire clusters require the following configurations.
- Locators (
gemfire.properties
): Thedistributed-system-id
andremote-locators=localhost
properties. - Members (
cache.xml
): Thegateway-sender
andgateway-receiver
elements. Thegateway-sender-ids
region attribute for each region.
PadoGrid greatly simplifies the configuration steps and running clusters.
- Bundle: WAN, A complete bidirectional WAN example, bundle-geode-1-app-perf_test_wan-cluster-ln-ny.
PadoGrid Manual
Overview
- Home
- PadoGrid in 5 Minutes
- Quick Start
- Introduction
- Bundle Catalogs
- Building PadoGrid
- Supported Data Grid Products and Downloads
- PadoGrid Components
- Installing PadoGrid
- Root Workspaces Environments (RWEs)
- Initializing PadoGrid
- Bash Auto-Completion
- Viewing PadoGrid Summaries
- Updating Products
- Upgrading PadoGrid
- Migrating Workspaces
- PadoGrid Pods
- Kubernetes
- Docker
- Apps
- Software List
Operations
- Workspace Lifecycle Management
- Creating RWE
- Creating Workspace and Starting Cluster
- Managing Workspaces
- Understanding Workspaces
- Understanding Clusters
- Running Clusters
- Default Port Numbers
- Running Clusters Independent of PadoGrid
- Running Apps
- Understanding Groups
- Running Groups
- Understanding Bundles
- User Bundle Repos
- Using Bundle Templates
- Bundle Repo Guidelines
- User Bundle Catalogs
- Private Bundle Repos
- Gitea Repos
- Running Bundles in Container
- PadoGrid Addon Jars
- Understanding PadoGrid Pods
- Tested Vagrant Boxes
- VM-Enabled Pods
- Multitenancy
- Multitenancy Best Practices
- PadoGrid Configuration Files
Tools
Platforms
Clouds
Pado
Geode/GemFire
- Geode CLASSPATH
- Geode Kubernetes
- Geode Minikube
- Geode Minikube on WSL
- Geode Docker Compose
- Geode Grafana App
- Geode
perf_test
App - Geode WAN Example
- Geode Workspaces on VMs
- Geode on AWS EC2
- Reactivating Geode Workspaces on AWS EC2
Hazelcast/Jet
- Hazelcast CLASSPATH
- Creating Jet Workspace
- Configuring Hazelcast Addon
- HQL Query
- Hazelcast Kubernetes
- Hazelcast GKE
- Hazelcast Minikube
- Hazelcast Minikube on WSL
- Hazelcast Minishift/CDK
- Hazelcast OpenShift
- Hazelcast Docker Compose
- Hazelcast Desktop App
- Hazelcast Grafana App
- Hazelcast
jet_demo
App - Hazelcast
perf_test
App - Hazelcast WAN Example
- Hazelcast Workspaces on VMs
- Hazelcast on AWS EC2
- Reactivating Hazelcast Workspaces on AWS EC2
ComputeDB/SnappyData
Coherence
Hadoop
Kafka/Confluent
Mosquitto
- Mosquitto CLASSPATH
- Mosquitto Overview
- Installing/Building Mosquitto
- Clustering MQTT
- Cluster Archetypes
- Enabling Mosquitto SSL/TLS
- Mosquitto Docker Compose
- MQTT perf_test App
Redis
Spark