Tanzu Gemfire
Tanzu Gemfire
Foundry
Tanzu GemFire on Cloud Foundry 2.1
Tanzu GemFire on Cloud Foundry
You can find the most up-to-date technical documentation on the VMware by Broadcom website at:
https://techdocs.broadcom.com/
VMware by Broadcom
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
Copyright © 2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its
subsidiaries. For more information, go to https://www.broadcom.com. All trademarks, trade names, service marks,
and logos referenced herein belong to their respective companies.
2
Tanzu GemFire on Cloud Foundry
Contents
Tanzu GemFire on Cloud Foundry v2.1 ........................... 11
Release Notes .................................................. 12
Version 2.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Additional Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Breaking Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Version 2.1.2 Product Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Version 2.1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Additional Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Breaking Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Version 2.1.1 Product Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
v2.1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Additional Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Breaking Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Version 2.1.0 Product Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Security ........................................................ 22
TLS Encryption for the Tanzu GemFire on Cloud Foundry Service Instance . . . . . . . . 22
Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Security within the Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3
Tanzu GemFire on Cloud Foundry
Upgrading ...................................................... 60
4
Tanzu GemFire on Cloud Foundry
5
Tanzu GemFire on Cloud Foundry
6
Tanzu GemFire on Cloud Foundry
7
Tanzu GemFire on Cloud Foundry
8
Tanzu GemFire on Cloud Foundry
9
Tanzu GemFire on Cloud Foundry
10
Tanzu GemFire on Cloud Foundry
VMware Tanzu GemFire on Cloud Foundry is a high-performance, high-availability caching layer for VMware
Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry). Tanzu GemFire on Cloud Foundry
offers an in-memory key-value store. It delivers low-latency responses to a large number of concurrent data-
access requests.
Tanzu GemFire on Cloud Foundry provides a service broker to create in-memory data clusters on demand.
These clusters are dedicated to the Tanzu Platform for Cloud Foundry space and tuned for specific use
cases defined by your service plan. Service operators can create multiple plans to support different use
cases.
Tanzu GemFire on Cloud Foundry uses VMware Tanzu GemFire. See VMware Tanzu GemFire API
Documentation for links to the API for client access to data objects within Tanzu GemFire.
Provides the Tanzu Platform for Cloud Foundry operator with instructions for installing, configuring,
and maintaining Tanzu GemFire on Cloud Foundry
Provides app developers instructions for choosing a service plan and creating and deleting Tanzu
GemFire on Cloud Foundry service instances
11
Tanzu GemFire on Cloud Foundry
Release Notes
This topic contains the release notes for VMware Tanzu GemFire on Cloud Foundry (Tanzu GemFire on
Cloud Foundry).
Version 2.1.2
Release Date: May 15, 2025
Supports VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 4.0
Additional Changes
This release includes the following additional changes:
Updated VMware Tanzu GemFire Search: Upgraded from version 1.1.1 to 1.2.0.
Updated VMware Tanzu GemFire Vector Database: Upgraded from version 1.1.0 to 1.2.0.
Updated VMware Tanzu GemFire Session Management: Upgraded from version 1.0.0 to 1.1.0.
Breaking Changes
No breaking changes in this release.
Version 2.1.2
Compatible VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 4.0
12
Tanzu GemFire on Cloud Foundry
Version 2.1.1
Release Date: April 15, 2025
Supports VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 4.0
The Tanzu GemFire for Redis Apps extension has been removed and is no longer
supported.
The Routing Release bug has been fixed in Tanzu GemFire on Cloud Foundry v2.1.1 with
the adoption of Routing Release version 0.333.0.
Additional Changes
This release includes the following additional changes:
Added compatibility with FIPS stemcells: Tanzu GemFire on Cloud Foundry v2.1.1 is now
compatible with FIPS Stemcells.
Updated VMware Tanzu GemFire Search Extension: Upgraded from version 1.1.0 to 1.1.1.
Fixed Routing Release bug: Resolved the issue by adopting Routing Release version 0.333.0.
Breaking Changes
No breaking changes in this release.
Version 2.1.1
Compatible VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 4.0
13
Tanzu GemFire on Cloud Foundry
v2.1.0
Release Date: May 24, 2024
Supports VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 5.0, 4.0, 2.13
The Tanzu GemFire for Redis Apps extension has been removed and is no longer
supported.
There is a bug with Routing Release version 0.296.0 that causes inconsistent behavior
when using Tanzu GemFire on Cloud Foundry v2.1.0 and Tanzu Application Service
versions 4.0.27 - 4.0.30, 6.0.7 - 6.0.10.
New Features
This release includes the following new features:
Support added for the GemFire Vector Database Extension: The GemFire VectorDB extension
1.1.0 is now included.
Support added for VM Extensions: Support for VM Extensions have been added for global and
individual plans.
You can set the number of locators per plan: This release adds the ability to set the number of
locators per plan for non-co-located plans.
Additional Changes
This release includes the following additional changes:
Removed the GemFire for Redis Apps Extension: The GemFire for Redis Apps Extension is no
longer supported and has been removed from the Tanzu GemFire on Cloud Foundry tile.
14
Tanzu GemFire on Cloud Foundry
GemFire Search Extension Updated from version 1.0.0 to 1.1.0: With the current version of
Tanzu GemFire on Cloud Foundry, GemFire Search Extension has been updated to 1.1.0 from its
previous version of 1.0.0.
Breaking Changes
No breaking changes in this release.
Version 2.1.0
Compatible VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 5.0, 4.0
15
Tanzu GemFire on Cloud Foundry
The following tables provide version and version-support information about VMware Tanzu GemFire on
Cloud Foundry (Tanzu GemFire on Cloud Foundry).
Version 2.1.0
Compatible VMware Tanzu Platform for Cloud Foundry versions 10.2, 10.0, 6.0, 5.0, 4.0
16
Tanzu GemFire on Cloud Foundry
This topic lists which service tiles offer on-demand and pre-provisioned service plans for use with VMware
Tanzu GemFire on Cloud Foundry. These plans let developers provision service instances when they want.
These contrast with the older pre-provisioned service plans, which require operators to provision the service
instances during installation and configuration through the service tile UI.
The following table lists which service tiles offer on-demand and pre-provisioned service plans:
RabbitMQ for VMware Pivotal RabbitMQ Yes Yes. Only recommended for test environments.
Tanzu [VMs]
Redis for VMware Redis Yes Yes (shared-VM plan). Recommended only for
Tanzu test environments.
For services that offer both on-demand and pre-provisioned plans, you can choose the plan to use when
configuring the tile.
17
Tanzu GemFire on Cloud Foundry
Architecture
This topic introduces and describes VMware Tanzu GemFire on Cloud Foundry architecture.
The Tanzu GemFire on Cloud Foundry architectural model is a client-server model. The clients are apps or
microservices, and the servers are a set of cluster servers maintained by a Tanzu GemFire on Cloud
Foundry service instance. The servers provide a low-latency, consistent, fault-tolerant data store within
Tanzu GemFire on Cloud Foundry.
The cluster holds data in key/value pairs. Each pair is called an entry. Entries are logically grouped into
sets called regions. A region is a map (or dictionary) data structure.
The app (client) uses Tanzu GemFire on Cloud Foundry as a cache. A cache lookup (read) is a get
operation on a region. The cache operation of a cache write is a put operation on a region. The command-
line interface, named gfsh, facilitates region administration. Use gfsh to create and destroy regions within
the Tanzu GemFire on Cloud Foundry service instance.
In the services foundation where the Tanzu GemFire on Cloud Foundry service instance runs.
These apps require no extra communication support.
In an app foundation, where a user-provided service instance proxies the communication to the
Tanzu GemFire on Cloud Foundry service instance. Communication with the Tanzu GemFire on
18
Tanzu GemFire on Cloud Foundry
Outside of any platform, where a platform is composed of any and all foundations. Communication
with the Tanzu GemFire on Cloud Foundry service instance requires a service gateway.
To use a service gateway, the operator must Configuring a Service Gateway. The developer must Provide
Optional Parameters when creating the Tanzu GemFire on Cloud Foundry service instance. And, the app
must be given and use properties that authenticate and authorize Communicating with a Service Instance
through the service gateway.
Member Communication
When a client connects to the cluster, it first connects to a locator. The locator replies with the IP address
of a server for it to talk to. The client then connects to that server.
19
Tanzu GemFire on Cloud Foundry
When the client wants to read or write data, it sends a request directly to the server.
If the server doesn’t have the data locally, it fetches it from another server.
20
Tanzu GemFire on Cloud Foundry
This topic lists the topics in this documentation set that discuss recommended usage and limitations when
using VMware Tanzu GemFire on Cloud Foundry.
See Design Patterns for descriptions of the variety of design patterns that Tanzu GemFire on Cloud
Foundry supports.
Tanzu GemFire on Cloud Foundry stores objects in key/value format, where the value can be any
object.
Using PDX objects as region entry keys is highly discouraged. For more information, see Using
PDX Objects as Region Entry Keys.
Limitations
See gfsh Command Restrictions for limitations on the use of gfsh commands.
Tanzu GemFire on Cloud Foundry does not support scaling down the cluster.
Tanzu GemFire on Cloud Foundry does not support plan migrations. The -p option to the cf
update-service command is not supported.
Tanzu GemFire on Cloud Foundry does not publish locator metrics for service instances created as
Co-located Single VM plans or Co-located Multi VM plans.
The Tanzu GemFire Developer REST API is not available for data operations.
Because VMware Tanzu Platform for Cloud Foundry applications are stateless, do not use the
Tanzu GemFire durable client feature.
21
Tanzu GemFire on Cloud Foundry
Security
This topic describes security when using VMware Tanzu GemFire on Cloud Foundry.
The security measures implemented for a VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for
Cloud Foundry) foundation and for Tanzu GemFire on Cloud Foundry service instances within that
foundation attempt to reduce harm from agents with foundation access. For general information about
security in Tanzu Platform for Cloud Foundry, see Tanzu Platform for Cloud Foundry Security in the Tanzu
Platform for Cloud Foundry documentation.
Transport-Layer Security (TLS) encryption prevents easy access to communication between components,
and role-based authentication and authorization limits access to data.
22
Tanzu GemFire on Cloud Foundry
Each of these unencrypted communication paths may be TLS-encrypted. Enabling TLS encryption
implements a one-way authentication of apps, verifying the identity of cluster members.
You must also secure gfsh communication. Follow directions in Connect with gfsh over HTTPS.
Networking
To allow app access to the Tanzu GemFire network, create application security groups. Allow access on the
following ports:
1099
8080
40404
55221
For more information, see Restricting App Access to Internal Tanzu Platform for Cloud Foundry
Components in the VMware Tanzu Platform for Cloud Foundry documentation.
Tanzu GemFire on Cloud Foundry works with the IPsec Add-on for Tanzu Platform for Cloud Foundry. For
more information, see IPsec for VMware Tanzu.
One set has four roles for users that integrate an external authentication such as LDAP via User
Account and Authentication (UAA). See Configuring UAA Roles for a description of the roles and
the configuration that completes the integration.
The other set of roles defaults when there is no external authentication integrated during the Tanzu
GemFire on Cloud Foundry tile installation. The identifiers assigned for these roles are detailed in
Create Service Keys. Tanzu GemFire on Cloud Foundry service instances are created with three
default user roles for interacting with clusters:
Cluster operator: manages the Tanzu GemFire cluster and can access region data. Has
the permissions CLUSTER:MANAGE, CLUSTER:WRITE, CLUSTER:READ, DATA:MANAGE,
DATA:WRITE, and DATA:READ.
Developer: can access region data. Has the permissions CLUSTER:READ, DATA:WRITE, and
DATA:READ.
Gateway sender: propagates region data to another Tanzu GemFire on Cloud Foundry
service instance. Has the permission DATA:WRITE.
Which set is used for a Tanzu GemFire on Cloud Foundry service instance depends on the options chosen
during Tanzu GemFire on Cloud Foundry tile installation.
All gfsh and JMX clients must authenticate as one of these user roles to access the cluster. To authorize
operations, each user role is given predefined permissions for cluster operations. To accomplish a cluster
operation, the user authenticates using one of the roles. Prior to initiating the requested operation, there is a
23
Tanzu GemFire on Cloud Foundry
verification that the authenticated user role has permission to do the operation. For more information about
these permissions, see Implementing Authorization in the VMware GemFire documentation.
24
Tanzu GemFire on Cloud Foundry
Operator Guide
This document describes how a VMware Tanzu Platform for Cloud Foundry operator can install, configure,
and maintain VMware Tanzu GemFire on Cloud Foundry.
In this topic:
Managing Certificates
The Networking for On-Demand Services section describes networking requirements for Tanzu
GemFire on Cloud Foundry.
Tanzu GemFire on Cloud Foundry requires TLS encryption for using gfsh and Pulse. Follow the
instructions in Preparing for TLS to set up TLS encryption.
For systems that implement an external authentication such as LDAP via User Account and
Authentication (UAA), follow the instructions within Create a UAA Client. There are also additional
25
Tanzu GemFire on Cloud Foundry
configuration steps to set up the SSO system, as given within Configuring UAA Roles.
On-demand services might require you to host them on a separate network from the default network. You
can also deploy on-demand services on a separate service networks to meet your own security
requirements.
Tanzu Platform for Cloud Foundry supports dynamic networking. Operators can use dynamic networking
with asynchronous service provisioning to define dynamically-provisioned service networks. For more
information, see Default Network and Service Network below.
On-demand services are enabled by default on all networks. Operators can optionally create separate
networks to host services in BOSH Director. Operators can select which network hosts on-demand service
instances when they configure the tile for that service.
Developers can provision IaaS resources for their services instances when the instances are
created. This removes the need for operators to pre-provision a fixed amount of IaaS resources
when they deploy the service broker.
Service instances run on a dedicated VM and do not share VMs with unrelated processes. This
removes the "noisy neighbor" problem, where an app monopolizes resources on a shared cluster.
Single-tenant services can support regulatory compliances where sensitive data must be separated
across different machines.
An on-demand service separates operations between the default network and the service network. Shared
service components, such as executive controllers and databases, Cloud Controller, UAA, and other on-
demand components, run on the default network. Worker pools deployed to specific spaces run on the
service network.
26
Tanzu GemFire on Cloud Foundry
The diagram below shows worker VMs in an on-demand service instance running on a separate services
network, while other components run on the default network.
The following table lists key components and their responsibilities in the on-demand architecture.
BOSH Agent Adds an agent on every VM that it deploys. The agent listens for instructions from the BOSH Director
and executes those instructions. The agent receives job specifications from the BOSH Director and
uses them to assign a role or job to the VM.
BOSH UAA Issues OAuth2 tokens for clients to use when they act on behalf of BOSH users.
ODB Instructs BOSH to create and update services. Connects to services to create bindings.
27
Tanzu GemFire on Cloud Foundry
Deployed service Runs the given service. For example, a deployed Tanzu GemFire service instance runs the Tanzu
instance GemFire service.
Regardless of the specific network layout, the operator must ensure network rules are set up so that
connections are open as described in the table below.
ODB
BOSH Agent BOSH Director 4222 Two-way The BOSH Agent runs
on every VM in the
system, including the
BOSH Director VM.
The BOSH Agent
initiates the connection
with the BOSH
Director.
The default port is not
configurable.
28
Tanzu GemFire on Cloud Foundry
Deployed apps on Deployed service 55221 (VMware Two-way These port numbers
VMware Tanzu instances GemFire locators) are not configurable.
Platform for Cloud
40404 (VMware
Foundry
GemFire servers)
A VPN may be used to connect the private network spaces that lay across the WAN. The steps required to
enable the connectivity by VPN are dependent on the IaaS providers.
The private address space for each service instance’s network must be configured with non-overlapping
CIDR blocks. Configure the network prior to creating service instances. Locate directions for creating a
network on the appropriate IAAS provider in Reference Architectures for Tanzu Operations Manager and
Runtime in the VMware Tanzu Operations Manager documentation.
This procedure involves restarting all of the VMs in an existing VMware Tanzu Platform for
Cloud Foundry (Tanzu Platform for Cloud Foundry) deployment in order to propagate a CA
29
Tanzu GemFire on Cloud Foundry
Overview
Enabling TLS provisions VMware Tanzu GemFire on Cloud Foundry service instances with a certificate, so
that apps, gfsh, and Pulse can establish encrypted connections with the Tanzu GemFire on Cloud Foundry
service instance.
The certificate deployed on the Tanzu GemFire on Cloud Foundry service instance is a server certificate.
The server certificate is generated by CredHub, a component designed for centralized credential
management in Tanzu Platform for Cloud Foundry. CredHub is deployed on the same VM as the BOSH
Director.
CredHub generates the server certificate using a Certificate Authority (CA) certificate. The CA certificate
must be provided to CredHub by the operator or generated by CredHub.
Apps use the CA certificate to authenticate components of Tanzu GemFire on Cloud Foundry service
instances. Apps that communicate with Tanzu GemFire on Cloud Foundry must have access to the CA
certificate in order to validate that the server certificate can be trusted.
Perform the following steps to log in to CredHub and provide or generate a CA certificate:
1. From the Ops Manager VM, set the API target of the CredHub CLI to your CredHub server:
For example:
2. Log in to CredHub:
30
Tanzu GemFire on Cloud Foundry
Where: * CLIENT-NAME is the client name, usually ops_manager or a CredHub-specific UAA client of
your own creation. * CLIENT-SECRET is the client secret. Locate this under the Credentials tab of
the Ops Manager tile with the name Bosh Commandline Credentials.
For example:
$ credhub login \
--client-name=ops_manager \
--client-secret=abcdefghijklm123456789
3. Use the CredHub CLI to check whether a services CA certificate already is present:
If you do not have a CA certificate, use the CredHub CLI to generate one:
credhub generate \
--name="/services/tls_ca" \
--type="certificate" \
--no-overwrite \
--is-ca \
--common-name="rootCA"
If you have an existing CA certificate that you want to use, create a new file named
root.pem with the contents of the certificate. Then enter the following command,
specifying the path to root.pem and the private key for the certificate:
credhub set \
--name="/services/tls_ca" \
--type="certificate" \
--certificate=./root.pem \
--private=ERKSOSMFF...
5. Use the BOSH CLI v2 to extract the certificate portion from the CA certificate and print it:
31
Tanzu GemFire on Cloud Foundry
2. Copy and paste the contents of the CA certificate into Trusted Certificates. If Trusted Certificates
are already listed, append the new certificate to the existing content.
3. Check Include Tanzu Ops Manager Root CA in Trusted Certs to place the Tanzu Ops Manager
Root CA into the trusted certificate field. The BOSH Director then places this CA into the truststore
of every VM that it deploys.
4. For Generate VM passwords or use single password for all VMs, select Generate passwords
or Use default BOSH password, depending on your implementation needs.
5. Click Save.
Add the CA certificate to the Tanzu Platform for Cloud Foundry tile
1. The CA certificate must also be added for the Gorouter. On the Tanzu Platform for Cloud Foundry
tile, navigate to the Settings tab.
2. Click on Networking. Add the CA certificate to the box labeled Certificate Authorities Trusted by
Gorouter.
32
Tanzu GemFire on Cloud Foundry
3. Scroll down and add the CA certificate to the box labeled Certificate Authorities trusted by the
HAProxy.
4. Click Save.
2. Click Review Pending Changes. For more information, see Reviewing Your Pending Product
Changes in Tanzu Operations Manager in the VMware Tanzu Operarations Manager documentation.
Extra configuration is required when defining users that have specific security roles with an external
authentication such as LDAP through User Account and Authentication (UAA).
Authenticating using an external authentication such as LDAP through UAA uses the UAA server. Access
the UAA server through its command-line interface, UAAC.
When enabling the use of an external authentication such as LDAP through UAA during Tanzu GemFire on
Cloud Foundry tile configuration, you will specify a UAA client, as described in Security. This procedure
creates that UAA client.
Create a UAA client for use in tile configuration with the command:
33
Tanzu GemFire on Cloud Foundry
Replace THE-SECRET with your chosen password (secret) for this UAA client. The remainder of the
command is exactly as shown. The UAA client name is cloudcache_gfsh.
With a Tanzu Operation Manager role that has permissions to install and configure, follow the steps below
to install Tanzu GemFire on Cloud Foundry on VMware Tanzu Platform for Cloud Foundry (Tanzu Platform
for Cloud Foundry).
For more information about Tanzu Operation Manager role, see Configuring Role-Based Access Control in
Tanzu Operations Manager in the VMware Tanzu Operations Manager documentation.
Procedure
1. Download the tile from Broadcom Support.
2. Click Import a Product to import the tile into Tanzu Operations Manager.
5. Complete all the configuration steps in the Configure Tile Properties section below.
6. Return to the Ops Manager Installation Dashboard. Click Review Pending Changes. For more
information, see Reviewing Your Pending Product Changes in Tanzu Operations Manager in the
VMware Tanzu Operations Manager documentation.
7. Click Apply Changes to complete the installation of the Tanzu GemFire on Cloud Foundry tile.
34
Tanzu GemFire on Cloud Foundry
35
Tanzu GemFire on Cloud Foundry
As you complete a section, save it. A green check mark appears next to the section name. Each section
name must show this green check mark before you can complete your installation.
Procedure
VM Extensions
Global Settings
Syslog
Security
Errands
2. Configure the fields on the Assign AZs and Networks pane as follows:
Field Instructions
Place singleton Select the region that you want for singleton VMs.
jobs in
Balance other Select the AZs that you want to use for distributing other cluster VMs. VMware recommends
jobs in that you select all of them.
3. Click Save.
36
Tanzu GemFire on Cloud Foundry
Note: Smoke tests will fail unless you enable global default application security groups
(ASGs). You can enable global default ASGs by binding the ASG to the system org without
specifying a space. To enable global default ASGs, use cf bind-running-security-
group.
2. Ensure that the selected plan is enabled and configured. For information about configuring plans,
see Configure Service Plans below. If the selected plan is not enabled, the smoke-tests errand
fails.
VMware recommends that you use the smallest four-server plan for smoke tests. Because smoke tests
create and later destroy this plan, using a very small plan reduces installation time.
If BOSH is configured to use an external blob store, you must allow outbound internet access from service
instances. Log forwarding and backups, which require external endpoints, might also require internet
access.
37
Tanzu GemFire on Cloud Foundry
Note: Outbound network traffic rules also depend on your IaaS settings. Consult your
network or IaaS administrator to ensure that your IaaS allows outbound traffic to the
external networks that your require.
1. Replace the default value of 0 with your new default value. Acceptable values are integers greater
than or equal to 0 and less than or equal to 255.
1. If the communication between apps and the Tanzu GemFire on Cloud Foundry service instance
require a service gateway, select the Yes radio button in the Enable Service Gateway setting. This
38
Tanzu GemFire on Cloud Foundry
permits the instantiation of the service gateway when a service instance is created and specifies a
service gateway.
2. Enter a Fully Qualified Domain Name (FQDN) for the FQDN for TCP Router field. This was the
FQDN that you used when you enabled TCP routing. You can also find the in the output of the cf
domains command. From the output, select the name field with type tcp.
3. Set the Ingress Port for TCP Router field with an unused port that you noted when you enabled
TCP routing. Alternatively, to find the range of ports from which to choose, in Ops Manager click
Tanzu Platform for Cloud Foundry, then select Networking. The range of ports from which to
choose is near the bottom of the page in a field named TCP routing ports under the heading TCP
routing.
4. Click Save.
2. Click Save.
39
Tanzu GemFire on Cloud Foundry
You will configure 11 individual plans by selecting each of the tabs. There are Plan 1 through Plan 5, three
plans that reside on a single VM (called Co-located Single VM Plan), and three plans that spread locators
and servers among three VMs (called Co-located Multi VM Plan).
40
Tanzu GemFire on Cloud Foundry
41
Tanzu GemFire on Cloud Foundry
The Plan Enabled option is selected by default. If you do not want to add this plan to the CF
service catalog, select Plan Disabled. You must enable at least one plan.
The Plan Name text field allows you to customize the name of the plan. This plan name is
displayed to developers when they view the service in the Marketplace.
The Plan Description text field allows you to supply a plan description. The description is
displayed to developers when they view the service in the Marketplace.
The Enable metrics for service instances checkbox enables metrics for service instances
created using the plan. Once enabled, the metrics are sent to the Loggregator Firehose.
The CF Service Access drop-down menu gives you the option to display or hide the service plan in
the Marketplace.
Disable Service Access makes the plan unavailable in the Marketplace. If you choose this
option, you cannot make the plan available at a later time.
Leave Service Access Unchanged makes the plan unavailable in the Marketplace by
default, but allows you to make it available at a later time.
The Maximum service instances field sets the maximum number of Tanzu GemFire on Cloud
Foundry clusters that can exist simultaneously.
When developers create or update a service instance, they can specify the number of servers in
the cluster. The Maximum servers per cluster field allows operators to set an upper bound on the
number of servers developers can request. If developers do not explicitly specify the number of
servers in a service instance, a new cluster has the number of servers specified in the Default
Number of Servers field.
The Availability zones for service instances setting determines which AZs are used for a
particular cluster. The members of a cluster are distributed evenly across AZs.
After you select AZs for your service network, you cannot add additional AZs. Adding
additional AZs causes existing service instances to lose data on update.
Most of the remaining fields control the VM type and persistent disk type for servers and locators. The total
size of the cache is directly related to the number of servers and the amount of memory of the selected
server VM type. VMware recommends the following configuration:
For the VM type for the Locator VMs field, select a VM that has at least 2 CPUs, 1 GB of RAM
and 4 GB of disk space.
For the Persistent disk type for the Locator VMs field, select 10 GB or higher.
For the VM type for the Server VMs field, select a VM that has at least 2 CPUs, 4 GB of RAM
and 8 GB of disk space.
For the Persistent disk type for the server VMs field, select 10 GB or higher.
42
Tanzu GemFire on Cloud Foundry
extensions that are configured under the Configure List of VM Extensions section.
When you finish configuring the plan, click Save to save your configuration options.
VM Extensions
The Tanzu GemFire on Cloud Foundry tile implements the VM Extension feature following the RabbitMQ
tile’s approach. The procedures in this topic are nearly identical regarding VM Extensions as described in
the Configure Global Settings, and Configure the service plans sections in the Installing and Configuring the
On-Demand RabbitMQ Service in the Tanzu RabbitMQ on Cloud Foundry documentation.
Global Settings
After configuring platform tags as described in Installing and Configuring Tanzu GemFire on Cloud Foundry,
you can add the list of VM extensions. For more information, see Configure Global Settings in Installing and
Configuring the On-Demand RabbitMQ Service in the Tanzu RabbitMQ on Cloud Foundry documentation.
This enters the names of VM extensions to apply to all service instances. You can separately apply added
sets of VM extensions on each specific plan. For more information, see the preceding section, Configure
Service Plans.
You can manage custom VM Extensions in Tanzu Operations Manager or through the OM CLI. For more
information, see Create or Update a VM Extension or om create-vm-extension in GitHub.
You can use this to deactivate IaaS-specific behavior. For example, you can use a VM extension to
deactivate vMotion in a vSphere infrastructure.
43
Tanzu GemFire on Cloud Foundry
44
Tanzu GemFire on Cloud Foundry
The default value for Number of Locators, which is 3, can be changed to a valid integer ranging from a
minimum of 1 to a maximum of 3. With this, you can increase or decrease the number of locators before
applying your changes.
The number of locators can only be changed before deploying the tile. Once you’ve applied
your changes and the tile has been deployed, this value cannot be altered. If you try to
change the number of locators after the tile has been deployed, when you apply changes,
you get an error message stating the job-process failed to run.
Data loss results when the single VM that this plan provides powers down or restarts.
The plan automatically creates a single region named example_partition_region. The region type is
PARTITION, a partitioned region without redundancy or persistence of entries. You can create other regions
as necessary with a Co-located Single VM Plan service instance.
There are three Co-located Single VM Plans to configure. The page for configuring this plan is similar to the
page for configuring other service plans. To configure a Co-located Single VM Plan, input information in the
fields and make selections from the options on each Configure Co-Located Single VM Plan page.
45
Tanzu GemFire on Cloud Foundry
46
Tanzu GemFire on Cloud Foundry
This type of plan is appropriate for production installations that can tolerate the diminished load-handling
capacity and reduced resilience that would result from the loss of a VM. Installations needing resilience in
the face of a VM loss should use a plan in which each Tanzu GemFire on Cloud Foundry cluster member
resides within its own VM.
You can create a Tanzu GemFire on Cloud Foundry service instance using a Co-located Multi VM Plan with
more servers than the default three servers. Follow the instructions in Create or Delete a Service Instance
to increase the number of servers.
Scale up an existing service instance by increasing the number of servers, as specified in Updating a
Tanzu GemFire on Cloud Foundry Service Instance.
Whether creating a new service instance or updating an existing service instance to have more servers,
each additional server will be within its own VM.
Scaling down the quantity of servers within an existing service instance is accomplished one server at a
time to ensure redundancy is correctly maintained. To scale down, use the cf update-service command
as described in Updating a Tanzu GemFire on Cloud Foundry Service Instance to specify one server fewer
than the total quantity of servers currently running.
An error message will be issued if you attempt to scale down by more than one server at a time, or if you
attempt to reduce the number of servers below the minimum size of the default Co-located Multi VM Plan
size of three servers.
To configure a Co-located Multi VM Plan, enable the plan with the Co-located Multi VM Plan tab.
47
Tanzu GemFire on Cloud Foundry
48
Tanzu GemFire on Cloud Foundry
Syslog
By default, syslog forwarding is not enabled in Tanzu GemFire on Cloud Foundry. However, Tanzu GemFire
on Cloud Foundry supports forwarding syslog to an external log management service, for example, to
Papertrail, Splunk, or your custom enterprise log sink. Use the broker logs for debugging problems creating,
updating, and binding service instances.
1. Click Syslog.
Field Instructions
Address Enter the address or host of the syslog server for sending logs, for example,
logs.example.com.
Port Enter the port of the syslog server for sending logs, for example, 29279.
Send service By default, only the broker logs are forwarded to your configured log management service.
instance logs to To forward server and locator logs from all service instances, select this option. This lets
external you monitor the health of the clusters, but generates a large volume of logs files.
If you do not enable this option, only the broker logs which include information about service
instance creation are forwarded, without logs about on-going cluster health.
Enable TLS Select to enable secure log transmission through TLS. Without this, remote syslog sends
unencrypted logs. VMware recommends that you enable TLS, as most syslog endpoints
such as Papertrail and Logsearch require TLS.
Permitted Peer This option is required if TLS is enabled. If several peer servers can respond to remote
syslog connections, provide a regex, such as *.example.com.
SSL Certificate Specifies the CA certificate for TLS communication. If the server certificate is not signed by
a known authority, for example, an internal syslog server, provide the CA certificate of the
log management service endpoint.
3. Click Save.
49
Tanzu GemFire on Cloud Foundry
You can upgrade a configurable number of service instances concurrently by entering a new value that is
greater than 1 and less than the BOSH worker count for the Number of simultaneous upgrades.
1. Specify a set of service instances to act as canaries for the upgrade process by changing the
Number of upgrade canary instances to a value greater than 0. If all canary instances
successfully upgrade, the remaining instances are upgraded. If any canary instance fails to
upgrade, the upgrade fails and no further instances are upgraded.
2. Click Save.
Security
There are three configuration aspects to the Security settings. Each of the three must be considered and
appropriately handled within these settings. Once the Security properties settings have been set, click
Save. The Security properties Settings page appears as:
1. The environment may be configured to more securely store service keys within CredHub, instead of
within the cloud controller’s data store. To enable this functionality, click on the box labeled Enable
Secure Service Instance Credentials to enable use of CredHub. When service keys are stored
within CredHub, output from the cf env APP-NAME command will not show credentials.
50
Tanzu GemFire on Cloud Foundry
2. An X is required in the text box to promote the understanding that the environment must be set up
to handle TLS encryption. For information about preparing the Tanzu Platform for Cloud Foundry
environment, see Preparing for Transport Layer Security (TLS).
3. If User Account and Authentication (UAA) of Tanzu GemFire on Cloud Foundry users will use an
external system, enable this with the radio button labeled UAA Auth enabled. With UAA enabled,
create a UAA client before doing this tile installation as explained in Create a User Account and
Authentication (UAA) Client. Follow the instructions in Configuring User Account and Authentication
(UAA) Roles to complete the configuration by setting up the user roles. With UAA enabled, two text
boxes will appear. Fill the boxes with the UAA client name and that client’s secret, which were set
when the client was created.
Errands
By default, post-deploy and pre-delete errands always run. VMware recommends keeping these defaults.
However, if necessary, you can change these defaults as follows.
For general information about errands in Tanzu Platform for Cloud Foundry, see Managing Errands in Your
Tanzu Operations Manager Deployment in the VMware Tanzu Operations Manager documentation.
1. Click Errands.
3. Click Save.
VM Memory Allocation
This topic describes virtual machine memory allocation in VMware Tanzu GemFire on Cloud Foundry.
The service plans you choose determines how memory is allocated to the cluster processes. One
consideration is how much memory is available in each VM.
A colocated plan is one in which each VM hosts one locator and one server. For example, the
default small-footprint plan comprises three locators and three servers hosted on three VMs.
A non-colocated plan is one in which each locator or server runs in its own VM. For example, the
default medium plan comprises three locators and four servers, each running in its own VM, for a
total of seven VMs.
The following sections describe how Tanzu GemFire on Cloud Foundry allocates memory based on the total
memory of each VM.
If total VM memory is greater than 5GB, 10% of total memory is allocated for the locator Java
heap; 90% of the remaining memory is allocated to the cluster server’s Java heap, and the
remainder is allocated to the OS.
51
Tanzu GemFire on Cloud Foundry
Server heap is reduced to accommodate the Anti-Virus and File Integrity Monitoring (FIM) add-ons, if
they are present.
If total VM memory is 2GB or less, 1GB is allocated for the locator or server Java heap, and the
remainder to the OS.
If total VM memory is between 2G and 8GB, 2GB is allocated to the OS, and the remainder to the
locator or server Java heap.
If total VM total memory is greater than 8G, 4GB is allocated to the OS, and the remainder to
locator or server Java heap.
Server heap is reduced to accommodate the Pivotal Anti-Virus and File Integrity Monitoring (FIM) Tanzu
Platform for Cloud Foundry add-ons, if they are present.
The UAA roles are not the same as the default roles used by Tanzu GemFire on Cloud
Foundry when external authentication has not been activated. For information about the
default roles, see Security within the Cluster in Security.
Overview
Tanzu GemFire on Cloud Foundry service instances include predefined security roles for use with UAA.
Each role has specific permissions for cluster operations. Each user is assigned one or more of these
roles.
When a user invokes a cluster operation using gfsh, the security manager for the Tanzu GemFire on Cloud
Foundry service verifies that at least one of the user’s security roles has the permissions required to
perform the cluster operation.
The cluster within a Tanzu GemFire on Cloud Foundry service instance implements role-based
authentication and authorizes cluster operations based upon the roles. Two sets of roles exist:
UAA Roles: A set of roles for Tanzu GemFire on Cloud Foundry instances that integrate with
external authentication like LDAP.
Default Roles: The default roles used by Tanzu GemFire on Cloud Foundry when no external
authentication was integrated during the Tanzu GemFire on Cloud Foundry tile installation.
This topic describes how to configure UAA roles. For information about the default roles, see Security
within the Cluster in Security.
Prerequisites
52
Tanzu GemFire on Cloud Foundry
1. Before installing Tanzu GemFire on Cloud Foundry and configuring UAA roles, you must create a
UAA client. For more information, see Create a User Account and Authentication (UAA) Client.
Record the UAA client name and client secret.
2. Before configuring UAA roles, you must activate UAA Authorization within the Tanzu GemFire tile:
1. In the Ops Manager Installation Dashboard, open the Tanzu GemFire tile.
3. Select the UAA Auth enable radio button and input the UAA client name and client secret
when prompted.
For more information about configuring the Tanzu GemFire tile, see Installing and Configuring Tanzu
GemFire on Cloud Foundry.
CLUSTER:READ
DATA:MANAGE
DATA:WRITE
DATA:READ
CLUSTER:READ
DATA:WRITE
DATA:READ
53
Tanzu GemFire on Cloud Foundry
Before configuring the UAA roles, you must configure Tanzu GemFire on Cloud Foundry to use UAA. For
more information, see Prerequisites.
Configure the UAA server and your external authentication system, such as LDAP, with the Space-specific
roles as follows:
1. In a terminal window, log in to the Cloud Foundry CLI and your Org. For example:
cf login
cf target -o NAME-OF-ORG
2. Retrieve and record the GUID of the Space that will host your Tanzu GemFire on Cloud Foundry
service instance using the command below. You use this GUID to create Space-specific groups
within your Enterprise SSO system in the next step.
Where NAME-OF-SPACE is the name of the Space that will host your Tanzu GemFire on Cloud
Foundry service instance.
03badc2a-4243-4251-84b5-c9bfba276f04
3. Create Space-specific groups for each of the UAA roles within your Enterprise SSO system. The
name of each group is the name of the UAA role followed by an underscore character, followed by
the GUID of the Space that you recorded in the previous step.
Using the Space GUID in the example above, the names of the groups would be: * PCC_ADMIN
group: PCC_ADMIN_03badc2a-4243-4251-84b5-c9bfba276f04 * PCC_OPERATOR group:
PCC_OPERATOR_03badc2a-4243-4251-84b5-c9bfba276f04 * PCC_DATA-ACCESS group:
PCC_DATA-ACCESS_03badc2a-4243-4251-84b5-c9bfba276f04 * PCC_CLUSTER-READ-ONLY
group: PCC_CLUSTER-READ-ONLY_03badc2a-4243-4251-84b5-c9bfba276f04 * PCC_READ-ONLY
group: PCC_READ-ONLY_03badc2a-4243-4251-84b5-c9bfba276f04
4. Assign users to these Space-specific groups within your Enterprise SSO system.
5. In a terminal window, use the UAA Command Line Interface (UAAC) to log in as admin client to
your UAA server.
6. Use the UAAC to add each group name to the UAA server by running the following command for
each group:
For example, using the group name from above, the following commands add the groups to the
UAA server:
54
Tanzu GemFire on Cloud Foundry
7. Use the UAAC to map each group name to the UAA server by running the uaac group map
command. For example, for LDAP:
Where: * ROLE_SPACEGUID is a group name that you created in a previous step. * GROUP-
DISTINGUISHED-NAME is the LDAP distinguished name of a Space-specific group that you created
in a previous step.
For example:
For more information about the uaac group map command, see Grant Admin Permissions to an
External Group (SAML, LDAP, or OIDC) in the VMware Tanzu Platform for Cloud Foundry product
documentation.
On-demand provisioning is intended to accelerate app development by eliminating the need for development
teams to request and wait for operators to create a service instance. However, to control costs, operations
teams and administrators must ensure responsible use of resources.
There are several ways to control the provisioning of on-demand service instances by setting various
quotas at these levels:
Global
55
Tanzu GemFire on Cloud Foundry
Plan
Org
Space
The operator sets a global quota for each service tile independently. For example, if you have two service
tiles, you must set a separate global service quota for each of them.
When the global quota is reached for a service, no more instances of that service can be created unless the
quota is increased, or some instances of that service are deleted.
When the plan quota is reached, no more instances of that plan can be created unless the plan quota is
increased or some instances of that plan are deleted.
When this quota is met, no more service instances of any kind can be created in the org unless the quota is
increased or some service instances are deleted.
1. Run this command to create a quota for service instances at the org level:
Where:
56
Tanzu GemFire on Cloud Foundry
ROUTES is the maximum number of routes allowed for all service instances combined.
SERVICE-INSTANCES is the maximum number of service instances allowed for the org.
For example:
2. Associate the quota you created above with a specific org by running the following command:
For example:
For more information about managing org-level quotas, see Creating and Modifying Quota Plans in Tanzu
Platform for Cloud Foundry in the Tanzu Platform for Cloud Foundry product documentation.
When this quota is met, no more service instances of any kind can be created in the space unless the
quota is updated or some service instances are deleted.
Where:
ROUTES is the maximum number of routes allowed for all service instances, combined.
SERVICE-INSTANCES is the maximum number of service instances allowed for the org.
For example:
57
Tanzu GemFire on Cloud Foundry
low-paid-service-plans
2. Associate the quota that you created above with a specific space by running the following
command:
For example:
For more information about managing org-level quotas, see Creating and Modifying Quota Plans in Tanzu
Platform for Cloud Foundry in the Tanzu Platform for Cloud Foundry product documentation.
cf org ORG-NAME
cf space SPACE-NAME
For more information about managing org-level quotas, see Creating and Modifying Quota Plans in Tanzu
Platform for Cloud Foundry in the Tanzu Platform for Cloud Foundry product documentation.
Note: Quota metrics are not emitted if no quota has been set.
You can also view service instance usage information in Apps Manager. For more information, see
Reporting Instance Usage with Apps Manager in the Tanzu Platform for Cloud Foundry product
documentation.
58
Tanzu GemFire on Cloud Foundry
On-demand plans use dedicated VMs, disks, and various other resources from an IaaS, such as AWS. To
calculate maximum resource cost for plans individually or combined, multiply the quota by the cost of the
resources selected in the plan configurations. The specific costs depend on your IaaS.
To view configurations for your Tanzu GemFire on-demand plan, do the following:
1. Navigate to Tanzu Operations Manager Installation Dashboard > Tanzu GemFire > Settings.
The image below shows an example that includes the VM type and persistent disk selected for the server
VMs, as well as the quota for this plan.
59
Tanzu GemFire on Cloud Foundry
Note: Although operators can limit on-demand instances with plan quotas and a global
quota, as described in the above topics, IaaS resource usage still varies based on the
number of on-demand instances provisioned.
For example, if you selected the options in the above image, you have selected a VM type micro and a
persistent disk type 20 GB, and the plan quota is 15. The VM and persistent disk types have an associated
cost for the IaaS that you are using. Therefore, to calculate the maximum cost of resources for this plan,
multiply the cost of the resources selected by the plan quota:
(15 x cost of micro VM type) + (15 x cost of 20 GB persistent disk) = max cost per plan
For example:
(plan1 quota x plan1 resource cost) + ( plan2 quota x plan2 resource cost) = max cost for all plans
1. Find the number of instances currently provisioned for each active plan by looking at the
total_instance metric for that plan.
2. Multiply the total_instance count for each plan by that plan’s resource costs. Record the costs
for each plan.
3. Add up the costs noted in Step 2 to get your total current resource costs.
For example:
(plan1 total_instances x plan1 resource cost) + (plan2 total_instances x plan2 resource cost) =
current cost for all plans
Upgrading
This topic describes upgrading VMware Tanzu GemFire on Cloud Foundry (Tanzu GemFire on Cloud
Foundry).
You can upgrade directly to Tanzu GemFire on Cloud Foundry version 2.1 from the latest patch release of
versions 1.10 or later. This “jump upgrade” is a two-step process:
Upgrade
60
Tanzu GemFire on Cloud Foundry
Validation Errand
2.0 2.0.2
1.14 1.14.8
1.13 1.13.7
1.12 1.12.4
1.11 1.11.3
1.10 1.10.9
Upgrading to Tanzu GemFire on Cloud Foundry 2.0 from any version other than those shown in the table
above requires multiple steps. For example, if your current version is v1.10.5, you must first upgrade to the
latest patch of 1.10 shown in the table before you can jump upgrade to v2.0.
Each Tanzu GemFire on Cloud Foundry release is compatible with two VMware Tanzu Platform for
Cloud Foundry (Tanzu Platform for Cloud Foundry) and Ops Manager versions. Incorporate those
upgrades to Tanzu Platform for Cloud Foundry and Ops Manager in your upgrade process as
required to maintain compatibility.
If your application connects through the Services Gateway feature (introduced in v1.13.0), you
must first upgrade to the latest Tanzu GemFire on Cloud Foundry v1.13 patch before upgrading
further.
To upgrade to v1.9 from an earlier release, you must upgrade minor releases in sequential order.
For example, you must upgrade v1.7 to v1.8 before upgrading to v1.9.
Tanzu GemFire on Cloud Foundry version 1.13.1 included an Apache Geode v1.13.2 performance
improvement that increased the defaults for maximum number of pooled message processor
threads and maximum partitioned region message processor threads.
If you are upgrading from a version of Tanzu GemFire on Cloud Foundry earlier than version 1.13.1,
and your system had been reaching the older, lower default maximums, then upgrading to v2.0 may
result in increased use of system resources because the system is no longer constrained to the
older values. If your system depends on constraining system resources to the older default values,
set these properties explicitly using DistributionManager.MAX_THREADS and
DistributionManager.MAX_PR_THREADS.
The following table shows the older and new maximum values.
61
Tanzu GemFire on Cloud Foundry
Upgrade
Follow these steps to upgrade Tanzu GemFire on Cloud Foundry:
4. Click on the Tanzu GemFire on Cloud Foundry tile and configure the upgrade options.
To try the upgrade on a small number of service instances first, set the quantity of canary
service instances as described in Service Instance Upgrades.
Set the number of instances that are to be upgraded in parallel as described in Service
Instance Upgrades.
Under the Errands section, choose the Default (On) value for the Upgrade All Service
Instances post-deploy errand. Save the change.
5. Click Review Pending Changes. For more information, see Reviewing Your Pending Product
Changes in Tanzu Operations Manager in the VMware Tanzu Operations Manager documentation.
An operator enables individual service instance upgrades during tile installation. This feature requires Tanzu
Platform for Cloud Foundry and Ops Manager 2.7 or a higher version and works for upgrading from Tanzu
GemFire on Cloud Foundry 1.9.0 to a higher version.
Within the Tanzu GemFire on Cloud Foundry tile, in the Errands section, the default for the Upgrade All
Service Instances errand, which upgrades all service instances, appears as:
To change the state of this errand such that individual service instance upgrades are enabled, choose Off
for this errand:
62
Tanzu GemFire on Cloud Foundry
Click Save.
Once individual service instance upgrades are enabled, the developer upgrades an individual service
instance following the instructions in Upgrade a Single Service Instance.
Validation Errand
If you are upgrading to Tanzu GemFire on Cloud Foundry v2.0, you should first use gfsh to destroy the
Lucene indexes on persistent regions before restarting the cluster.
Tanzu GemFire on Cloud Foundry v2.0 does not enforce this requirement during the processing of cf
update-service <service_instace_name> --upgrade, but it does include a validation errand that is
executed before making the upgrade available to developers.
If this errand fails, the errand’s output lists the Service instances that contain indexes that must be deleted
before upgrade.
63
Tanzu GemFire on Cloud Foundry
Updating Plans
This topic explains how to update VMware Tanzu GemFire on Cloud Foundry plans.
2. Click on the plan you want to update under the Information section.
3. Edit the fields with the changes you want to make to the plan.
6. Click Review Pending Changes. For more information, see Reviewing Your Pending Product
Changes in Tanzu Operations Manager in the VMware Tanzu Operations Manager documentation.
Plan changes are not applied to existing services instances until you run the upgrade-all-service-
instances BOSH errand. You must use the BOSH CLI to run this errand. Until you run this errand,
64
Tanzu GemFire on Cloud Foundry
Changes to fields that can be overridden by optional parameters, for example num_servers or
new_size_percentage, change the default value of these instance properties, but do not affect existing
service instances.
If you change the allowed limits of an optional parameter, for example the maximum number of servers per
cluster, existing service instances in violation of the new limits are not modified.
When existing instances are upgraded, all plan changes are applied to them. Upgrades and updates to
service instances can cause a rolling restart of cluster servers. Be aware that the rebalancing of data to
maintain redundancy may impact the performance of the remainder of the servers within the service
instance.
Data loss may result from the restart of a cluster. See Restarting a Cluster for the
conditions under which data loss occurs.
Uninstalling
This topic explains how to uninstall VMware Tanzu GemFire on Cloud Foundry.
To uninstall Tanzu GemFire on Cloud Foundry, follow the steps from below from the Installation
Dashboard:
1. Click the trash can icon in the bottom-right-hand corner of the tile.
2. Click Review Pending Changes. For more information, see Reviewing Your Pending Product
Changes in Tanzu Operations Manager in the VMware Tanzu Operations Manager documentation.
Both disaster recovery and system validation depend upon backups. A Tanzu GemFire on Cloud Foundry
service instance backup consists of the configuration for a Tanzu GemFire on Cloud Foundry service
instance together with all region data that has been persisted to disk. A Tanzu GemFire on Cloud Foundry
service instance backup may be used to restore the service on a new, but unconfigured Tanzu GemFire on
Cloud Foundry service instance.
Consider each of these important items when preparing to back up and restore a Tanzu
GemFire on Cloud Foundry service instance. Since recovery depends on a correct
implementation, address each item during planning.
The backup consists of data from regions that have been persisted to disk. All non-persistent
region data will be lost. A persistent region is one that writes its region entries to disk.
The backup and restoration process does not restore WAN replication configuration. A Tanzu
GemFire on Cloud Foundry service instance that replicates data via WAN may be backed up. A
65
Tanzu GemFire on Cloud Foundry
restore of that Tanzu GemFire on Cloud Foundry service instance will contain all the persistent
data. That Tanzu GemFire on Cloud Foundry service instance will be able to communicate with
other WAN-connected service instances after further configuration.
The disk size on the jumpbox VM must be large enough to hold the backup artifacts. The quantity
of disk space needs to exceed the sum total of all disk space used within the Tanzu GemFire on
Cloud Foundry service instance to be backed up. An approximation of that quantity of disk space
may be calculated by looking at the fully populated Tanzu GemFire on Cloud Foundry service
instance. Sum the disk space (in /var/vcap/store) used by each locator and server.
The Tanzu GemFire on Cloud Foundry service instance needs to be quiescent when the backup is
taken. An active cluster could have disk writes in progress, leading to a backup for which region
data may or may not have been written to disk.
The fresh Tanzu GemFire on Cloud Foundry service instance that is to be used for a restore must
have same quantity of locators and servers as the Tanzu GemFire on Cloud Foundry service
instance had when its backup was taken. The fresh Tanzu GemFire on Cloud Foundry service
instance must have sufficient resources to hold the data that is in the backup.
Do not configure the fresh Tanzu GemFire on Cloud Foundry service instance that is to be used for
a restore after creation. It must be empty. Do not create any regions or start any gateway senders.
The restore will create all regions, both persistent and not persistent. The non-persistent regions will
be empty.
Service keys are not part of the backup. New service keys must be created on a restored service
instance.
2. Optional: Compact the disk stores of the cluster to be backed up. Use the gfsh compact disk-
store command after connecting to the cluster with a role that is authorized with the
CLUSTER:MANAGE operation permission. See the gfsh compact disk-store command in the VMware
GemFire documentaion.
3. Optional: Acquire a region statistic that may be used for a minimal validation upon using this
backup for subsequent restoration. Use the gfsh describe region command on each persistent
region, after connecting to the cluster with a role that is authorized with the CLUSTER:READ operation
permission.
For each persistent region (the data-policy will contain the string PERSISTENT), record the size of
region. This size is the quantity of entries in the region. Assuming that activity on the region is
quiescent, when this backup is used in a restoration, the quantity of region entries in the restored
region forms a minimal validation of the region.
66
Tanzu GemFire on Cloud Foundry
4. SSH to the jumpbox. Assuming that the Ops Manager VM is being used as the jumpbox, follow
directions in Log in to the Tanzu Operations Manager VM with SSH in Advanced Tanzu Operations
Manager Troubleshooting with BOSH CLI in the VMware Tanzu Operations Manager
documentation.
5. Determine all needed credentials and parameters for the command that makes the backup:
6. Make the backup. From the jumpbox, issue this command, substituting values acquired in the
previous step:
BOSH_CLIENT_SECRET=BOSH-CLIENT-PASSWORD \
bbr deployment \
--target BOSH-DIRECTOR-IP \
--username BOSH-CLIENT \
--ca-cert PATH-TO-BOSH-SERVER-CERTIFICATE \
--deployment SERVICE-INSTANCE-DEPLOYMENT-NAME \
backup
BOSH_CLIENT_SECRET is an environment variable that is set only for the duration of the command.
The backup will be within a directory on the jumpbox named by the deployment name and a
timestamp.
7. Copy the backup to a permanent home for archiving. VMware recommends compressing and
encrypting the files. Disaster recovery plans often recommend archiving multiple copies of each
backup.
2. Transfer the archived backup to the jumpbox. Expand if compressed, and decrypt if encrypted.
3. Make a new, but empty service instance. See directions in Creating a Tanzu GemFire on Cloud
Foundry Service Instance. If the service instance to be restored was connected to a WAN, be sure
to create the new instance with the same distributed_system_id as the old one.
67
Tanzu GemFire on Cloud Foundry
4. Determine all needed credentials and parameters for the command that does the restore by
following step 5 instructions from making the backup.
5. Do the restore. From the jumpbox, issue this command, substituting values acquired in the
previous step:
$ BOSH_CLIENT_SECRET=BOSH-CLIENT-PASSWORD \
bbr deployment \
--target BOSH-DIRECTOR-IP \
--username BOSH-CLIENT \
--ca-cert PATH-TO-BOSH-SERVER-CERTIFICATE \
--deployment SERVICE-INSTANCE-DEPLOYMENT-NAME \
restore --artifact-path PATH-TO-SERVICE-INSTANCE-ARTIFACT
PATH-TO-SERVICE-INSTANCE-ARTIFACT is the path to the artifact for the instance that you are
currently restoring.
6. Create a new service key, as the service key was not an artifact that the backup created. For a
stand-alone service instance (one that is not part of a WAN), follow the directions at Create a
Service Key. For a WAN-connected service instance, see Restoring a WAN Connection.
7. If the region size was captured prior to making the backup, in order to do a minimal validation of the
restored cluster, use the gfsh describe region command on each persistent region, after
connecting to the cluster with a role that is authorized with the CLUSTER:READ operation permission.
For each persistent region, the size of the restored region should be the same as the value
captured when the backup was made.
A service gateway enables communication from an app to the Tanzu GemFire on Cloud Foundry service
instance. The running App’s Location determines whether a service gateway is required.
With a VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry) version 2.10
deployment, follow the directions in [https://techdocs.broadcom.com/us/en/vmware-
tanzu/platform/tanzu-platform-for-cloud-foundry/6-0/tpcf/enabling-tcp-routing.html) in the Tanzu
Platform for Cloud Foundry documentation. Note the range entered for the TCP routing ports. One
port from this range will be required to configure the Tanzu GemFire on Cloud Foundry tile.
Configure the Tanzu GemFire on Cloud Foundry tile to enable the service gateway as described in
Settings: Enable Creation of a Service Gateway in Installing and Configuring VMware Tanzu
GemFire.
68
Tanzu GemFire on Cloud Foundry
This topic explains how to enable VMware Tanzu GemFire on Cloud Foundry service instance sharing.
The Tanzu GemFire on Cloud Foundry implementation of instance sharing permits read-only access to a
Tanzu GemFire on Cloud Foundry service instance within one space by an app within another space. A
Cloud Foundry admin operator, or one with administrative privileges, may enable service-instance sharing
for Tanzu GemFire on Cloud Foundry service instances.
$ cf enable-feature-flag service_instance_sharing
You must configure Tanzu GemFire on Cloud Foundry service-instance sharing as detailed in Service-
Instance Sharing.
Rotating Certificates
This topic specifies the procedure to follow to check expiration dates and rotate certificates when using
VMware Tanzu GemFire on Cloud Foundry.
To rotate the Services TLS CA and its leaf certificates, for service instances that are not connected by
WAN gateways, use one of the following procedures:
If you are running Ops Manager 2.10, follow the procedure in Rotate the Services TLS CA and Its
Leaf Certificates in Advanced Certificate Rotation with CredHub Maestro in the VMware Tanzu Ops
Manager 2.10 documentation.
For apps that connect to the Tanzu GemFire cluster using TLS, at each step in the
procedure that rebinds and restages apps, recreate the truststore following the
directions in Create a Truststore) in Accessing a Service Instanceprior to
rebinding. Spring Boot for GemFire apps that set Tanzu GemFire properties ssl-
use-default-context=true and ssl-endpoint-identification-
enabled=false do not need to recreate a truststore.
If you are running Ops Manager 2.9, follow the procedure in Rotate the Services TLS CA and Its
Leaf Certificates in Advanced Certificate Rotation with CredHub Maestro in the VMware Tanzu Ops
Manager 2.9 documentation.
For apps that connect to the Tanzu GemFire cluster using TLS, at each step in the
procedure that rebinds and restages apps, recreate the truststore following the
directions in Create a Truststore) in Accessing a Service Instanceprior to
rebinding. Spring Boot for GemFire apps that set Tanzu GemFire properties ssl-
use-default-context=true and ssl-endpoint-identification-
enabled=false do not need to recreate a truststore.
69
Tanzu GemFire on Cloud Foundry
The procedure assumes two foundations have service instances, one called foundation A and the other
called foundation B. The procedure may be followed by installations that have more than two foundations.
To expand the procedure to cover more foundations, in each place where foundation A and foundation B are
identified, also apply the directions for a third foundation C, a fourth foundation D, and so on.
The procedure is broken into parts. Do the parts in the order listed. The parts are:
1. Check if CredHub has a new temporary certificate from a previous rotation attempt. Run:
If you get your certificates from your CA: If you generate certificates from your own
private or public CA, obtain a new certificate from that CA. You add this to the Ops
Manager settings in the next high-level step.
If you use self-signed certificates: Generate a new self-signed certificate with a new
name or path in CredHub:
credhub generate \
--name="/services/new_ca" \
--type="certificate" \
--no-overwrite \
--is-ca \
--duration=1825 \
--common-name="opsmgr-services-tls-ca"
70
Tanzu GemFire on Cloud Foundry
Where: - name is the CredHub path or name of the new certificate. You can use
/services/new_ca or substitute a different name as long as you use the value
consistently in the rest of the procedure. - common-name is the common name of the
generated certificate. You can use opsmgr-services-tls-ca or substitute a different
common name as long as you use the value consistently in the rest of the procedure. -
duration is set to 1825, which is a recommended value of five years. If you do not specify
a duration, the default value is 365 (one year).
credhub generate \
--name="/services/new_ca" \
--type="certificate" \
--no-overwrite \
--is-ca \
--duration=1825 \
--common-name="opsmgr-services-tls-ca" \
--ca=/PATH-TO-ROOT-CA
Where: - name is the CredHub path or name of the new certificate. You can use
/services/new_ca or substitute a different name as long as you use the value
consistently in the rest of the procedure. - common-name is the common name of the
generated certificate. You can use opsmgr-services-tls-ca or substitute a different
common name as long as you use the value consistently in the rest of the procedure. -
duration is set to 1825, which is a recommended value of five years. If you do not specify
a duration, the default value is 365 (one year). - ca is the path to the root CA for the new
certificate. Replace PATH-TO-ROOT-CA with the appropriate path for the root CA.
2. On foundation A, get the current Services TLS CA certificate by capturing the certificate in the
output of:
3. On foundation A, get the new Services TLS CA certificate either from a pre-existing file, or from
your new CredHub location by capturing the certificate in the output of:
5. On foundation B, get the current Services TLS CA certificate by capturing the certificate in the
output of:
71
Tanzu GemFire on Cloud Foundry
6. On foundation B, get the new Services TLS CA certificate either from a pre-existing file, or from
your new CredHub location by capturing the certificate in the output of:
On foundation A, paste all certificates (ordering of the certificates does not matter) into the BOSH
Director > Security > Trusted Certificates field. Click Save.
On foundation A, paste all certificates (ordering of the certificates does not matter) into two fields of
the Tanzu Platform for Cloud Foundry tile: Networking > Certificate Authorities trusted by the
Gorouter and Networking > Certificate Authorities trusted by the HAProxy. Click Save.
On foundation A, paste all certificates (ordering of the certificates does not matter) into two fields of
the Isolation Segment tile, if the environment has this optional tile: Networking > Certificate
Authorities trusted by the Gorouter and Networking > Certificate Authorities trusted by the
HAProxy. Click Save.
On foundation B, paste all certificates (ordering of the certificates does not matter) into the BOSH
Director > Security > Trusted Certificates field. Click Save.
On foundation B, paste all certificates (ordering of the certificates does not matter) into two fields of
the Tanzu Platform for Cloud Foundry tile: Networking > Certificate Authorities trusted by the
Gorouter and Networking > Certificate Authorities trusted by the HAProxy. Click Save.
On foundation B, paste all certificates (ordering of the certificates does not matter) into two fields of
the Isolation Segment tile, if the environment has this optional tile: Networking > Certificate
Authorities trusted by the Gorouter and Networking > Certificate Authorities trusted by the
HAProxy. Click Save.
This procedure involves redeploying all of the VMs in your Tanzu Operations Manager
deployment to apply a CA certificate. The operation can take a long time to complete.
You may apply the changes to both foundation A and foundation B at the same time.
Follow these steps twice, once to apply the changes to foundation A, and once to apply the changes to
foundation B.
72
Tanzu GemFire on Cloud Foundry
3. Ensure that all product tiles, including VMware Tanzu Platform for Cloud Foundry, Tanzu Platform
for Cloud Foundry [Windows], Isolation Segment, and partner tiles, are selected.
4. Identify which on-demand service tiles are using the Services TLS CA certificate. Run:
From the returned list, identify which on-demand service tiles use TLS in your deployment, such as
MySQL for VMware Tanzu, Tanzu GemFire on Cloud Foundry, Redis for VMware Tanzu, and
RabbitMQ for VMware Tanzu [VMs].
Note: The name of the upgrade all service instances errand may differ
slightly between services.
If you have an existing certificate: Obtain the CA certificate and private key file corresponding to
the certificate that you got in the Get New TLS CA Certificates part of the procedure. Then, run:
credhub set \
--name="/services/tls_ca" \
--type="certificate" \
--certificate=PEM-PATH/root.pem \
--private=CERT-KEY
Where: - certificate is the location of the root.pem file for the certificate. Replace PEM-PATH with
the path of your certificate’s root.pem file. - private is the private key for the new certificate.
Replace CERT-KEY with the value of the private key for your certificate.
If you created a new self-signed or intermediary certificate: Set the /services/new_ca that you
generated in the Get New TLS CA Certificates part of the procedure as the Services TLS CA:
73
Tanzu GemFire on Cloud Foundry
This procedure involves redeploying all of the VMs in your Tanzu Operations Manager
deployment to apply a CA certificate. The operation can take a long time to complete.
You may apply the changes to both foundation A and foundation B at the same time.
In this step, you apply changes to ensure that all on-demand service instances generate new leaf
certificates from the new Services TLS CA.
Follow these steps twice, once to apply the changes to foundation A, and once to apply the changes to
foundation B.
3. Ensure that all product tiles, including VMware Tanzu Platform for Cloud Foundry, Tanzu Platform
for Cloud Foundry [Windows], Isolation Segment, and partner tiles, are deselected in order to
reduce deployment time.
4. Select only the on-demand services tiles that use TLS, such as MySQL for VMware Tanzu, Tanzu
GemFire on Cloud Foundry, Redis for VMware Tanzu, and RabbitMQ for VMware Tanzu [VMs].
Note: The name of the upgrade all service instances errand may differ
slightly between services.
Follow these steps twice, once for foundation A, and once for foundation B.
1. Delete the two old CA certificates from the BOSH Director tile Security > Trusted Certificates
field. You will remove one old CA certificate for foundation A and one old certificate for foundation B.
Click Save.
2. Delete the two old CA certificates from the two fields of the VMware Tanzu Platform for Cloud
Foundry tile: Networking > Certificate Authorities trusted by the Gorouter and Networking >
Certificate Authorities trusted by the HAProxy. You will remove one old CA certificate for
foundation A and one old certificate for foundation B. Click Save.
3. Delete the two old CA certificates from the two fields of the Isolation Segment tile, if the
environment has this optional tile: Networking > Certificate Authorities trusted by the Gorouter
74
Tanzu GemFire on Cloud Foundry
and Networking > Certificate Authorities trusted by the HAProxy. You will remove one old CA
certificate for foundation A and one old certificate for foundation B. Click Save.
For some deployments, you may encounter an error if you create a service instance in a deployment that
contains an expired Services TLS CA certificate. For more information, see Cloud Controller fails to create
service instance when there is a expired cert installed on the system in the Tanzu Support Knowledge
Base.
This procedure involves redeploying all of the VMs in your Tanzu Operations Manager
deployment to apply a CA certificate. The operation can take a long time to complete.
You may apply the changes to both foundation A and foundation B at the same time.
Follow these steps twice, once to apply the changes to foundation A, and once to apply the changes to
foundation B.
3. Ensure that all product tiles, including VMware Tanzu Platform for Cloud Foundry, Tanzu Platform
for Cloud Foundry [Windows], Isolation Segment, and partner tiles, are selected.
4. Select only the on-demand services tiles that use TLS, such as MySQL for VMware Tanzu, Tanzu
GemFire on Cloud Foundry, Redis for VMware Tanzu, and RabbitMQ for VMware Tanzu [VMs].
Note: The name of the upgrade all service instances errand may differ
slightly between services.
This sequence of steps restores a bidirectional WAN connection to a service instance when the service
instance has been restored from backup.
In this description, cluster A is an existing, running service instance that was formerly connected to cluster
B over a WAN connection, and cluster B is the service that has been freshly restored from backup, and
75
Tanzu GemFire on Cloud Foundry
needs to be reconnected.
At this point in the process, cluster B should have the following characteristics:
If the restored distributed_system_id matches that in the backup, then there is no need to recreate
gateway senders and receivers; they are already defined. This procedure manually updates gateway
senders with pointers to remote locators and credentials, re-enabling their ability to connect across the
WAN without authentication errors.
1. Obtain the service key for cluster A. The service key contains generated credentials, in a JSON
element called remote_cluster_info, that enable other clusters (Cluster B in this example) to
communicate with Cluster A:
$ cf service-key A k1
The contents of the service key differ based upon the cluster configuration, such as whether an
external authentication such as LDAP via User Account and Authentication (UAA) has been
configured. Here is sample output from cf service-key A k1:
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"urls": {
76
Tanzu GemFire on Cloud Foundry
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {}
}
$ cf service-key B k2
As above, the service key contains generated credentials, in a JSON element called
remote_cluster_info, that enable other clusters (Cluster A in this example) to communicate with
Cluster B. Here is sample output from cf service-key B k2:
{
"distributed_system_id": "2",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
77
Tanzu GemFire on Cloud Foundry
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
},
"urls": {
"gfsh": "https://cloudcache-2.example.com/gemfire/v1",
"pulse": "https://cloudcache-2.example.com/pulse"
},
"users": [
{
"password": "cl-op-JKL-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_JKL"
},
{
"password": "dev-MNO-password",
"roles": [
"developer"
],
"username": "developer_MNO"
}
],
"wan": {}
}
3. Update the Cluster A service instance, using the -c option to specify a remote_clusters element
that includes the contents of the Cluster B service key remote_cluster_info element, including
the recursors array, remote_locators array, and trusted_sender_credentials. This allows
Cluster A to communicate with Cluster B, and to accept data from Cluster B:
$ cf update-service A -c '
{
"remote_clusters":[
{
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
}
}
]
78
Tanzu GemFire on Cloud Foundry
}'
Updating service instance A as admin
4. To verify that a service instance has been correctly updated, delete and recreate the cluster service
key. The recreated service key will have the same user identifiers and passwords as its
predecessor, and will reflect the changes you specified in the recent cf update-service
commands. In particular, the wan{} element at the end of a cluster’s service key should be
populated with the other cluster’s remote connection information. For example, to verify that the
Cluster A service key was updated correctly, log in as Cluster A administrator and issue these
commands to delete and recreate the Cluster A service key:
$ cf delete-service-key A k1
...
$ cf create-service-key A k1
Verify that the wan{} field of the Cluster A service key contains a remote_clusters element which
specifies contact information for Cluster B, including Cluster B’s recursors array,
remote_locators array, and trusted_sender_credentials:
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
79
Tanzu GemFire on Cloud Foundry
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {
"remote_clusters": [
{
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
}
]
}
}
5. Update the Cluster B service instance, using the -c option to specify a remote_clusters element
that includes the contents of the Cluster A service key remote_cluster_info element, including
the recursors array, remote_locators array, and trusted_sender_credentials. This allows
Cluster B to communicate with Cluster A, and to accept data from Cluster A:
$ cf update-service B -c '
{
"remote_clusters":[
{
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.5:1053",
"10.0.8.7:1053",
"10.0.8.6:1053"
]
}
"remote_locators":[
80
Tanzu GemFire on Cloud Foundry
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
"trusted_sender_credentials":[
{
"username": "gateway_sender_GHI",
"password":"gws-GHI-password"
}]
}]
}'
Updating service instance B as admin
6. To verify that the Cluster B service key was updated correctly, log in as Cluster B administrator and
issue these commands to delete and recreate the Cluster B service key:
$ cf delete-service-key B k2
...
$ cf create-service-key B k2
Verify that the wan{} field of the Cluster B service key contains a remote_clusters element which
specifies contact information for Cluster A, including Cluster A’s recursors array,
remote_locators array, and trusted_sender_credentials:
{
"distributed_system_id": "2",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
},
"urls": {
"gfsh": "https://cloudcache-2.example.com/gemfire/v1",
81
Tanzu GemFire on Cloud Foundry
"pulse": "https://cloudcache-2.example.com/pulse"
},
"users": [
{
"password": "cl-op-JKL-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_JKL"
},
{
"password": "dev-MNO-password",
"roles": [
"developer"
],
"username": "developer_MNO"
}
],
"wan": {
"remote_clusters": [
{
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
}
]
}
}
7. To verify that the connection has been successfully restored, see Verify Bidirectional WAN Setup.
82
Tanzu GemFire on Cloud Foundry
This document describes how to choose a service plan, create and delete VMware Tanzu GemFire on
Cloud Foundry service instances, and bind an app.
You must install the Cloud Foundry Command Line Interface (cf CLI) to run the commands in this topic. For
more information, see Installing the cf CL in the VMware Tanzu Platform for Cloud Foundry product
documentation.
In this topic:
Restarting a Cluster
Disk Metrics
83
Tanzu GemFire on Cloud Foundry
Implement an Asynchronous Event Queue and Cache Listener for Write Behind
Using gfsh
gfsh Command Restrictions
Create Regions
Connecting a Spring Boot App to Tanzu GemFire on Cloud Foundry with Session State Caching
Use the Tomcat App
Application Development
Design Patterns
Region Design
Handling Events
Example Applications
84
Tanzu GemFire on Cloud Foundry
Running an App
Troubleshooting
Run cf marketplace to view the installed Tanzu GemFire on Cloud Foundry tile version and its associated
Tanzu GemFire version. In this example, only a single plan is available:
% cf marketplace
Getting services from marketplace in org system / space system
as admin...
Run cf marketplace -e p-cloudcache to view all plans available for Tanzu GemFire on Cloud Foundry.
The plan names displayed are configured by the operator during tile installation. In this example, a subset of
the available plans are enabled.
% cf marketplace -e p-cloudcache
Getting service plan information for service p-cloudcache
as admin...
85
Tanzu GemFire on Cloud Foundry
NAME with a name of your choice. Use this name to refer to your service instance with other commands.
Service instance names can include alpha-numeric characters, hyphens, and underscores.
Service instances are created asynchronously. Run the cf services command to view the current status
of the service creation, and of other service instances in the current org and space:
$ cf services
Getting services in org my-org / space my-space as user...
OK
When completed, the status changes from create in progress to create succeeded.
The Tanzu GemFire on Cloud Foundry service broker supports the following parameters:
tls: A boolean, that when true, enables TLS for all communication within the cluster.
service_gateway: A boolean, that when true, causes the creation of a service gateway. The
service instance must also use TLS for communication within the cluster.
num_servers: An integer that specifies the number of server instances in the cluster. The minimum
value is 4. The maximum and default values are configured by the operator.
new_size_percentage: An integer that specifies the percentage of the heap to allocate to young
generation. This value must be between 5 and 83. By default, the new size is 2 GB or 10% of heap,
whichever is smaller.
distributed_system_id: An integer that provides a unique identifier for a cluster that participates
in a WAN.
shared_write_access: A boolean, that when true, allows an app within a different space write
access to the service instance when service-instance sharing is enabled.
pr_load_probe_class: A property that specifies the algorithm to be used by the server when
rebalancing data. Supported values are:
org.apache.geode.internal.cache.partitioned.BucketCountLoadProbe
Rebalance based on the total-num-buckets configuration and the number of members
hosting the region.
org.apache.geode.internal.cache.partitioned.SizedBasedLoadProbe
Rebalance based on the actual size of data in each member hosting the region. This is the
default rebalancing algorithm.
86
Tanzu GemFire on Cloud Foundry
advanced_configuration: A property that allows users to configure custom JVM options, Tanzu
GemFire properties, credentials, and Resource Manager properties. This property is not
recommended for general use. It is intended only for advanced users and support staff. See
Advanced Service Instance Configuration for details.
This example creates the service with five service instances in the cluster:
This example assigns the service a specific distributed system ID, which is important when restoring a
WAN participant from backups:
This example creates a cluster that allows write access by an app in a different space when service-
instance sharing is enabled.
Single-VM Plans
The Colocated Single-VM Plan is a type of service plan that is useful for development and testing. This
example creates a Colocated Single-VM Plan service instance:
The plan provides a single locator and a single server colocated within a single VM. Because the VM is
recycled when the service instance is updated or upgraded, all data within the region is lost upon update or
upgrade.
When post-deploy scripts are enabled for Ops Manager, the service instance is created with a single
sample region called example_partition_region. The region is of type PARTITION_REDUNDANT_HEAP_LRU,
as described in Partitioned Region Types for Creating Regions on the Server.
If example_partition_region has not been created, it is probably because post-deploy scripts are not
enabled for Ops Manager, as described in Configure a Co-located Single VM Plan.
87
Tanzu GemFire on Cloud Foundry
2. Run cf unbind-service APP-NAME SERVICE-INSTANCE-NAME to unbind your app from the service
instance.
Deletions are asynchronous. Run cf services to view the current status of the service instance deletion.
If individual service instance upgrades are permitted by the operator, and a newer tile has been made
available, then developers may upgrade their own service instances by following the procedure here. Enable
Individual Service Instance Upgrades describes how an operator enables developer upgrades of their own
service instances.
The cf CLI, v6.46.0 or a more recent version, is a prerequisite for upgrading a Tanzu GemFire on Cloud
Foundry service instance.
1. Confirm that an upgrade is available for the service instance; the upgrade is available when the
upgrade available column of the output says yes, as in the sample output:
$ cf services
Getting services in org system / space system as admin...
Replace SERVICE-INSTANCE-NAME with the name of the instance to be upgraded. Confirm that you want to
update when prompted.
You can apply all optional parameters to an existing service instance using the cf update-service
command. You can, for example, scale up a cluster by increasing the number of servers.
Previously specified optional parameters are persisted through subsequent updates. To return the service
instance to default values, you must explicitly specify the defaults as optional parameters.
88
Tanzu GemFire on Cloud Foundry
For example, if you create a service instance with five servers using a plan that has a default value of four
servers:
Then the resulting service instance has 5 servers and new_size_percentage of 50% of heap.
Scaling up a Cluster
You can scale up a cluster using command cf update-service and parameter num_servers. For example,
if you want to scale up a 4 server cluster to 5 servers, you can run:
Note: Although it is possible to scale down a cluster, it is not recommended as this could result in data
loss. If you need to scale down, do so one node at a time.
Rebalancing a Cluster
When updating a cluster to increase the number of servers, the available heap size is increased. When this
happens, Tanzu GemFire on Cloud Foundry automatically rebalances data in the cache to distribute data
across the cluster.
This automatic rebalancing does not occur when a server leaves the cluster and later rejoins, for example
when a VM is re-created, or network connectivity is lost and restored. In this case, you must manually
rebalance the cluster using the gfsh rebalance command while connected to the cluster under a role that
can manage a cluster’s data.
Note: You must first connect with gfsh over HTTPS before you can use the rebalance command. For more
information, see Connect with gfsh over HTTPS in Accessing a Service Instance.
By default, the server rebalances based on the size of data in each member hosting the region. You can
change the algorithm to specify rebalancing based, instead, on bucket count, by specifying the
pr_load_probe_class parameter in the cf create-service command. The rebalancing algorithm is a
data-intensive operation and can affect performance while the change is taking place.
Restarting a Cluster
Restarting a cluster stops and restarts each cluster member in turn, issuing a rebalance as each restarted
server joins the cluster.
There is a potential for data loss when restarting a cluster; the region type and number of servers in the
cluster determine whether or not data is lost.
89
Tanzu GemFire on Cloud Foundry
All data is lost when restarting a cluster with these region types and number of servers:
A Colocated Single-VM Plan cluster loses all data, as there is a single server and no region
persistence.
No data is lost when restarting the cluster with these region types and number of servers:
Persistent regions will not lose data, as all data is on the disk and available upon restart of
a server.
Partitioned regions with redundancy. When the server with the primary copy of an entry is
stopped, the redundant copy still exists on a running server.
To restart a cluster, use the VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry)
operator credentials to run the command:
For example:
where SERVICE-INSTANCE-NAME is the name assigned to the service instance upon creation.
However, if your operator changes the allowed values of one of the optional parameters, existing instances
that exceed the new limits are not affected, but any subsequent service updates that change the optional
parameter must adhere to the new limits.
For example, if the Tanzu Platform for Cloud Foundry operator changes the plan by decreasing the
maximum value for num_servers, any future service updates must adhere to the new num_servers value
limit.
You might see the following error message when attempting to update a service instance:
90
Tanzu GemFire on Cloud Foundry
This error message indicates that the operator has made an update to the plan used by this service
instance. You must wait for the operator to apply plan changes to all service instances before you can
make further service instance updates.
Tanzu GemFire on Cloud Foundry clusters and brokers emit service metrics. You can use any tool that has
a corresponding Cloud Foundry nozzle to read and monitor these metrics in real time, including Tanzu
Observability (formerly known as VMware Aria Operations for Applications).
As an app developer, when you opt to use a data service, you should be prepared to:
If you believe an issue relates to the underlying infrastructure (network, CPU, memory, or disk), you will
need to capture evidence and notify your platform team. The metrics described in this section can help in
characterizing the performance and resource consumption of your service instance.
Tanzu GemFire on Cloud Foundry does not publish locator metrics for service instances created as Co-
located Single VM plans or Co-located Multi VM plans.
Member Count
serviceinstance_MemberCount
91
Tanzu GemFire on Cloud Foundry
Suggested Actions This depends on the expected member count, which is available in the BOSH manifest. If the
number expected is different from the number emitted, this is a critical situation that may lead
to data loss, and the reasons for node failure should be investigated by examining the service
logs.
Why a KPI? Member loss due to any reason can potentially cause data loss.
serviceinstance_TotalHeapSize
Description Returns the total available heap, in megabytes, across all instance members.
Why a KPI? If the total heap size and used heap size are too close, the system might see thrashing due to
GC activity. This increases latency.
serviceinstance_UsedHeapSize
Description Returns the total heap used across all instance members, in megabytes.
Why a KPI? If the total heap size and used heap size are too close, the system might see thrashing due to
GC activity. This increases latency.
serviceinstance_UnusedHeapSizePercentage
Description Returns the proportion of total available heap across all instance members, expressed as a
percentage.
92
Tanzu GemFire on Cloud Foundry
Suggested Actions If this is a spike due to eviction catching up with insert frequency, then customers need to
keep a close watch that it should not hit the RED marker. If there is no eviction, then horizontal
scaling is suggested.
Why a KPI? If the total heap size and used heap size are too close, the system might see thrashing due to
GC activity. This increases latency.
member_UsedMemoryPercentage
member_GarbageCollectionCount
Description The number of times that garbage has been collected over a rolling window of time. The rolling
window is updated and the count is recalculated every second.
Suggested Actions Check the number of queries run against the system, which increases the deserialization of
objects and increases garbage.
Why a KPI? If the frequency of garbage collection is high, the system might see high CPU usage, which
causes delays in the cluster.
93
Tanzu GemFire on Cloud Foundry
member_HostCpuUsage
Suggested Actions If this is not happening with high GC activity, the system is reaching its limits. Horizontal
scaling might help.
Why a KPI? High CPU usage causes delayed responses and can also make the member non-responsive.
This can cause the member to be kicked out of the cluster, potentially leading to data loss.
member_GetsAvgLatency
Suggested Actions If this is not happening with high GC activity, the system is reaching its limit. Horizontal scaling
might help.
Why a KPI? It is a good indicator of the overall responsiveness of the system. If this number is high, the
service administrator should diagnose the root cause.
member_PutsAvgLatency
94
Tanzu GemFire on Cloud Foundry
Suggested Actions If this is not happening with high GC activity, the system is reaching its limit. Horizontal scaling
might help.
Why a KPI? It is a good indicator of the overall responsiveness of the system. If this number is high, the
service administrator should diagnose the root cause.
JVM pauses
member_JVMPauses
Suggested Actions Check the cached object size; if it is greater than 1 MB, you may be hitting the limitation on
JVM to garbage collect this object. Otherwise, you may be hitting the utilization limit on the
cluster, and will need to scale up to add more memory to the cluster.
Why a KPI? Due to a JVM pause, the member stops responding to "are-you-alive" messages, which may
cause this member to be kicked out of the cluster.
member_FileDescriptorLimit
Description The maximum number of open file descriptors allowed for the member's host operating
system.
Why a KPI? If the number of open file descriptors exceeds number available, it causes the member to stop
responding and crash.
95
Tanzu GemFire on Cloud Foundry
member_TotalFileDescriptorOpen
Why a KPI? If the number of open file descriptors exceeds number available, it causes the member to stop
responding and crash.
member_FileDescriptorRemaining
Why a KPI? If the number of open file descriptors exceeds number available, it causes the member to stop
responding and crash.
member_ReplyWaitsInProgress
Warning Threshold 1
Critical Threshold 10
Suggested Actions If the value does not average to zero over the sample interval, then the member is waiting for
responses from other members. There are two possible explanations: either another member
is unhealthy, or the network is dropping packets. Check other members' health, and check for
network issues.
96
Tanzu GemFire on Cloud Foundry
Why a KPI? Unhealthy members are excluded from the cluster, possibly leading to data loss.
gatewaySender_<sender-id>_EventQueueSize
Description A count of the events coming from the region to which the gateway sender is attached. It is the
count since the last time the metric was checked. The first time it is checked, the count is of
the number of events since the gateway sender was created.
Description A count of the events queued on the gateway sender from the region. This quantity of events
might be lower than the quantity of events received, as not all received events are queued. It
is a count since the last time the metric was checked. The first time it is checked, the count is
of the number of events since the gateway sender was created.
Description A count of the events received from the gateway sender which will be applied to the region on
the gateway receiver's site. It is the count since the last time the metric was checked. The
first time it is checked, the count is of the number of events since the gateway receiver was
created.
97
Tanzu GemFire on Cloud Foundry
Disk Metrics
These are metrics emitted through the CF Nozzle for disks.
Description The total number of bytes of available space on the attached disk.
Experimental Metrics
These metrics are experimental. Any of these metrics may be removed without advance notice, and the
current name of any of these metrics may change. Expect changes to these metrics.
region.REGION-NAME.BucketCount
region.REGION-NAME.CreatesRate
region.REGION-NAME.DestroyRate
region.REGION-NAME.EntrySize
region.REGION-NAME.FullPath
region.REGION-NAME.GetsRate
region.REGION-NAME.NumRunningFunctions
region.REGION-NAME.PrimaryBucketCount
region.REGION-NAME.PutAllRate
98
Tanzu GemFire on Cloud Foundry
region.REGION-NAME.PutLocalRate
region.REGION-NAME.PutRemoteRate
region.REGION-NAME.PutsRate
region.REGION-NAME.RegionType
region.REGION-NAME.SystemRegionEntryCount
region.REGION-NAME.TotalBucketSize
region.REGION-NAME.TotalRegionCount
region.REGION-NAME.TotalRegionEntryCount
member.AverageReads
member.AverageWrites
member.BytesReceivedRate
member.BytesSentRate
member.CacheServer
member.ClientConnectionCount
member.CreatesRate
member.CurrentHeapSize
member.DeserializationRate
member.DestroysRate
member.FunctionExecutionRate
member.GetRequestRate
member.GetsRate
member.MaxMemory
member.MemberUpTime
member.NumThreads
member.PDXDeserializationRate
member.PutAllRate
member.PutRequestRate
member.PutsRate
member.TotalBucketCount
member.TotalHitCount
member.TotalMissCount
member.TotalPrimaryBucketCount
99
Tanzu GemFire on Cloud Foundry
Consumption Calculation
mem-check does the following to calculate and output the quantity of memory used across all Tanzu
GemFire service instances:
1. Uses gfsh to list members and find all strings that match locator|cacheserver from the output.
2. For each member, uses gfsh to describe member --name=<member_name> and match on
(Used|Max) Heap.
3. Adds all used and max and print them for the specific deployment.
4. After checking all deployments, outputs the global total used and max for all deployments
mem-check Usage
To use mem-check:
For example:
The following is an anonymized portion of example output from the mem-check errand from a two cluster
deployment:
100
Tanzu GemFire on Cloud Foundry
The service gateway allows apps that run in a different location than the Services Foundation where the
VMware Tanzu GemFire on Cloud Foundry service instance runs to communicate with the service instance.
At its core, the service gateway is a TCP router.
There are three locations where an app may run. The locations are defined in The App’s Location.
Apps that run within an App Foundation and apps that run completely outside of any foundation must have a
service gateway enabled and running to communicate with the Tanzu GemFire on Cloud Foundry service
instance. To enable and run the service instance:
The developer must Provide Optional Parameters when creating the Tanzu GemFire on Cloud
Foundry service instance.
The app must be given and use properties that authenticate and authorize Communicating with a
Service Instance through the service gateway.
Service-Instance Sharing
Service-instance sharing for VMware Tanzu GemFire on Cloud Foundry permits access to a Tanzu GemFire
on Cloud Foundry service instance by an app within a different space. Read-only access of the data by the
app is configured by default.
2. (Optional) To give the app write access to the data, a developer creates the service instance with
service instance sharing enabled as defined in Provide Optional Parameters.
These instructions require identification of the org and the space of both the service instance and the app.
The following diagram names the components for use in the configuration instructions. Service instance X
resides within space C, which is part of org A. App Y resides within space D, which is part of org B.
101
Tanzu GemFire on Cloud Foundry
1. An org A developer does a cf login with a space developer role. Target the space that contains
the service to be shared: org A, space C.
2. The org A developer shares the space with a command of the form
Replace SERVICE-X with the Tanzu GemFire on Cloud Foundry service instance name. Replace
SPACE-D with the space name where the app resides. Replace ORG-B with the org name where the
app resides.
1. An org B developer does a cf login with a space developer role. Target the org and space that
contains the app: org B, space D.
2. Verify that the Tanzu GemFire on Cloud Foundry service instance is available and shared across
the spaces in the output of the command:
$ cf services
102
Tanzu GemFire on Cloud Foundry
3. The org B developer binds the app with a command of the form
Replace SERVICE-X with the Tanzu GemFire on Cloud Foundry service instance name. Replace
APP-Y with the name of the app.
App Authentication
Apps that interact with a shared Tanzu GemFire on Cloud Foundry service instance which resides in a
different space will be given a set of credentials. The app must acquire and use this set of credentials for
authentication. Apps built with Spring Boot Data GemFire version 1.1.1 or a more recent version will
automatically pick up the credentials, so these apps do not need to acquire the credentials.
By default, the role of these credentials is authorized only for read access of region data. If the cluster is
created with the shared_write_access parameter, the cluster operator role will be used, authorizing the
operations for that role, as defined in Security.
The set of credentials are in the VCAP_SERVICES environment variable, with a role of readonly or
cluster_operator_XXX. The app must parse the VCAP_SERVICES environment variable to extract the
credentials. The app uses the credentials to set a property that then gets passed to the
ClientCacheFactory for the purpose of authentication prior to creating the cache.
Two service instances may form a single distributed system across a WAN. The interaction of the two
service instances may follow one of the patterns described in the section on Design Patterns.
Call the two service instances A and B. The cluster within each service instance uses an identifier called a
distributed_system_id. This example assigns distributed_system_id = 1 to cluster A and
distributed_system_id = 2 to cluster B. Cluster gateway senders provide the communication path and
construct that propagates region operations from one cluster to another. On the receiving end are cluster
gateway receivers. Creating a service instance also creates gateway receivers.
The procedures in this section assume that service instances communicate using TLS encryption.
Note: To set up more than two service instances across a WAN, set up the interaction
between the first two service instances A and B following the directions in either Set Up a
Bidirectional System or Set Up a Unidirectional System, as appropriate. After that, set up
the interaction between service instance A and another service instance (called C) following
the directions in either Set Up an Additional Bidirectional Interaction or Set Up an Additional
Unidirectional Interaction, as appropriate.
103
Tanzu GemFire on Cloud Foundry
This topic describes establishing mutually trusted TLS certificates for use with VMware Tanzu GemFire on
Cloud Foundry.
In order for services instances in two foundations to communicate using TLS encryption, the CredHub
“/services/tls_ca” certificate must be trusted in both foundations; otherwise, WAN connections with TLS will
fail.
Assumptions
You have two VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry)
foundations, A and B, with a network connection between them.
You want to establish a TLS-encrypted WAN connection between a service instance on Foundation
A and a service instance on Foundation B.
The Preparing for TLS procedure has been followed for each foundation, establishing a CredHub
“/services/tls_ca” certificate for each.
two CAs, one in each foundation, which is trusted by the other foundation.
If one of these conditions is satisfied, mutually trusted credentials are already in place; there is no need to
implement the following procedure.
If the two foundations have different “/services/tls_ca” certificates that are not already mutually trusted,
follow these steps to establish mutual trust.
Assuming you have two different Tanzu Platform for Cloud Foundry foundations, A and B, connected by a
WAN:
1. Access the CredHub of Foundation A using instructions from Access BOSH CredHub
4. Navigate to the Ops Manager Installation Dashboard of Foundation B and click the BOSH
Director tile.
5. Click Security.
6. Append the contents of the new CA certificate to the old CA certificate under Trusted Certificates.
Do not remove the old CA certificate.
7. Click Save.
104
Tanzu GemFire on Cloud Foundry
8. Distribute the new CA certificate to your Tanzu GemFire on Cloud Foundry VMs and regenerate
each server certificate using the new CA:
Click ERRANDS.
9. Return to the Installation Dashboard in Ops Manager and click Apply Changes.
Assumptions
You have two VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry)
foundations, A and B, with a network connection between them.
You want to establish a TLS-encrypted WAN connection between a service instance on Foundation
A and a service instance on Foundation B.
The connection will be bidirectional, such that operations in each cluster can be replicated in the
other.
The Preparing for TLS procedure has been followed for each foundation, establishing a CredHub
“/services/tls_ca” certificate for each.
The Establishing Mutually Trusted TLS Credentials procedure has been followed, establishing
mutually trusted TLS credentials between Foundations A and B.
Create Clusters
1. Log into Foundation A using Foundation A Cloud Foundry credentials.
2. Use the cf create-service command to create a service instance, which we will call Cluster A in
this example. In the cf create-service command, use the -c option with the argument "tls" :
true to enable TLS. This example also uses the -c option to set the distributed_system_id of
Cluster A to “1”:
Verify the completion of service creation prior to continuing to the next step. Output from the cf
services command will show the last operation as create succeeded when service creation is
105
Tanzu GemFire on Cloud Foundry
completed.
4. Use the cf create-service command to create a service instance, which we will call Cluster B.
In the cf create-service command, use the -c option with the argument "tls" : true to enable
TLS. This example also uses the -c option to set the distributed_system_id of Cluster B to “2”:
Verify the completion of service creation prior to continuing to the next step. Output from the cf
services command will show the last operation as create succeeded when service creation is
completed.
$ cf create-service-key wan1 k1
Creating service key wan1 for service instance k1 ...
OK
The service key contains generated credentials, in a JSON element called remote_cluster_info,
that enable other clusters (Cluster B in this example) to communicate with Cluster A:
$ cf service-key wan1 k1
Getting key k1 for service instance wan1 ...
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
106
Tanzu GemFire on Cloud Foundry
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {}
}
$ cf create-service-key wan2 k2
Creating service key wan2 for service instance k2 ...
OK
As above, the service key contains generated credentials, in a JSON element called
remote_cluster_info, that enable other clusters (Cluster A in this example) to communicate with
Cluster B:
$ cf service-key wan2 k2
Getting key k2 for service instance wan2 ...
{
"distributed_system_id": "2",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
107
Tanzu GemFire on Cloud Foundry
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-2.example.com/gemfire/v1",
"pulse": "https://cloudcache-2.example.com/pulse"
},
"users": [
{
"password": "cl-op-JKL-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_JKL"
},
{
"password": "dev-MNO-password",
"roles": [
"developer"
],
"username": "developer_MNO"
}
],
"wan": {}
}
The recursors array and the remote_locators array enable communication between clusters.
The trusted_sender_credentials element identifies a cluster from which data can be accepted
for replication. For example, when Cluster B has been updated with Cluster A’s
trusted_sender_credentials, then Cluster B can accept and store data sent from Cluster A.
In order to implement a bidirectional WAN connection between two clusters, each must have the
trusted_sender_credentials of the other.
1. While logged in to Foundation A, update the Cluster A service instance, using the -c option to
specify a remote_clusters element that includes the contents of the Cluster B service key
remote_cluster_info element, including the recursors array, remote_locators array, and
108
Tanzu GemFire on Cloud Foundry
Verify the completion of the service update prior to continuing to the next step. Output from the cf
services command will show the last operation as update succeeded when service update is
completed.
2. While logged in to Foundation B, update the Cluster B service instance, using the -c option to
specify a remote_clusters element that includes the contents of the Cluster A service key
remote_cluster_info element, including the recursors array, remote_locators array, and
trusted_sender_credentials. This allows Cluster B to communicate with Cluster A, and to
accept data from Cluster A:
109
Tanzu GemFire on Cloud Foundry
"trusted_sender_credentials": [
{
"username": "gateway_sender_GHI",
"password":"gws-GHI-password"
}
]
}
]
}'
Updating service instance wan2 as admin
Verify the completion of the service update prior to continuing to the next step. Output from the cf
services command will show the last operation as update succeeded when service update is
completed.
3. To verify that a service instance has been correctly updated, delete and recreate the cluster service
key. The recreated service key will have the same user identifiers and passwords as its
predecessor, and will reflect the changes you specified in the recent cf update-service
commands. In particular, the wan{} element at the end of a cluster’s service key should be
populated with the other cluster’s remote connection information. For example, to verify that the
Cluster A service key was updated correctly, log in as Cluster A administrator and issue these
commands to delete and recreate the Cluster A service key:
$ cf delete-service-key wan1 k1
...
$ cf create-service-key wan1 k1
Verify that the wan{} field of the Cluster A service key contains a remote_clusters element which
specifies contact information for Cluster B, including Cluster B’s remote_locators array and
trusted_sender_credentials:
$ cf service-key wan1 k1
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
110
Tanzu GemFire on Cloud Foundry
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_PQR"
]
}
]
}
}
Similarly, to verify that the Cluster B service key was updated correctly, log in as Cluster B
administrator and issue these commands to delete and recreate the Cluster B service key:
$ cf delete-service-key wan2 k2
...
$ cf create-service-key wan2 k2
Verify that the wan{} field of the Cluster B service key contains a remote_clusters element which
specifies contact information for Cluster A, including Cluster A’s remote_locators array, and
trusted_sender_credentials:
111
Tanzu GemFire on Cloud Foundry
$ cf service-key wan2 k2
{
"distributed_system_id": "2",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-2.example.com/gemfire/v1",
"pulse": "https://cloudcache-2.example.com/pulse"
},
"users": [
{
"password": "cl-op-JKL-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_JKL"
},
{
"password": "dev-MNO-password",
"roles": [
"developer"
],
"username": "developer_MNO"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
112
Tanzu GemFire on Cloud Foundry
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_GHI"
]
}
]
}
}
1. While logged in to Foundation A, use gfsh to create the Cluster A gateway sender and the region.
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
Create the Cluster A region. The gateway-sender-id associates region operations with a
specific gateway sender. The region must have an associated gateway sender in order to
propagate region events across the WAN.
2. While logged in to Foundation B, use gfsh to create the Cluster B gateway sender and region.
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
113
Tanzu GemFire on Cloud Foundry
This verification uses gfsh to put a region entry into each of Cluster A and Cluster B, in order to observe
that the entry appears in the other cluster.
1. While logged in to Foundation A, run gfsh and connect following the instructions in Connect with
gfsh over HTTPS with a role that is able to manage both the cluster and the data.
2. Verify that Cluster A has a complete set of gateway senders and gateway receivers:
gfsh>list gateways
Also verify that there are no queued events in the gateway senders.
3. Log in to Foundation B in a separate terminal window, then run gfsh and connect following the
instructions in Connect with gfsh over HTTPS with a role that is able to manage both the cluster
and the data.
4. Verify that Cluster B has a complete set of gateway senders and gateway receivers:
gfsh>list gateways
Also verify that there are no queued events in the gateway senders.
5. From the Cluster A gfsh connection, use gfsh to perform a put operation. This example assumes
that both the key and the value for the entry are strings. The gfsh help put command shows the
put command’s options. Here is an example:
6. Wait approximately 30 seconds, then use the Cluster B gfsh connection to perform a get of the
same key that was put into the region on Cluster A.
7. Repeat steps 5 and 6 to perform a put operation on Cluster B and verify that the entry is sent to
Cluster A.
8. Remove both test entries from both clusters with two gfsh commands, issuing the commands on
one of the clusters. WAN replication will cause the removal of the test entries on the other cluster.
114
Tanzu GemFire on Cloud Foundry
Assumptions
You have two VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry)
foundations, A and B, with a network connection between them.
You want to establish a TLS-encrypted WAN connection between a service instance on Foundation
A and a service instance on Foundation B.
The connection will be unidirectional, such that all operations in Cluster A are replicated in Cluster
B, but Cluster B does not send operations to Cluster A.
The Preparing for TLS procedure has been followed for each foundation, establishing a CredHub
“/services/tls_ca” certificate for each.
The Establishing Mutually Trusted TLS Credentials procedure has been followed, establishing
mutually trusted TLS credentials between Foundations A and B.
Create Clusters
1. Log into Foundation A using Foundation A Cloud Foundry credentials.
2. Use the cf create-service command to create a service instance, which we will call Cluster A in
this example. In the cf create-service command, use the -c option with the argument "tls" :
true to enable TLS. This example also uses the -c option to set the distributed_system_id of
Cluster A to “1”:
Verify the completion of service creation prior to continuing to the next step. Output from the cf
services command will show the last operation as create succeeded when service creation is
completed.
4. Use the cf create-service command to create a service instance, which we will call Cluster B.
In the cf create-service command, use the -c option with the argument "tls" : true to enable
TLS. This example also uses the -c option to set the distributed_system_id of Cluster B to “2”:
115
Tanzu GemFire on Cloud Foundry
Verify the completion of service creation prior to continuing to the next step. Output from the cf
services command will show the last operation as create succeeded when service creation is
completed.
$ cf create-service-key wan1 k1
Creating service key wan1 for service instance k1 ...
OK
The service key contains generated credentials, in a JSON element called remote_cluster_info,
that enable other clusters (Cluster B in this example) to communicate with Cluster A:
$ cf service-key wan1 k1
Getting key k1 for service instance wan1 as admin...
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
116
Tanzu GemFire on Cloud Foundry
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {}
}
$ cf create-service-key wan2 k2
Creating service key wan2 for service instance k2 ...
OK
As above, the service key contains generated credentials, in a JSON element called
remote_cluster_info, that enable other clusters (Cluster A in this example) to communicate with
Cluster B:
$ cf service-key wan2 k2
Getting key k2 for service instance destination as admin...
{
"distributed_system_id": "2",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
117
Tanzu GemFire on Cloud Foundry
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-2.example.com/gemfire/v1",
"pulse": "https://cloudcache-2.example.com/pulse"
},
"users": [
{
"password": "cl-op-JKL-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_JKL"
},
{
"password": "dev-MNO-password",
"roles": [
"developer"
],
"username": "developer_MNO"
}
],
"wan": {}
}
The recursors array and the remote_locators array enable communication between clusters.
The trusted_sender_credentials element identifies a cluster from which data can be accepted
for replication. For example, when Cluster B has been updated with Cluster A’s
trusted_sender_credentials, then Cluster B can accept and store data sent from Cluster A.
In order to implement a unidirectional WAN connection in which Cluster A sends data to Cluster B:
Each cluster must be updated with the recursors array and the remote_locators array of the
other.
Follow these steps to configure a unidirectional connection in which Cluster A is the active member, and
Cluster B accepts data for replication, but does not send operations to Cluster A:
118
Tanzu GemFire on Cloud Foundry
1. While logged into Foundation A, update the Cluster A service instance, using the -c option to
specify a remote_clusters element that includes the contents of the Cluster B service key
remote_cluster_info element, including Cluster B’s recursors array and the remote_locators
array, but NOT Cluster B’s trusted_sender_credentials. This allows Cluster A to send
messages to Cluster B, but blocks data flow from Cluster B to Cluster A.
Verify the completion of the service update prior to continuing to the next step. Output from the cf
services command will show the last operation as update succeeded when service update is
completed.
2. While logged in to Foundation B, update the Cluster B service instance, using the -c option to
specify a remote_clusters element that includes the contents of the Cluster A service key
remote_cluster_info element, including the recursors array, remote_locators array, and
trusted_sender_credentials. This allows Cluster B to communicate with Cluster A, and to
accept data from Cluster A:
119
Tanzu GemFire on Cloud Foundry
"username": "gateway_sender_GHI",
"password":"gws-GHI-password"
}
]
}
]
}'
Updating service instance wan2 as admin
Verify the completion of the service update prior to continuing to the next step. Output from the cf
services command will show the last operation as update succeeded when service update is
completed.
3. To verify that each service instance has been correctly updated, delete and recreate the cluster
service key. The recreated service key will have the same user identifiers and passwords as its
predecessor, and will reflect the changes you specified in the recent cf update-service
commands. In particular the wan{} elements at the end of each cluster’s service key should be
populated with the other cluster’s remote connection information. For example, to verify that the
Cluster A service key was updated correctly, log in as Cluster A administrator and issue these
commands to delete and recreate the Cluster A service key:
$ cf delete-service-key wan1 k1
...
$ cf create-service-key wan1 k1
Verify that the wan{} field of the Cluster A service key contains a remote_clusters element which
specifies contact information for Cluster B, including Cluster B’s remote_locators array, but NOT
Cluster B’s trusted_sender_credentials:
$ cf service-key wan1 k1
Getting key k1 for service instance wan1 ...
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
120
Tanzu GemFire on Cloud Foundry
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
]
}
]
}
}
Similarly, to verify that the Cluster B service key was updated correctly, log in as Cluster B
administrator and issue these commands to delete and recreate the Cluster B service key:
$ cf delete-service-key wan2 k2
...
$ cf create-service-key wan2 k2
Verify that the wan{} field of the Cluster B service key contains a remote_clusters element which
specifies contact information for Cluster A, including Cluster A’s remote_locators array and
trusted_sender_credentials:
$ cf service-key wan2 k2
Getting key k2 for service instance wan2 ...
{
"distributed_system_id": "2",
121
Tanzu GemFire on Cloud Foundry
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-2.example.com/gemfire/v1",
"pulse": "https://cloudcache-2.example.com/pulse"
},
"users": [
{
"password": "cl-op-JKL-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_JKL"
},
{
"password": "dev-MNO-password",
"roles": [
"developer"
],
"username": "developer_MNO"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_GHI"
122
Tanzu GemFire on Cloud Foundry
]
}
]
}
}
1. While logged in to Foundation A, use gfsh to create the Cluster A gateway sender and the region.
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the Cluster and the data.
Create the Cluster A region. The gateway-sender-id associates region operations with a
specific gateway sender. The region must have an associated gateway sender in order to
propagate region events across the WAN.
2. While logged in to Foundation B, use gfsh to create the Cluster B region. (Because Cluster B is the
passive member in this unidirectional connection, it does not need a gateway sender.)
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
1. While logged in to Foundation A, run gfsh and connect following the instructions in Connect with
gfsh over HTTPS with a role that is able to manage both the cluster and the data.
2. Verify that Cluster A has a complete set of gateway senders and gateway receivers:
gfsh>list gateways
123
Tanzu GemFire on Cloud Foundry
Also verify that there are no queued events in the gateway senders.
3. Log in to Foundation B in a separate terminal window, then run gfsh and connect following the
instructions in Connect with gfsh over HTTPS with a role that is able to manage both the cluster
and the data.
4. Verify that Cluster B has a complete set of gateway receivers (Cluster B should have no gateway
senders):
gfsh>list gateways
5. From the Cluster A gfsh connection, use gfsh to perform a put operation. This example assumes
that both the key and the value for the entry are strings. The gfsh help put command shows the
put command’s options. Here is an example:
6. Wait approximately 30 seconds, then use the Cluster B gfsh connection to perform a get of the
same key that was put into the region on Cluster A.
7. From the Cluster A gfsh connection, remove the test entry from Cluster A. WAN replication will
cause the removal of the test entry from Cluster B.
Call the first pair of Tanzu GemFire on Cloud Foundry service instances Cluster A and Cluster B, which
reside on Foundation A and Foundation B, respectively. This set of directions sets up an interaction
between Cluster A and and a third service instance, Cluster C, which resides on third foundation, Foundation
C.
124
Tanzu GemFire on Cloud Foundry
Assumptions
You have already established a TLS-encrypted WAN connection between a service instance on
Foundation A, referred to here as Cluster A, and a service instance on Foundation B, which we’ll
call Cluster B, following the Set Up a Bidirectional System procedure.
You want to add an additional TLS-encrypted WAN connection between Cluster A and a third
service instance on Foundation C, which we will call Cluster C.
The connection will be bidirectional, such that an operation on either cluster can be replicated in the
other.
The Preparing for TLS procedure has been followed for Foundation C, establishing a CredHub
“/services/tls_ca” certificate.
The Establishing Mutually Trusted TLS Credentials procedure has been followed, establishing
mutually trusted TLS credentials between Foundations A and C.
2. View the Cluster A service key and save a copy of the remote_cluster_info element, which
includes the remote_locators array and trusted_sender_credentials. These are the
credentials that enable other clusters to communicate with Cluster A.
$ cf service-key wan1 k1
Getting key k1 for service instance wan1 as admin...
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
125
Tanzu GemFire on Cloud Foundry
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_PQR"
]
}
]
}
}
2. Use the cf create-service command to create a service instance, which we will call Cluster C in
this example. In the cf create-service command, use the -c option to specify the following
arguments:
126
Tanzu GemFire on Cloud Foundry
The following command specifies the Cluster A credentials you copied in an earlier step, enabling
Cluster C to communicate with and receive data from Cluster A:
Verify the completion of service creation prior to continuing to the next step. Output from the cf
services command will show the last operation as create succeeded when service creation is
completed.
$ cf create-service-key wan3 k3
Creating service key wan3 for service instance k3 ...
OK
Display the service key and save a copy of the remote_cluster_info element, which includes the
recursors array, remote_locators array, and trusted_sender_credentials. These are the
credentials that enable other clusters to communicate with Cluster C.
$ cf service-key wan3 k3
{
"distributed_system_id": "3",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
127
Tanzu GemFire on Cloud Foundry
"id1.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id2.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id3.locator.services-subnet-3.service-instance-id-3.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-3.service-instance-id-3.bosh": [
"10.2.32.7:1053",
"10.2.32.6:1053",
"10.2.32.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id2.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id3.locator.services-subnet-3.service-instance-id-3.bosh[55221]"
],
"trusted_sender_credentials": [
{
"username": "gateway_sender_XYZ",
"password": "gws-XYZ-password"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-3.example.com/gemfire/v1",
"pulse": "https://cloudcache-3.example.com/pulse"
},
"users": [
{
"password": "cl-op-STU-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_STU"
},
{
"password": "dev-VWX-password",
"roles": [
"developer"
],
"username": "developer_VWX"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_GHI"
]
}
]
128
Tanzu GemFire on Cloud Foundry
}
}
4. While logged in to Foundation A, update the Cluster A service instance to add the Cluster C
credentials, using the -c option to specify a remote_clusters element that includes the contents
of the Cluster C service key remote_cluster_info element, including the recursors array,
remote_locators array, and trusted_sender_credentials. This allows Cluster A to
communicate with Cluster C, and to accept data from Cluster C.
IMPORTANT: You must also retain the credentials for all clusters with which Cluster A interacts, in
this example those of Cluster B. The existing credentials can be copied from the
remote_cluster_info entry in Cluster B’s service key, before updating the Cluster A service
instance to append credentials for the additional cluster.
The following example adds Cluster C’s credentials to Cluster A’s remote_clusters element:
129
Tanzu GemFire on Cloud Foundry
}
]
}
]
}'
Updating service instance wan1 as admin
Verify the completion of the service update prior to continuing to the next step. Output from the cf
services command will show the last operation as update succeeded when service update is
completed.
5. To verify that a service instance has been correctly updated, delete and recreate the cluster service
key. The recreated service key will have the same user identifiers and passwords as its
predecessor, and will reflect the changes you specified in the recent cf update-service
commands. In particular, the wan{} element at the end of a cluster’s service key should be
populated with the other cluster’s remote connection information. For example, to verify that the
Cluster A service key was updated correctly, log in as Cluster A administrator and issue these
commands to delete and recreate the Cluster A service key:
$ cf delete-service-key wan1 k1
...
$ cf create-service-key wan1 k1
Verify that the wan{} field of the Cluster A service key contains a remote_clusters element which
specifies contact information for Cluster B, including Cluster B’s remote_locators array and
trusted_sender_credentials:
$ cf service-key wan1 k1
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
130
Tanzu GemFire on Cloud Foundry
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {
"remote_clusters":[
{
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_PQR"
]
},
{
"remote_locators": [
"id1.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id2.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id3.locator.services-subnet-3.service-instance-id-3.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_XYZ"
]
}
]
}
}
131
Tanzu GemFire on Cloud Foundry
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
Alter the existing cluster A region so that it specifies all gateway senders associated with
the region. There are two gateway senders in this example, one that goes to cluster B and
a second that goes to cluster C.
2. While logged in to Foundation C, use gfsh to create the cluster C gateway sender and region.
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
Call the first pair of Tanzu GemFire on Cloud Foundry service instances Cluster A and Cluster B, which
reside on Foundation A and Foundation B, respectively. This set of directions sets up an interaction
between Cluster A and and a third service instance, Cluster C, which resides on a third foundation,
Foundation C.
Assumptions
You have already established a TLS-encrypted WAN connection between a service instance on
Foundation A, referred to here as Cluster A, and a service instance on Foundation B, which we’ll
call Cluster B, following the Set Up a Unidirectional System procedure.
You want to add an additional TLS-encrypted WAN connection between Cluster A and a third
service instance on Foundation C, which we will call Cluster C.
The connection will be unidirectional, such that all operations in Cluster A are replicated in Cluster
C, but Cluster C does not send operations to Cluster A.
132
Tanzu GemFire on Cloud Foundry
The Preparing for TLS procedure has been followed for Foundation C, establishing a CredHub
“/services/tls_ca” certificate.
The Establishing Mutually Trusted TLS Credentials procedure has been followed, establishing
mutually trusted TLS credentials between Foundations A and C.
2. View the Cluster A service key and save a copy of the remote_cluster_info element, which
includes the recursors array, remote_locators array, and trusted_sender_credentials. These
are the credentials that enable other clusters to communicate with Cluster A.
$ cf service-key wan1 k1
Getting key k1 for service instance wan1 as admin...
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
133
Tanzu GemFire on Cloud Foundry
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
]
}
]
}
}
2. Use the cf create-service command to create a service instance, which we will call Cluster C in
this example. In the cf create-service command, use the -c option to specify the following
arguments:
The following command specifies the Cluster A credentials you copied in an earlier step, enabling
Cluster C to communicate with and receive data from Cluster A:
134
Tanzu GemFire on Cloud Foundry
]
},
"remote_locators":[
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials":[
{
"username": "gateway_sender_GHI",
"password":"gws-GHI-password"
}]
}]
}'
Verify the completion of service creation prior to continuing to the next step. Output from the cf
services command will show the last operation as create succeeded when service creation is
completed.
$ cf create-service-key wan3 k3
Creating service key wan3 for service instance k3 ...
OK
Display the service key and save a copy of the remote_cluster_info element, which includes the
recursors array, remote_locators array, and trusted_sender_credentials. These are the
credentials that enable other clusters to communicate with Cluster C.
$ cf service-key wan3 k3
{
"distributed_system_id": "3",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id2.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id3.locator.services-subnet-3.service-instance-id-3.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet-3.service-instance-id-3.bosh": [
"10.2.32.7:1053",
"10.2.32.6:1053",
"10.2.32.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id2.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id3.locator.services-subnet-3.service-instance-id-3.bosh[55221]"
],
"trusted_sender_credentials": [
135
Tanzu GemFire on Cloud Foundry
{
"username": "gateway_sender_XYZ",
"password": "gws-XYZ-password"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-3.example.com/gemfire/v1",
"pulse": "https://cloudcache-3.example.com/pulse"
},
"users": [
{
"password": "cl-op-STU-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_STU"
},
{
"password": "dev-VWX-password",
"roles": [
"developer"
],
"username": "developer_VWX"
}
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
"gateway_sender_GHI"
]
}
]
}
}
4. While logged in to Foundation A, update the Cluster A service instance to add the Cluster C
credentials, using the -c option to specify a remote_clusters element that includes the contents
of the Cluster C service key remote_cluster_info element, including the recursors array and the
remote_locators array, but NOT the trusted_sender_credentials. This allows Cluster A to
send messages to Cluster C, but blocks data flow from Cluster C to Cluster A.
IMPORTANT: You must also retain the credentials for all clusters with which Cluster A interacts, in
this example those of Cluster B. The existing remote_locators and recursors credentials can be
copied from the remote_cluster_info entry in Cluster B’s service key, before updating the Cluster
A service instance to append credentials for the additional cluster. Do not include Cluster B’s
trusted_sender_credentials.
136
Tanzu GemFire on Cloud Foundry
The following example adds Cluster C’s credentials to Cluster A’s remote_clusters element:
Verify the completion of the service update prior to continuing to the next step. Output from the cf
services command will show the last operation as update succeeded when service update is
completed.
5. To verify that a service instance has been correctly updated, delete and recreate the cluster service
key. The recreated service key will have the same user identifiers and passwords as its
predecessor, and will reflect the changes you specified in the recent cf update-service
commands. In particular, the wan{} element at the end of a cluster’s service key should be
populated with the other cluster’s remote connection information. For example, to verify that the
Cluster A service key was updated correctly, log in as Cluster A administrator and issue these
commands to delete and recreate the Cluster A service key:
$ cf delete-service-key wan1 k1
...
$ cf create-service-key wan1 k1
137
Tanzu GemFire on Cloud Foundry
Verify that the wan{} field of the Cluster A service key contains a remote_clusters element which
specifies contact information for Cluster B, including Cluster B’s remote_locators array, but NOT
trusted_sender_credentials:
$ cf service-key wan1 k1
{
"distributed_system_id": "1",
"gfsh_login_string": "connect
--url=https://cloudcache-url.com/gemfire/v1
--user=cluster_operator_user --password=pass --skip-ssl-validation",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"tls-enabled": "true",
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "cl-op-ABC-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_ABC"
},
{
"password": "dev-DEF-password",
"roles": [
"developer"
],
"username": "developer_DEF"
}
138
Tanzu GemFire on Cloud Foundry
],
"wan": {
"remote_clusters": [
{
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
]
},
{
"remote_locators": [
"id1.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id2.locator.services-subnet-3.service-instance-id-3.bosh[55221]",
"id3.locator.services-subnet-3.service-instance-id-3.bosh[55221]"
]
}
]
}
}
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
Alter the existing cluster A region so that it specifies all gateway senders associated with
the region. There are two gateway senders in this example, one that goes to cluster B and
a second that goes to cluster C.
2. While logged in to Foundation C, use gfsh to create the cluster C region. (Because Cluster C is a
passive member in this unidirectional connection, it does not need a gateway sender.)
Connect using gfsh following the instructions in Connect with gfsh over HTTPS with a role
that is able to manage both the cluster and the data.
139
Tanzu GemFire on Cloud Foundry
This topic explains how to set up servies for an inline cache in VMware Tanzu GemFire on Cloud Foundry.
See The Inline Cache for an introductory description of an inline cache. The implementation of an inline
cache requires custom code deployed on the cluster servers to interact with the backend data store for read
misses and for writes.
The custom code always implements a cache loader for read misses. The custom code and configuration
setup differs for writes. A write-behind implementation uses an asynchronous event queue (AEQ) and an
AEQ listener. A write-through implementation uses a cache writer.
The value returned from the CacheLoader.load method will be put into the region and then returned to the
waiting app, completing the app’s get operation. Since the app blocks while waiting for the result of the get
operation, design the CacheLoader.load method to acquire the value as quickly as possible.
The CacheLoader implementation must be thread-safe. You will deploy the implementation to the servers
during configuration.
The CacheLoader.load method queries the backend data store for the desired entry. That communication
between the server process and the backend data store requires a connection, and establishing a
connection is likely to use a set of credentials. You provide a custom implementation of the
CacheLoader.initialize method to establish the connection.
You specify the credentials during configuration with the gfsh create region command by adding the
JSON description to the --cache-loader option. The credentials will be passed as parameters to the
invoked CacheLoader.initialize method as part of the CacheLoader instance construction.
140
Tanzu GemFire on Cloud Foundry
An asynchronous event queue (AEQ) to queue the write events together with an implementation of the
AsyncEventListener interface provides the desired behavior. See VMware Tanzu GemFire API
Documentation.
With a configured AEQ, all put operations first create or update the entry in the hosted region on the server
and then add the event to the AEQ.
The communication between the server process and the backend data store to do the writes requires a
connection, and establishing a connection is likely to use a set of credentials. You provide a custom
implementation of the AsyncEventListener.initialize method to establish the connection.
You specify the credentials during configuration in the gfsh create async-event-queue command with the
--listener-param option as described in Configure Using gfsh for Write Behind. The credentials will be
passed as parameters to the invoked AsyncEventListener.initialize method as part of
AsyncEventListener instance construction.
Your configuration will specify the AEQ as persistent, such that it does not lose queued backend-data-store
writes across unexpected server restarts.
141
Tanzu GemFire on Cloud Foundry
An implementation of the CacheWriter interface implementation provides the correct behavior for write
through. See VMware Tanzu GemFire API Documentation. You provide a custom implementation of the
CacheWriter.beforeCreate method to handle backend-data-store writes for put operations that add a new
entry to the region. You provide a custom implementation of the CacheWriter.beforeUpdate method to
handle backend-data-store writes for put operations that modify an existing entry in the region. You provide
a custom implementation of CacheWriter.beforeDestroy, as appropriate, to handle an update of the
backend data store for a region operation that removes an entry.
The CacheWriter implementation must be thread-safe. You will deploy the implementation to the servers
during configuration.
Communication between the server process and the backend data store to do the writes requires a
connection, and establishing a connection is likely to use a set of credentials. You provide a custom
implementation of the CacheWriter.initialize method to establish the connection.
Specify the credentials in the gfsh create region command during configuration as described in Configure
Using gfsh for Write Through. Add the JSON description to the --cache-writer option. The credentials will
be passed as parameters to the invoked CacheWriter.initialize method as part of the CacheWriter
instance construction.
142
Tanzu GemFire on Cloud Foundry
1. Follow the directions in Connect with gfsh over HTTPS to connect to the cluster with a role that is
able to manage both the cluster and the data.
2. Deploy the cache loader and the AEQ listener code to the servers within the Tanzu GemFire on
Cloud Foundry service instance:
gfsh>deploy --jars=/path/to/MyLoader.jar,/path/to/MyListener.jar
3. Create the AEQ, assigning a name for the AEQ (called WB-AEQ in this example), specifying the AEQ
listener, and specifying the AEQ listener’s parameters:
The persistence of the AEQ uses the default disk store, since no disk store is specified in this
command.
4. Create the region, specifying the cache loader and the assigned AEQ name.
Follow this procedure to deploy your custom implementations of the interfaces to the servers, and configure
the region to use the deployed interface implementations.
1. Follow the directions in Connect with gfsh over HTTPS to connect to the cluster with a role that is
able to manage both the cluster and the data.
2. Deploy the cache loader and the cache writer code to the servers within the Tanzu GemFire on
Cloud Foundry service instance:
gfsh>deploy --jars=/path/to/MyLoader.jar,/path/to/MyWriter.jar
3. Create the region, specifying the cache loader and the cache writer:
143
Tanzu GemFire on Cloud Foundry
After you have created a service instance, you can access it. The gfsh command line tool provides cluster
maintenance and data access functionality. Many gfsh commands require an authenticated connection that
can be set up with the gfsh connect command.
2. Create a truststore.
The service key reveals the configuration of your service instance. It shows addresses and ports of its
locators, and contains an element called remote_cluster-info that provides fields by which the service
instance can be reached from other service instances. The service key specifies two URLs, one URL used
to connect the gfsh client to the service instance, and another URL used to view the Pulse dashboard in a
web browser, which allows monitoring of the service instance status.
If an external authentication system has been configured, then the cf service-key command returns
output in the following format, without role-based login credentials:
{
"distributed_system_id": "0",
"gfsh_login_string": "connect
--url=https://cloudcache-1.example.com/gemfire/v1
--user=\u003cusername\u003e --password=\u003cpassword\u003e",
144
Tanzu GemFire on Cloud Foundry
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"management": "https://cloudcache-1.example.com/management/docs",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"wan": {
"remote_clusters": [
{
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
}
]
}
}
145
Tanzu GemFire on Cloud Foundry
If external authentication such as LDAP through User Account and Authentication (UAA) has not been
configured, the service key shows role-based login credentials as username/password pairs.
The cf service-key command returns output in the following format and includes role-based login
credentials:
{
"distributed_system_id": "0",
"gfsh_login_string": "connect
--url=https://cloudcache-1.example.com/gemfire/v1
--user=cluster_operator_XXX --password=cluster_operator-password --skip-ssl-valida
tion",
"locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"services-subnet.service-instance-id.bosh": [
"10.0.8.6:1053",
"10.0.8.7:1053",
"10.0.8.5:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet.service-instance-id.bosh[55221]",
"id2.locator.services-subnet.service-instance-id.bosh[55221]",
"id3.locator.services-subnet.service-instance-id.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-GHI-password",
"username": "gateway_sender_GHI"
}
]
},
"urls": {
"gfsh": "https://cloudcache-1.example.com/gemfire/v1",
"management": "https://cloudcache-1.example.com/management/docs",
"pulse": "https://cloudcache-1.example.com/pulse"
},
"users": [
{
"password": "developer-password",
"roles": [
"developer"
],
"username": "developer_XXX"
},
{
"password": "cluster_operator-password",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_XXX"
}
],
146
Tanzu GemFire on Cloud Foundry
"wan": {
"remote_clusters": [
{
"recursors": {
"services-subnet-2.service-instance-id-2.bosh": [
"10.1.16.7:1053",
"10.1.16.6:1053",
"10.1.16.8:1053"
]
},
"remote_locators": [
"id1.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id2.locator.services-subnet-2.service-instance-id-2.bosh[55221]",
"id3.locator.services-subnet-2.service-instance-id-2.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "gws-PQR-password",
"username": "gateway_sender_PQR"
}
]
}
]
}
}
This service key for a Tanzu GemFire on Cloud Foundry installation in which an external authentication
such as LDAP via UAA has not been configured specifies these user roles that are predefined, for
interacting with and within the cluster:
The cluster operator administers the pool, performing operations such as creating and destroying
regions, and creating gateway senders. The identifier assigned for this role is of the form
cluster_operator_XXX, where XXX is a unique string generated upon service instance creation and
incorporated in this user role’s name.
The developer does limited cluster administration such as region creation, and the developer role is
expected to be used by applications that are interacting with region entries. The developer does
CRUD operations on regions. The identifier assigned for this role is of the form developer_XXX,
where XXX is a unique string generated upon service instance creation and incorporated in this user
role’s name.
Create a Truststore
To create a truststore, use the same certificate you used to configure TLS termination. We suggest using
the keytool command line utility to create a truststore file.
1. Locate the certificate you use to configure TLS termination. See Determine Your TLS Termination.
147
Tanzu GemFire on Cloud Foundry
3. When you run this command, you are prompted to enter a keystore password. Create a password
and record it.
4. When prompted for the certificate details, enter yes to trust the certificate.
The following example shows how to run keytool and what the output looks like:
Extensions:
148
Tanzu GemFire on Cloud Foundry
1. Download the compressed Tanzu GemFire TAR file from the Broadcom Customer Support Portal.
Find the correct version to download by referencing the table in Product Snapshot and Version
Compatibility. Note that a JDK or JRE will also be required.
2. Expand the VMware Tanzu GemFire compressed TAR file. gfsh is within the bin directory in the
expanded Tanzu GemFire folder.
/PATH-TO-VMWARE-GEMFIRE/bin/gfsh
\PATH-TO-VMWARE-GEMFIRE\bin\gfsh.bat
The HTTPS-gfsh-URL is the gfsh URL from the service key. See Create Service Keys for
instructions on how to view the service key. TRUSTSTORE-FILE-PATH is the path to the trustStore
file you created in Create a Truststore, and PASSWORD is the associated password you created. If
you omit the --trust-store-password option from the command line, you will be prompted to
enter the password.
For an installation configured without an external authentication such as LDAP via UAA, the USER-
NAME and USER-PASSWORD are taken from the service key, and they will either be for the developer
role or for the cluster operator role, depending on the gfsh operations to be performed.
For an installation configured with an external authentication such as LDAP via UAA, the USER-
NAME and USER-PASSWORD are your credentials as issued and set up by your organization within
your SSO system.
1. Acquire the connect command (the gfsh_login_string) from the service key. This command will
connect using the cluster_operator role. This connect command assumes that the installation is
configured without an external authentication such as LDAP via UAA.
2. Download the compressed Tanzu GemFire TAR file from the Broadcom Customer Support Portal.
Find the correct version to download by referencing the table in Product Snapshot and Version
Compatibility. Note that a JDK or JRE will also be required.
3. Expand the Tanzu GemFirecompressed TAR file. gfsh is within the bin directory in the expanded
Tanzu GemFire folder.
149
Tanzu GemFire on Cloud Foundry
/PATH-TO-VMWARE-GEMFIRE/bin/gfsh
\PATH-TO-VMWARE-GEMFIRE\bin\gfsh.bat
gfsh>connect --url=https://cloudcache-1.example.com/gemfire/v1
--user=cluster_operator_XXX --password=cluster_operator-password
--skip-ssl-validation
At each of the nine gfsh prompts that ask for keystore, truststore, and SSL details, hit Enter to
step through the prompts and connect.
The Tanzu Platform for Cloud Foundry operator determines the location of your TLS termination:
If the choice names the Gorouter or HAProxy, the certificate is in the same section, labeled with
Certificates and private keys for the Gorouter and HAProxy.
If the choice names the Infrastructure load balancer, then the Tanzu Platform for Cloud Foundry operator
can retrieve the certificate from the load balancer.
Using gfsh
This topic describes ways to use the gfsh command-line interface to manage VMware Tanzu GemFire on
Cloud Foundry.
150
Tanzu GemFire on Cloud Foundry
The following gfsh start commands will bring up members contrary to the configured plan. Their
configuration will be wrong, and their existence is likely to contribute to data loss. Since they are not part of
the configured plan, any upgrade will not include them, and if they were to stop or crash, the BOSH Director
will not restart them.
The following gfsh cluster stop commands will temporarily stop the member or cluster. However, the BOSH
Director will notice that members are not running and restart them. This renders the following commands
ineffective:
gfsh shutdown
The following configure command will instill configuration contrary to the already-configured plan. Since it is
not part of the configured plan, any upgrade will not include it. Therefore, do not use the following command:
The creation of a gateway receiver will never be appropriate for any situation. The Tanzu GemFire on Cloud
Foundry cluster will already have gateway receivers, and there is no situation in which the cluster can
benefit from creating more. Therefore, do not use the following command:
151
Tanzu GemFire on Cloud Foundry
While the expectation is that configuration and data can be exported from a Tanzu GemFire cluster and then
imported into a Tanzu GemFire on Cloud Foundry cluster, this does not work. Using export and import
commands will not have the desired effect of migration from one cluster to another. The import of cluster
configuration requires a state that cannot be provided by a Tanzu GemFire on Cloud Foundry cluster. The
Tanzu GemFire on Cloud Foundry cluster will already have its configuration, and upon restart or upgrade,
that same configuration will be used. Given that the configuration cannot be imported, data import is
problematic. Therefore, do not use the following command:
Create Regions
After connecting with gfsh with a role that is able to manage a cluster’s data, you can define a new cache
region.
The following command creates a partitioned region with a single redundant copy:
You can test the newly created region by writing and reading values with gfsh:
In practice, you should perform these get/put operations from a deployed app. To do this, you must bind the
service instance to these apps.
152
Tanzu GemFire on Cloud Foundry
1. Use the directions in Connect with gfsh over HTTPS to connect to the Tanzu GemFire on Cloud
Foundry service instance with a role that is able to manage a cluster’s data.
Specify a relative path for the disk store location. That relative path will be created within
/var/vcap/store/gemfire-server/. For more details about further options, see the gfsh create
disk-store command in the Tanzu GemFire documentation.
1. Use the directions in Connect with gfsh over HTTPS to connect to the Tanzu GemFire on Cloud
Foundry service instance with a role that is able to manage a cluster’s data.
For more details about further options, see the gfsh destroy disk-store command in the Tanzu
GemFire documentation.
Tanzu GemFire on Cloud Foundry service instances output metrics to the Loggregator Firehose. You can
use the Firehose plugin to view metrics output on the cf CLI directly. For more information about using the
Firehose plugin, see Installing the Loggregator Firehose Plugin for cf CLI in the VMware Tanzu Platform for
Cloud Foundry documentation.
You can also connect the output to a Firehose nozzle. Nozzles are programs that consume data from the
Loggregator Firehose. For example, to connect the output to the nozzle for Datadog, see Datadog Firehose
Nozzle on GitHub.
Tanzu GemFire on Cloud Foundry supports metrics for the whole cluster and metrics for each member.
Each server and locator in the cluster outputs metrics.
153
Tanzu GemFire on Cloud Foundry
member.JVMPauses: the number of JVM pauses that have occurred on this member since startup
member.FileDescriptorRemaining: the number of files that this member could open before hitting its
limit
member.UnusedHeapSizePercentage: the percentage of the total heap size that is not currently
being used
1. Use the Connect with gfsh over HTTPS procedure to connect to the service instance for which you
want to see logs. Use a role that can read cluster information.
2. Run export logs. If you see a message of the following form, your logs exceed an expanded size
of 100 megabytes, and they were not exported:
154
Tanzu GemFire on Cloud Foundry
3. Find the ZIP file in the directory where you started gfsh. This file contains a folder for each
member of the cluster. The member folder contains the associated log files and stats files for that
member.
For more information about the gfsh export logs command, see export logs in the VMware GemFire
documentation.
deploy --jar=PATH-TO-JAR/FILENAME.jar
For example:
gfsh>deploy --jar=working-directory/myJar.jar
1. Deploy the updated JAR file by running the following gfsh command:
deploy --jar=PATH-TO-UPDATED-JAR/FILENAME.jar
For example:
gfsh>deploy --jar=newer-jars/myJar.jar
2. Restart the cluster and load the updated JAR file by running the following cf CLI command:
For example:
155
Tanzu GemFire on Cloud Foundry
gfsh>run --file=thecommands.gfsh
gfsh>help run
File specification can be a relative or absolute path and file name. Scripted commands are not interactive,
and any command that would have prompted for input will instead use default values.
To eliminate placing cleartext passwords within a script, run gfsh and connect to the cluster prior to running
a script with the gfsh run command. The password will appear on the command line, but it will not appear
in the file that logs and captures gfsh commands.
Example Scripts
Tightly focussed scripts will ease cluster maintenance. Most of these scripts will do cluster management
operations, so connect to the cluster with a role that is able to manage both the cluster and the data.
Creating the regions hosted on the servers is a common operation. The following example gfsh script
contents creates two regions:
The following example gfsh script contents deploys a app JAR file to the cluster servers:
deploy --jar=/path/to/app-classes.jar
The following example gfsh script contents creates the disk store needed for persistent regions:
Using a Tomcat app with a WAR file. This is the default method for Tomcat apps.
Using the spring-session-data-gemfire library. This method requires that you use the correct
version of these libraries.
156
Tanzu GemFire on Cloud Foundry
To get a Spring Boot app running with session state caching (SSC) on Tanzu GemFire on Cloud Foundry,
you must create a WAR file using the spring-boot-starter-tomcat plugin instead of the spring-boot-
maven plugin to create a JAR file.
For example, if you want your app to use SSC, you cannot use spring-boot-maven to build a JAR file and
push your app to VMware Tanzu Platform for Cloud Foundry (Tanzu Platform for Cloud Foundry), because
the Java buildpack does not pull in the necessary JAR files for SSC when it detects a Spring JAR file.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
For a full example of running a Spring Boot app that connects with SSC, run this app and use the following
for your pom.xml:
<groupId>io.pivotal.gemfire.demo</groupId>
<artifactId>HttpSessionCaching-Webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>HttpSessionCaching-Webapp</name>
<description>Demo project for GemFire Http Session State caching</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
157
Tanzu GemFire on Cloud Foundry
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
2. Upgrade Tanzu GemFire on Cloud Foundry. See Upgrading Tanzu GemFire on Cloud Foundry for
details.
3. Rebuild your app using a build.gradle file that depends on the correct version of VMware
GemFire. Here is an example build.gradle file:
version = '0.0.1-SNAPSHOT'
buildscript {
ext {
springBootVersion = '2.1.8.RELEASE'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootV
ersion}")
}
}
idea{
module{
downloadSources = true
downloadJavadoc = true
158
Tanzu GemFire on Cloud Foundry
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/libs-milestone" }
maven { url "https://repo.spring.io/milestone" }
maven { url "http://repo.springsource.org/simple/ext-release-local" }
maven { url "http://repo.spring.io/libs-release/" }
maven { url "https://repository.apache.org/content/repositories/snapshots" }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:2.1.8.RELEASE")
compile("org.springframework.session:spring-session-data-gemfire:2.1.5.RELEAS
E")
compile("org.springframework.geode:spring-gemfire-starter:1.1.0.RELEASE")
}
To create continuous queries with the Spring Data GemFire library, you must have the following:
The annotation for a durable event queue for continuous queries also sets the durableClientId and
keepAlive attributes. For example:
```java
@ClientCacheApplication(name = "GemFireSpringApplication",
durableClientId = "durable-client-id", keepAlive = true,
readyForEvents = true, subscriptionEnabled = true)
```
159
Tanzu GemFire on Cloud Foundry
Annotate the method that handles the events to specify the query. To make the event queue
durable across server failures and restarts, include the durable = true attribute in the annotation,
as is done in the example:
@Component
public class ContinuousQuery {
@ContinuousQuery(name = "yourQuery",
query = "SELECT * FROM /yourRegion WHERE someAttribute == true",
durable = true)
public void handleChanges(CqEvent event) {
//PERFORM SOME ACTION
}
}
The class that contains the method with the @ContinuousQuery annotation must have the
@Component annotation, such that the continuous query is wired up correctly for the server.
The advanced configuration feature allows you to configure custom JVM options, Tanzu GemFire
properties, Credentials, and Resource Manager properties. Most parameters can be changed, but a small
number cannot be changed due to their impact on the VMware Tanzu Platform for Cloud Foundry platform.
security-gateway-password
security-gateway-username
security-json
security-password
security-username
ssl-enabled-components
ssl-endpoint-identification-enabled
ssl-keystore
160
Tanzu GemFire on Cloud Foundry
ssl-keystore-password
ssl-require-authentication
ssl-truststore
ssl-truststore-password
ssl-web-require-authentication
If you use advanced configuration to set or modify some of these security properties, your changes will
conflict with default settings and lead to unintended consequences. For example, when SSL endpoint
verification is enabled, the configuration for protocols and ciphers reverts to the SSLContext’s client mode
defaults. If advanced configuration was used to modify the security properties, increased difficulty when
upgrading the JDK can occur when the newer JDK uses different defaults for client and server mode SSL.
Additionally, modifying the security properties can lead to duplicate properties being set.
-Xms
-Xmx
-Xloggc
-XX:NumberOfGCLogFiles
-XX:GCLogFileSize
-XX:OnOutOfMemoryError
-XX:+DisableExplicitGC
-Dgemfire.OSProcess.ENABLE_OUTPUT_REDIRECTION
Furthermore, if one of the following properties below is set, then Tanzu GemFire on Cloud Foundry will not
set default values for any of the other properties listed below. This mean that you are responsible for
determining and setting all of the values.
-XX:NewSize
-XX:MaxNewSize
-XX:CMSInitiatingOccupancyFraction
-XX:+UnlockDiagnosticVMOptions
-XX:ParGCCardsPerStrideChunk=32768
-XX:+UseConcMarkSweepGC
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+CMSClassUnloadingEnabled
"jvm_options":["-XX:+UnlockDiagnosticVMOptions",
161
Tanzu GemFire on Cloud Foundry
"-XX:ParGCCardsPerStrideChunk=1274"],
"gemfire_properties":{"enable-cluster-configuration":"true"},
"credentials": {
"db_user_credhub_key": "credhub/ref/myuser",
"db_password_credhub_key": "credhub/ref/mypassword"
},
"resource_manager": {
"critical_heap_percentage": 80,
"eviction_heap_percentage": 60
}
},
"locator":{
"jvm_options":["-XX:+UseNUMA"],
"gemfire_properties":{"groups":"QA_DB_1"},
"credentials": {
"db_user_credhub_key": "credhub/ref/myuser",
"db_password_credhub_key": "credhub/ref/mypassword"
},
"resource_manager": {
"critical_heap_percentage": 80,
"eviction_heap_percentage": 60,
}
}
}
}'
The advanced configuration feature allows you to set options for the servers and the locators. Within each
server and locator, you can set jvm_options, gemfire_properties, credentials, and resource managers.
This new configuration overwrite all previous advanced configurations that have been set on the service
instance. Any configuration option not set in the advanced configuration update to the service instance
revert back to the default value.
cf update-service qa_instance -c
'{
"advanced_configuration":{
"server":{
"jvm_options":["-XX:+UnlockDiagnosticVMOptions",
"-XX:ParGCCardsPerStrideChunk=1274"],
"gemfire_properties":{"enable-cluster-configuration":"true"},
"credentials": {
"db_user_credhub_key": "credhub/ref/myuser",
"db_password_credhub_key": "credhub/ref/mypassword"
},
"resource_manager": {
"critical_heap_percentage": 80,
162
Tanzu GemFire on Cloud Foundry
"eviction_heap_percentage": 60
}
},
"locator":{
"jvm_options":["-XX:+UseNUMA"],
"gemfire_properties":{"groups":"QA_DB_1"},
"credentials": {
"db_user_credhub_key": "credhub/ref/myuser",
"db_password_credhub_key": "credhub/ref/mypassword"
},
"resource_manager": {
"critical_heap_percentage": 80,
"eviction_heap_percentage": 60
}
}
}
}'
Then execute the following command to retrieve service instance’s manifest file:
In the manifest.yml file, search for advanced_configuration, The following example on how it is
displayed:
advanced_configuration:
server:
gemfire_properties: {}
jvm_options:
- -XX:+PrintGC
- -XX:+PrintGCCause
- -XX:+PrintGCDetails
resource_manager:
critical_heap_percentage: null
eviction_heap_percentage: null
credentials: {}
locator:
gemfire_properties: {}
jvm_options:
- -XX:+PrintGC
- -XX:+PrintGCCause
- -XX:+PrintGCDetails
credentials: {}
163
Tanzu GemFire on Cloud Foundry
To reset all advanced settings to their default values, run the cf update-service command and set
advanced_configuration to empty brackets (){}).
cf update-service qa_instance -c
'{
"advanced_configuration":{}
}'
Your service instance creates a statistical archive file named filename.gfs. The file logs useful statistics
— counters and gauges that describe the state of the system at a particular moment in time. The file
collects statistics at specific sampling intervals, which you can set at various levels to monitor different
types of behavior.
The VSD tool reads the sampled statistics and produces graphical displays for analysis. Typically, the
points on a line of a VSD graph represent the values for a particular statistic over time. VSD’s online help
offers more complete reference information about the tool.
The following screenshots of the VSD tool display statistics and a graph analysis of selected statistics.
164
Tanzu GemFire on Cloud Foundry
VSD is a 32-bit application. If you are running VSD on a 64-bit operating system, you may need to install
32-bit OS libraries to run the application if they are not already installed. On Linux, to find out which libraries
are missing you can try running the following:
ldd PRODUCT-DIR/tools/vsd/bin/vsdwishLinux
For 64-bit Windows, you can modify the scripts and executables as described in the note below.
4. Click “Run this program in compatibility mode for” and then select Windows XP SP3.
5. Repeat steps for all the other executables in the bin directory.
165
Tanzu GemFire on Cloud Foundry
Install VSD
VSD is a free analysis tool and is provided as-is. See VSD System Requirements to view a list of platforms
that are known to work with VSD.
VSD is available for download from the Tanzu GemFire on Cloud Foundry download page. It can be installed
anywhere, but if Tanzu GemFire is installed in PRODUCT-DIR, install it in PRODUCT-DIR/tools/vsd so it can
be launched from gfsh using the start vsd command.
Download the VSD archive, usually named something like pivotal-gemfire-vsd.zip, and unpack it in the
directory of your choosing. For this example, assume and VSD was downloaded, unzipped, and installed in
PRODUCT-DIR/tools/vsd.
Note: VSD is a 32-bit application. If you are running VSD on a 64-bit machine, you may need to install 32-
bit OS libraries to run the application if they are not already installed. On Linux, to find out which libraries
are missing, run the following ldd command:
ldd PRODUCT-DIR/tools/vsd/bin/vsdwishLinux
The VSD tool installation has two subdirectories, bin and lib:
bin. Contains scripts and binaries that can be used to run VSD on a variety of operating systems,
including:
Start VSD
To start VSD, you can either execute the scripts directly or you can start VSD through the gfsh interface.
To start VSD using the provided scripts, change directories to PRODUCT-DIR/tools/vsd/bin and enter the
following command at the prompt:
Windows:
prompt>vsd.bat
166
Tanzu GemFire on Cloud Foundry
$ vsd
To start VSD using gfsh, start a gfsh prompt and enter the following command:
gfsh>start vsd
After connecting to the service instance with gfsh export logs command with the --stats-only
as directed in Export gfsh Logs.
Use the BOSH command as specified in View Statistics Files and Logs. The statistics are in
/var/vcap/sys/log/gemfire-server/gemfire/statistics.gfs for servers, and
/var/vcap/sys/log/gemfire-locator/gemfire/statistics.gfs for locators.
Include the name of one or more statistics files on the VSD command line. Example:
Browse for an existing statistics file through Main > Load Data File.
Type the full path in the File entry box, then press Enter.
Switch to a statistics file that you’ve already loaded by clicking the down-arrow next to the File
entry.
After you load the data file, the VSD main window displays a list of entities for which statistics are
available. VSD uses color to distinguish between entities that are still running (shown in green) and those
that have stopped (shown in black).
The File > Auto Update is not supported, since the statistics file is static when downloaded.
To open a VSD file with the time zone used when generating it, you must know in which time zone the .gfs
file is created. To obtain this information, use the following command:
167
Tanzu GemFire on Cloud Foundry
For example:
After you obtain the time zone, modify your local computer to use the time zone used when obtaining
statistics in the .gfs file. For example, on a Mac computer, you can first list available time zones:
export TZ=<timezone>
export TZ=Asia/Hong_Kong
Then use VSD to open the .gfs file that will now display timestamps from the original time zone.
Statistic Levels
Each statistic has a characteristic called a level that reflects the amount of background knowledge that you
would need to use the statistic with understanding. You can set up VSD to list (in its main window and in
associated charts) only those statistics that are at, or below, a certain level of complexity — common,
advanced, or wizard.
To establish the levels of statistics that you want to display in VSD, choose the menu item Main > Statistic
Level in the main VSD window.
Search for a specific session name or process ID. To find a specific entity, click the mouse
in the process list, then press Ctrl-S. When the dialog box appears, enter the PID or name
of the entity that you’re looking for. VSD highlights the first entity with that PID or name. To
find the next match, press Ctrl-S again. To select the highlighted item, click on it. When
you’re done, press Return.
168
Tanzu GemFire on Cloud Foundry
Select all entities or by statistic or by type. Statistics are available for various entities,
which are listed under the heading Type in the process list.
Note: You can use the right mouse button to perform these functions:
Combine multiple entities into a single line. This can be quite helpful. For example, if you
want to measure page reads per second for several hundred entities, you could select all
the entities, then combine them into a single line in the chart, thus rendering the data much
more readable.
Select Single File mode so only one loaded file can be enabled at a time.
Select for created lines to have absolute timestamps, which is useful when merging files.
2. Select a statistic for viewing from the statistics list just below the process list.
To display the statistic in a new chart, type the name of the chart in the Chart entry box,
then click New Chart. (Note: If you don’t explicitly specify a chart name, VSD will assign
one for you.)
To display the statistic in an existing chart, select the chart name in the Chart entry box.
Then click on Add Line.
In your template, you can assign a filter for each statistic, to determine how much information is displayed
for that statistic. You can also restrict the template to look for extreme conditions (for example, processes
that are consuming 90% or more of the CPU).
VSD is shipped with a set of predefined templates, which are maintained in the .vsdtemplates file in your
home directory.
Task Procedure
Create a new chart In the VSD main window, choose the menu item Template > New Template Chart. This is an effective
from a template way to display some of the more useful system statistics.
Apply a template to In the Chart window, choose the menu item Chart > Add From Template. (Note: If you have zoomed in
the chart you are on a chart, the template filter is only applied to values within the zoomed range.)
viewing
Reread the In the VSD main window, choose the menu item Template > Reload Template File.
.vsdtemplates
template file into VSD
after you’ve edited it
169
Tanzu GemFire on Cloud Foundry
Task Procedure
Save the current In the Chart window, configure the chart as you desire, then choose the menu item Chart > Save
chart as a template Template. The template is saved to the .vsdtemplates file. If you save the current chart as a
template, you may still need to edit the .vsdtemplates file so that you can give it a more useful name
and make the information and patterns it captures more general.
Add from Template Expand template and add resulting lines to chart.
Zoom In Zoom in to improve your view of the chart. After you choose this menu item, click to select one
corner of the area that you want to zoom. Move the mouse pointer to the opposite corner of the zoom
area, then click again. If you have a middle mouse button, you can quickly zoom in on an area by
clicking the middle mouse button over it.
Zoom Out Zoom out by using the menu button or by right-clicking in the chart window.
Compute Scale All, Adjust the scale of the chart. This helps you view multiple statistics on the same axis.
Unscale All
Time Format Change the format of the time displayed along the X axis.
Show Time Axis Title, Display the title alongside the respective axes.
Show Left Axis Title,
Show Right Axis Title
Show Current Values Display the current X and Y values for the selected line at the top of the chart
Show Min and Max Display the minimum and maximum values for the selected line at the top of the chart.
Show Line Stats Display these statistics for the selected line: the number of data samples, the min, max, mean, and
standard deviation. The statistics are calculated from all of the data points on the selected line in the
region defined by the graph’s current X axis. (To change the region, select Zoom In or Zoom Out
from the Chart menu.)
170
Tanzu GemFire on Cloud Foundry
For additional information about the Chart window, choose Help from the Chart menu.
Line
Menu Effect
Item
Log Info Display a log file showing the line statistics for all data samples in the region defined by the graph’s current X axis.
Log Measure the difference between two values on the selected line. Select the line before choosing this menu item
Delta then click on the two points whose difference you want to compute. VSD responds by displaying a log file showing
the difference in time and value between the two points; the number of data samples in the selected line segment;
and the min, max, mean, and standard deviation of those samples.
Compute Compute a scale value for the selected line that will make it visible on the current chart. You can also use the Scale
Scale entry box to manually change the scale. The default scale value is 1.
Graph Display the Y axis for the selected line to the left of the chart. Otherwise, the Y axis is displayed to the right. You
on Left can use this to view multiple lines on the same chart, by graphing large values on one axis and small values on the
Axis opposite axis.
Style Select a line style for connecting points: linear (default), step, natural, quadratic.
171
Tanzu GemFire on Cloud Foundry
To select a line in the chart, click on it or on its entry in the chart legend.
To delete a line from the chart, click the middle mouse button (if available) on its entry in the chart
legend. Alternatively, select the line’s entry in the chart legend and choose Line > Delete.
To find out about a specific point in a chart, hold the mouse pointer over it.
In the Statistic Information window, you can redefine the level and default filter for any VSD statistic.
The statistic’s level — common, advanced, or wizard — allows you to determine whether the
statistic is displayed in the VSD statistic list.
Whenever you add a line to a chart, the filter determines how information is displayed for the
selected statistic.
Default
Effect
Filter
Default No Filter if the statistic represents a snapshot of a value. PerSecond if the statistic represents a value that
always increases.
No Filter Display the raw values for the statistic with no filtering.
PerSample Display the difference between two consecutive samples of the statistic.
PerSecond Display the difference between two consecutive samples of the statistic, divided by the number of elapsed
seconds between the two samples.
Aggregate Display a running total of per-sample deltas for the statistic. Reset to zero when the delta is zero or changes
direction.
Once you have added the line to a chart, you can override its default filter by specifying a new filter from
the drop-down menu at the top of the Chart window.
If you leave the Statistic Information window up as you work, it changes to reflect the current statistic. In
this way, you can get a quick explanation of any statistic that you’re currently examining.
A large number of statistics about Tanzu GemFire on Cloud Foundry are intended only for product support
and engineering. This topic describes the most important categories and the useful statistics they contain.
Runtime Configuration
172
Tanzu GemFire on Cloud Foundry
As the name implies, these statistics can help with verifying the runtime configuration of a service instance:
The number of peer nodes (i.e. servers or peer accessors) in the system:
DistributionStats:nodes. This value should be the same for every node in the system.
The number of clients and client connections for each server: CacheServerStats:
currentClients, and currentClientConnections
DiskRegionStatistics (a per region disk statistic category about the region’s disk use):
entriesInVM, and entriesOnlyOnDisk show the number of entries in the JVM (which can
also be on disk too), and the number of entries that are only on disk, respectively.
Partitioned Region Configuration: One of the main parameters of Partitioned Region (PR)
configuration is the primary bucket distribution. To make sure that primary buckets for a PR are
evenly distributed, check the PartitionedRegionStats.primaryBucketCount statistic for each
partition. This statistic shows the number of primary buckets in a partition.
Resources
The resources that are vital for normal operation and performance are memory, file descriptors (most
importantly sockets, then files), CPU, network, and disk (when disk operations, such as overflow and
persistence, are involved). The following stats cover all those:
Memory: There are several stats categories that show memory usage, for different types and
granularity of memory.
Heap: VMMemoryUsageStats:vmHeapMemoryStats are all about heap usage, as are the
memory stats under VMStats:vmStats: freeMemory, totalMemory, and maxMemory.
System-wide memory stats as reported by the OS: The OS statistic category (e.g.
LinuxSystemStats on Linux) includes various system level memory statistics, such as
freeMemory, which shows the free memory on the host (as opposed to related to the JVM
process), physicalMemory (total physical memory on the host), paging related statistics
(pagesSwappedIn, pagesSwappedOut, unallocatedSwap).
Client and gateway queue sizes: while not actual resources, these queues may be
responsible for increased memory usage, and VMware recommends that you keep them in
mind when investigating memory issues. The client queue stats are in
ClientSubscriptionStats category: eventsQueued, and eventsRemoved. The difference
between the two is the current queue size. The gateway queue stats are in
GatewaySenderStatistics category: eventQueueSize is the size of the queue.
File Descriptors: file descriptor related statistics are captured in the category VMStats: fdsOpen
and fdLimit show the number of open file descriptors, and the limit on file descriptors for the host,
respectively.
CPU: The CPU usage is captured in OS statistic category, e.g. LinuxSystemStats. The statistic
cpuActive shows the percentage of the total available CPU time that has been used in a non-idle
173
Tanzu GemFire on Cloud Foundry
state.
Network: OS stats also include network related stats for received (recv) and transmitted traffic
(recvBytes, xmitBytes, recvErrors, xmitErrors).
Disk: DiskDirStatistics:diskSpace shows the amount of disk space used for disk storage on a
given disk. Above mentioned entriesOnlyOnDisk, and entriesInVM from DiskRegionStatistics are
useful for determining the distribution of data between memory and disk, for regions that use disk
overflow/persistence.
The following chart is an example of examining the vmHeapMemoryStats in relation to the entriesInVM
statistic.
CachePerfStats category includes the following stats (all measured in the number of operations per
second):
gets: the number of successful gets
174
Tanzu GemFire on Cloud Foundry
puts: the number of times an entry has been added or replaced as a result of a local
operation (put, create, or get which results in a load, netsearch, or netload of a value)
CacheServerStats category includes the following throughput stats for client operations on the
cache server:
getRequests, getResponses
getAllRequests, getAllResponses
putRequests, putResponses
putAllRequests, putAllResponses
queryRequests, queryResponses
Disk operations: If any disk related statistic categories are present in VSD, it means that there is
disk activity (some entries are on disk). Presence of disk operations may explain a drop in
throughput, as disk use slows things down.
DiskRegionStatistics (statistics about a region disk use): writes, writeTime, writtenBytes,
reads, readTime, readBytes
DiskStoreStatistics are statistics about a specific disk store’s use of disk. In addition to
write/read as those in DiskRegionStatistics, this category includes queueSize statistic,
which shows the current number of entries in the asynchronous queue waiting to be flushed
to disk.
175
Tanzu GemFire on Cloud Foundry
Application Development
This section introduces design patterns for structuring app design for VMware Tanzu GemFire on Cloud
Foundry (Tanzu GemFire on Cloud Foundry). It presents a minimal view of cluster data organization to help
with data architecture design. For a complete presentation of a cluster’s capabilities, see the VMware Tanzu
GemFire Product Documentation.
An app that interacts with a Tanzu GemFire on Cloud Foundry service instance will use the Tanzu GemFire
cluster within that service instance. Architecting the data storage for the app requires some familiarity with
how clusters work.
In this section:
Design Patterns
The Inline Cache
Follow-the-Sun Pattern
Region Design
Keys
Partitioned Regions
Replicated Regions
Persistence
Overflow
Handling Events
Example Applications
A Simple Java App
Running an App
176
Tanzu GemFire on Cloud Foundry
Design Patterns
This topic discusses design patterns for use with VMware Tanzu GemFire on Cloud Foundry.
The design patterns in this section are intended as overviews of common and useful configurations.
Effective implementations will require planning. Consult with a system architect to determine design details
for your app.
The app will want to accomplish CRUD (create, read, update, delete) operations on its data. The app’s
implementation of the CRUD operations result in cache operations that break down into cache lookups
(reads) and/or cache writes.
The algorithm for a cache lookup quickly returns the cache entry when the entry is in the cache. This is a
cache hit. If the entry is not in the cache, it is a cache miss, and code on the cache server retrieves the
entry from the backend data store. In the typical implementation, the entry returned from the backend data
store on a cache miss is written to the cache, such that subsequent cache lookups of that same entry
result in cache hits.
The implementation for a cache write typically creates or updates the entry within the cache. It also creates
or updates the data store in one of the following ways:
Synchronously, in a write-through manner. Each write operation from the app is sent on to be written
to the backend data store. After the backend data store write finishes, the value is also written to
the cache. The app blocks until the writes to both the backend data store and the cache complete.
Asynchronously, in a write-behind manner. The cache gets updated, and the value to be written to
the backend data store gets queued. Control then returns to the app, which continues independent
of the write to the backend data store.
177
Tanzu GemFire on Cloud Foundry
Developers design the server code to implement this inline-caching pattern. See Setting Up Servers for an
Inline Cache for details about the custom server code and how to configure an inline cache.
The app will want to accomplish CRUD (CREATE, READ, UPDATE, DELETE) operations on its data. That
data may be:
The app’s implementation of the CRUD operations result in cache operations that break down into cache
lookups (reads) and/or cache writes.
The algorithm for a cache lookup returns the cache entry when the entry is in the cache. This is a cache hit.
If the entry is not in the cache, it is a cache miss, and the app attempts to retrieve the entry from the data
store. In the typical implementation, the entry returned from the backend data store is written to the cache,
such that subsequent cache lookups of that same entry result in cache hits.
The cache-aside pattern of caching leaves the app free to implement whatever it chooses if the data store
does not have the entry.
The entry is either updated or created within the data store, and the entry is updated within or
written to the cache.
178
Tanzu GemFire on Cloud Foundry
The entry is either updated or created within the backend data store, and the copy currently within
the cache is invalidated.
Note: SDG (Spring Data Geode) supports the cache-aside pattern, as detailed in
Configuring Spring's Cache Abstraction in the Spring Data documentation.
In this active-active system, an external entity implements load-balancing by directing app connections to
one of the two service instances. If one of the Tanzu GemFire on Cloud Foundry service instances fails,
apps may be redirected to the remaining service instance.
This diagram shows multiple instances of an app interacting with one of the two Tanzu GemFire on Cloud
Foundry service instances, cluster A and cluster B. Any change made in cluster A is sent to cluster B, and
any change made in cluster B is sent to cluster A.
179
Tanzu GemFire on Cloud Foundry
as a “hot” spare. In the scenario of the failure of an entire data center or an availability zone, you can rebind
apps to the replicate and restage them. The replicate then takes over as the primary.
In this diagram, cluster A is primary, and it replicates all data across a WAN to cluster B.
If cluster A fails, you can manually rebind and restage the apps so that cluster B takes over.
180
Tanzu GemFire on Cloud Foundry
GemFire on Cloud Foundry service instance via WAN replication, and that other cluster provides only query
access to the region data.
This diagram shows an app that may update the region within the Tanzu GemFire on Cloud Foundry service
instance of cluster A. Changes are propagated across the WAN to cluster B. The app bound to cluster B
may only query the region data; it will not create entries or update the region.
181
Tanzu GemFire on Cloud Foundry
A common implementation that uses this topology directs all app operations that write or update region
contents to the hub. Writes and updates are then propagated asynchronously across the WAN from the hub
to the spokes.
Follow-the-Sun Pattern
Performance improves when operation requests originate in close proximity to the service instance that
handles those requests. Yet many data sets are relevant and used all over the world. If the most active
location for write and update operations moves over the course of a day, then a performant design pattern is
a variation on the hub-and-spoke implementation that changes which Tanzu GemFire on Cloud Foundry
service instance is the hub to the most active location.
Form a ring that contains each Tanzu GemFire on Cloud Foundry service instance that will act as the hub.
Define a token to identify the hub. Over time, pass the token from one Tanzu GemFire on Cloud Foundry
service instance to the next, around the ring.
This diagram shows Tanzu GemFire on Cloud Foundry service instance A is the hub, as it has the token,
represented in this diagram as a star. Tanzu GemFire on Cloud Foundry service instances B, C, and D are
spokes. Write and update operations are directed to the hub.
182
Tanzu GemFire on Cloud Foundry
This diagram shows that the token has passed from A to B, and B has become the hub.
183
Tanzu GemFire on Cloud Foundry
Region Design
This topic describes region design considerations and requirements to use when running VMware Tanzu
GemFire on Cloud Foundry.
Cached data are held in regions. Each entry within a region is a key/value pair. The choice of key and
region type affect the performance of the design. There are two basic types of regions: partitioned and
replicated. The distinction between the two types is based on how entries are distributed among servers
that host the region.
Keys
Each region entry must have a unique key. Use a wrapped primitive type of String, Integer, or Long.
Experienced designers have a slight preference of String over Integer or Long. Using a String key
enhances the development and debugging environment by permitting the use of a REST API (Swagger UI),
as it only works with String types.
Partitioned Regions
184
Tanzu GemFire on Cloud Foundry
A partitioned region distributes region entries across servers by using hashing. The hash of a key maps an
entry to a bucket. A fixed number of buckets are distributed across the servers that host the region.
Here is a diagram that shows a single partitioned region (highlighted) with very few entries to illustrate
partitioning.
A partitioned region is the proper type of region to use when one or both of these situations exist:
The region holds vast quantities of data. There may be so much data that you need to add more
servers to scale the system up. Tanzu GemFire on Cloud Foundry can be scaled up without
downtime; to learn more, see Updating a Tanzu GemFire on Cloud Foundry Service Instance.
Operations on the region are write-heavy, meaning that there are a lot of entry updates.
Redundancy adds fault tolerance to a partitioned region. Here is that same region, but with the addition of a
single redundant copy of each each entry. The buckets drawn with dashed lines are redundant copies.
Within the diagram, the partitioned region is highlighted.
With one redundant copy, the cluster can tolerate a single server failure or a service upgrade without losing
any region data. With one less server, the cluster revises which server holds the primary copy of an entry.
185
Tanzu GemFire on Cloud Foundry
A partitioned region without redundancy permanently loses data during a service upgrade or if a server goes
down. All entries hosted in the buckets on the failed server are lost.
PARTITION_REDUNDANT Region entries are placed into the buckets that are distributed across all
servers hosting the region. In addition, the cluster keeps and maintains a declared number of
redundant copies of all entries. The default number of redundant copies is 1.
PARTITION_REDUNDANT_HEAP_LRU Region entries are placed into the buckets that are distributed
across all servers hosting the region. The cluster keeps and maintains a declared number of
redundant copies. The default number of redundant copies is 1. As a server (JVM) reaches a heap
usage of 75% of available heap, the server destroys entries as space is needed for updates. The
oldest entry in the bucket where a new entry lives is the one chosen for destruction.
PARTITION_PERSISTENT Region entries are placed into the buckets that are distributed across all
servers hosting the region, and all servers persist all entries to disk.
PARTITION_REDUNDANT_PERSISTENT Region entries are placed into the buckets that are distributed
across all servers hosting the region, and all servers persist all entries to disk. In addition, the
cluster keeps and maintains a declared number of redundant copies of all entries. The default
number of redundant copies is 1.
PARTITION_REDUNDANT_PERSISTENT_OVERFLOW Region entries are placed into the buckets that are
distributed across all servers hosting the region, and all servers persist all entries to disk. In
addition, the cluster keeps and maintains a declared number of redundant copies of all entries. The
default number of redundant copies is 1. As a server (JVM) reaches a heap usage of 75% of
available heap, the server overflows entries to disk when it needs to make space for updates.
PARTITION_PERSISTENT_OVERFLOW Region entries are placed into the buckets that are distributed
across all servers hosting the region, and all servers persist all entries to disk. As a server (JVM)
reaches a heap usage of 75% of available heap, the server overflows entries to disk when it needs
to make space for updates.
Replicated Regions
Here is a replicated region with very few entries (four) to illustrate the distribution of entries across servers.
For a replicated region, all servers that host the region have a copy of every entry.
186
Tanzu GemFire on Cloud Foundry
The cluster maintains copies of all region entries on all servers. The cluster takes care of distribution and
keeps the entries consistent across the servers.
A replicated region is the proper type of region to use when one or more of these situations exist:
The region entries do not change often. Each write of an entry must be propagated to all servers
that host the region. As a consequence, where there are many concurrent write accesses, the
resulting subsequent writes to all other servers hosting the region cause a loss of performance.
The overall quantity of entries is not so large as to push the limits of memory space for a single
server. The Tanzu Platform for Cloud Foundry service plan sets the server memory size.
The entries of a region are frequently accessed together with entries from other regions. The entries
in the replicated region are always available on the server that receives the access request, leading
to better performance.
REPLICATE All servers hosting the region have a copy of all entries.
REPLICATE_HEAP_LRU All servers hosting the region have a copy of all entries. As a server (JVM)
reaches a heap usage of 75% of available heap, the server destroys entries as it needs to make
space for updates.
REPLICATE_PERSISTENT All servers hosting the region have a copy of all entries, and all servers
persist all entries to disk.
REPLICATE_PERSISTENT_OVERFLOW All servers hosting the region have a copy of all entries. As a
server (JVM) reaches a heap usage of 75% of available heap, the server overflows entries to disk
as it need to make space for updates.
Persistence
Persistence adds a level of fault tolerance to a Tanzu GemFire on Cloud Foundry service instance by
writing all region updates to local disk. Disk data, hence region data, is not lost upon cluster failures that
exceed redundancy failure tolerances. Upon cluster restart, regions are reloaded from the disk, avoiding the
slower method of restart that reacquires data using a database of record.
187
Tanzu GemFire on Cloud Foundry
Creating a region with one of the region types that includes PERSISTENT in its name causes the instantiation
of local disk resources with these default properties:
Synchronous writes. All updates to the region generate operating system disk writes to update the
disk store.
The disk size is part of the instance configuration. See Configure Service Plans for details on
setting the persistent disk types for the server. Choose a size that is at least twice as large as the
expected maximum quantity of region data, with an absolute minimum size of 2 GB. Region data
includes both the keys and their values.
Warning messages are issued when a 90% disk usage threshold is crossed.
Overflow
Region overflow is an eviction action that keeps heap memory space usage below a fixed threshold of 75%
of available heap memory space. For a region that pushes at the limits of memory usage, overflow reduces
the number of or eliminates pauses for stop-the-world garbage collection.
The action of overflow writes one or more least recently used region entries to disk to make room in
memory for another entry. The least recently used entry within the bucket to which new entry maps is the
chosen overflow victim. The key of the victim remains in memory, but the value of the entry is written to
disk. An operation on an entry that has overflowed to disk causes the entry to be swapped back into
memory.
If using a region type with overflow, be sure to configure a plan with sufficient disk space for the Server VM,
allocating at least the minimums given for the Persistent disk type for the Server VMs, as described in
Configure Tile Properties.
If no disk store is created, region creation with a region type that uses a disk store will cause the creation of
one called DEFAULT with a default size (2 Gbyte). Alternatively, create the disk store using gfsh, as
described in Working with Disk Stores. Then, create the region using the --disk-store option to specify
the created disk store. If the disk store has been created, but the gfsh region creation command neglects to
specify a disk store, a new DEFAULT disk store will be created and used. For more details about region
creation options, see the gfsh create region command in create in the VMware Tanzu GemFire
documentation.
Client region types associate a name with a particular client region configuration.
PROXY forwards all region operations to the servers. No entries are locally cached. Use this client
region type unless there is a compelling reason to use one of the other types. Use this type for all
Twelve-Factor apps in order to assure stateless processes are implemented. Not caching any
entries locally prevents the app from accidentally caching state.
CACHING_PROXY forwards all region operations to the servers, and entries are locally cached.
188
Tanzu GemFire on Cloud Foundry
CACHING_PROXY_HEAP_LRU forwards all region operations to the servers, and entries are locally
cached. Locally cached entries are destroyed when the app’s usage of cache space causes its
JVM to hit the threshold of being low on memory.
Perhaps another region holds customer orders. This data also naturally maps to a partitioned region. The
same could apply to a region that holds order shipment data or customer payments. In each case, the
number of region entries continues to grow over time, and updates are often made to those entries, making
the data somewhat write heavy.
A good candidate for a replicated region would be the data associated with the company’s products. Each
region entry represents a single product. There are a limited number of products, and those products do not
often change.
Consider that as the client app goes beyond the most simplistic of cases for data representation, the Tanzu
GemFire on Cloud Foundry instance hosts all of these regions such that the app can access all of these
regions. Operations on customer orders, shipments, and payments all require product information. The
product region benefits from access to all its entries available on all the cluster’s servers, again pointing to
a region type choice of a replicated region.
Handling Events
This topic discusses events in VMware Tanzu GemFire on Cloud Foundry.
The cluster within a Tanzu GemFire on Cloud Foundry service instance can handle events. An app registers
interest in a particular event, and when the server detects the event, an app-defined callback (also called a
handler or a listener) is invoked to handle the event.
the app registers the event with or identifies the event to the system component that will detect the
event
Continuous Queries
Continuous queries use an OQL query on region data to define an event. A change in query results is the
event. The app registers both the query and the callback to set up a continuous query. Each region
operation invokes the query, leading to the naming of this type of event handling as continuous.
For details about the Object Query Language (OQL) and generating queries, see Querying with OQL in the
VMware Tanzu GemFire documentation.
Example Applications
189
Tanzu GemFire on Cloud Foundry
This topic provides links to example applications intended to provide insight into aspects of app design for
VMware Tanzu GemFire on Cloud Foundry Service.
You have Cloud Foundry credentials for accessing the Tanzu GemFire on Cloud Foundry service
instance.
You have a service key for the Tanzu GemFire on Cloud Foundry service instance.
You have a gfsh client of the same version as is used within your Tanzu GemFire on Cloud
Foundry service instance.
2. Update your clone of the sample Java app to work with your Tanzu GemFire on Cloud Foundry
service instance:
Modify the manifest in manifest.yml by replacing service0 with the name of your Tanzu
GemFire on Cloud Foundry service instance.
Replace the username and password in the gradle.properties file with your username
and password for the Pivotal Commercial Maven Repository.
Update the Tanzu GemFire version in the dependencies section of the build.gradle file to
be the same as the version within your Tanzu GemFire on Cloud Foundry service instance.
5. Use gfsh to connect to the Tanzu GemFire on Cloud Foundry service instance as described in
Connect with gfsh over HTTPS.
6. Use gfsh to create a region named test as described in Create Regions. This sample app places a
single entry into the region, so the region type is not important. PARTITION_REDUNDANT is the
recommended choice.
7. In the shell where the app was built, deploy and run the app with
190
Tanzu GemFire on Cloud Foundry
cf push -f manifest.yml
8. After the app starts, there will be an entry of (“1”, “one”) in the test region. you can see that there
is one entry in the region with the gfsh command:
For this very small region, you can print the contents of the entire region with a gfsh query:
The versioned example Spring Boot Data GemFire app at PCC-Sample-App-PizzaStore uses the Tanzu
GemFire on Cloud Foundry service instance as a system of record. Directions for running the app are in the
GitHub repository’s README.md file. The app is versioned, and branches of the repository represent Tanzu
GemFire on Cloud Foundry versions. For Tanzu GemFire on Cloud Foundry 2.0 use the branch named
release/2.0.
The app saves pizza orders within the VMware GemFire servers of a Tanzu GemFire on Cloud Foundry
service instance. A REST interface provides a way for the app to take orders for pizza toppings and
sauces.
The app demonstrates how to set up and run the app based on The App’s Location.
@SpringBootApplication
public class CloudcachePizzaStoreApplication
This app is the client within a standard client/server architecture. The Tanzu GemFire on Cloud Foundry
service instance contains the servers. The client cache is a driver for interactions with the servers.
The Spring repository construct is the preferred choice to use for the data storage, which will be an VMware
GemFire region. To implement it, annotate this example’s PizzaRepository implementation with
@Repository:
@Repository
public interface PizzaRepository extends CrudRepository<Pizza, String>
An VMware GemFire region underlies the Spring repository, storing the ordered pizzas. Annotate the Pizza
class model with @Region:
191
Tanzu GemFire on Cloud Foundry
@Region("Pizza")
public class Pizza {
Within the Pizza class, identify the key of the VMware GemFire region entries with the @Id annotation. It is
the name field in this example:
The @SpringBootApplication annotation results in a chain of opinionated defaults, all of which are
appropriate for this app. It identifies the app as a client. The client receives an VMware GemFire client
cache. Any regions will default to type PROXY. A proxy type of region forwards all region operations to the
GemFire servers; no data is stored within the app’s client cache.
See Configuring Regions for Spring details. See Region Design for Tanzu GemFire on Cloud Foundry details
about regions.
@RestController
public class AppController
As pizzas are ordered, a CrudRepository.save() operation causes an VMware GemFire put operation
that updates the region on the VMware GemFire server.
Running an App
This topic describes the requirements and options to use when running an app with VMware Tanzu GemFire
on Cloud Foundry.
Binding an app to the service instance provides connection information through the VCAP_SERVICES
environment variable. Your app can use this information to configure components, such as the Tanzu
GemFire client cache, to use the service instance.
192
Tanzu GemFire on Cloud Foundry
The app is in the same foundation as the Tanzu GemFire on Cloud Foundry service instance. For
this discussion, the app is a services foundation app.
The app is in a different foundation than the Tanzu GemFire on Cloud Foundry service instance. For
this discussion, the app is an app foundation app.
The app is not running within any foundation. For this discussion, the app is an off-platform app,
where a platform is composed of all foundations.
To communicate with the Tanzu GemFire on Cloud Foundry service instance, app foundation apps and off-
platform apps require a service gateway.
2. Create a Tanzu GemFire on Cloud Foundry service instance with service-gateway access enabled
as described in Create a Service Instance.
4. Copy the truststore to the resources directory within the app source code.
5. If the app foundation does not include a user-defined service instance, populate a
resources/application.properties file within the app source code, as described in Specifying
Application Properties.
env:
JAVA_OPTS: '-Djavax.net.ssl.trustStore=/home/vcap/app/BOOT-INF/classes/mytr
uststore.jks -Djavax.net.ssl.trustStorePassword=TRUST-STORE-PASSWD-HERE'
JBP_CONFIG_CONTAINER_SECURITY_PROVIDER: '{ key_manager_enabled: false }'
2. Create a Tanzu GemFire on Cloud Foundry service instance with service-gateway access enabled
as described in Create a Service Instance.
193
Tanzu GemFire on Cloud Foundry
4. Copy the truststore to the resources directory within the app source code.
7. Run the app. If the @EnableClusterConfiguration annotation is used by the Spring Boot for
GemFire app, the app must specify the truststore and its password in both the
application.properties file and in the command that invokes the app. An example maven
command might look similar to:
where TRUST-STORE-PASSWD is the invented password specified when creating the truststore.
If the app does not use the @EnableClusterConfiguration annotation, the example maven
command becomes
mvn spring-boot:run
1. Acquire the services/tls_ca from CredHub on the services foundation where the Tanzu GemFire
on Cloud Foundry service instance runs.
2. Acquire the CA certificate from the location of your TLS termination within the services foundation
where the Tanzu GemFire on Cloud Foundry service instance runs. For the example provided here,
the file is named root_ca_certificate. If your TLS termination is at the GoRouter, then the
certificate can be acquired from the Ops Manager tile under Settings, Advanced Options,
Download Root CA Cert.
3. Use these keytool commands to form the truststore using the two acquired certificates:
194
Tanzu GemFire on Cloud Foundry
spring.data.gemfire.pool.locators=
service-gateway.hostname=
service-gateway.port=
spring.data.gemfire.pool.default.socket-factory-bean-name=
spring.data.gemfire.security.username=
spring.data.gemfire.security.password=
spring.data.gemfire.security.ssl.components=
gemfire.ssl-truststore=
gemfire.ssl-truststore-password=
gemfire.ssl-keystore=
gemfire.ssl-keystore-password=
Define service-gateway.hostname with the value of the services_gateway element of the Tanzu
GemFire on Cloud Foundry service instance service key. Do not include the colon or the port
number.
Define service-gateway.port with only the value of the port number from the services_gateway
element of the Tanzu GemFire on Cloud Foundry service instance service key.
Define gemfire.ssl-truststore with the path to and file name of the truststore within the app’s
environment.
Include gemfire.ssl-keystore= in the application properties file, but leave the value blank.
Include gemfire.ssl-keystore-password= in the application properties file, but leave the value
blank.
Apps that connect to a TLS-enabled Tanzu GemFire on Cloud Foundry service instance must set properties
to configure the communication with the cluster components within the Tanzu GemFire on Cloud Foundry
195
Tanzu GemFire on Cloud Foundry
service instance.
Ensure that the cluster-level prerequisite step of Preparing for TLS has been completed.
For a Spring Data GemFire app with a Spring Data GemFire library dependency of 2.2.0.BUILD-SNAPSHOT
or a more recent version, attach the @EnableSsl annotation to your configuration class to enable the TLS
encryption for all cluster components. Also set these properties:
ssl-use-default-context=true
ssl-endpoint-identification-enabled=false
ssl-enabled-components=all
ssl-use-default-context=true
ssl-endpoint-identification-enabled=false
An app may set these properties with the ClientCacheFactory.set() method, prior to creating a
ClientCache instance.
The build and cf push of the app does not require any changes to work with a TLS-enabled Tanzu GemFire
on Cloud Foundry service instance.
Tomcat, by default, stores all sessions and their data in memory. However, under certain circumstances, it
may be beneficial to persist sessions and their data to a repository. This is particularly useful for small
amounts of data that need to survive the failure of an individual instance. In such cases, the Java buildpack
can automatically configure Tomcat to store sessions in Tanzu GemFire on Cloud Foundry.
The geode-store is a component within the Java buildpack that enables this functionality by integrating
Tomcat with Tanzu GemFire on Cloud Foundry. It allows session data to be stored and managed in a
distributed GemFire cluster, providing high availability, scalability, and data persistence. This ensures that
session data remains consistent and accessible, even in the event of instance failures, enhancing the
reliability of your application.
When deploying applications with session state caching, ensuring compatibility between the versions of
Tomcat, GemFire, and the geode-store is crucial for optimal performance and reliability.
Confirm that you are using a Java buildpack version 4.30 or later.
Do not mix Tomcat session state caching with Spring Session Caching. Mixing Tomcat session state
caching with Spring Session caching can cause issues.
196
Tanzu GemFire on Cloud Foundry
To enable Tomcat session state caching, choose one of the following options:
Option 3: Include session-replication anywhere in the service instance name when creating the
service:
WARNING: Tomcat version X does not match Geode Tomcat Y module. If you
encounter compatibility issues, please make sure these versions match.
This warning indicates an issue that needs to be addressed if your version of Tomcat is significantly older
(such as a Tomcat version prior to version 8) than the current default Tomcat version specifications.
You can fix this warning by changing the version of Tomcat being used by the Java buildpack in one of two
ways:
Create a Custom Buildpack and modify the version of Tomcat in your custom buildpack.
Specify the online buildpack in the app’s manifest.yml file, and set an environment variable in the
app’s manifest.yml file as described in the Java Buildpack Configuration and Extension
README.
For example:
```
buildpacks:
- https://github.com/cloudfoundry/java-buildpack.git#v4.37
env:
JBP_CONFIG_TOMCAT: '{ tomcat: { version: 9.0.+ } }'
```
For a full list of environment variables related to configuring Tomcat in the Java buildpack, see Tomcat
Container Configuration.
geode-store Version
197
Tanzu GemFire on Cloud Foundry
The following table shows the corresponding Java buildpack and geode-store versions. Each version of
Tanzu Platform for Cloud Foundry comes with a Java buildpack, which includes the specified version of the
geode-store. Refer to the Tanzu Platform for Cloud Foundry release notes to determine which version of
the java-offline-buildpack is included with the release.
For compatibility, VMware recommends using Java buildpacks configured with a geode-store version that
aligns with the Tanzu GemFire on Cloud Foundry version you’re using. The latest Java buildpack version
comes with a geode-store version of 1.14.9, as shown in the following table.
If you’re using Tanzu GemFire on Cloud Foundry version 2.0 or above, it’s advisable to create a custom
buildpack using the instructions provided in the following section to ensure compatibility and optimal
performance.
4.61.1-4.7.0 1.14.9
4.57-4.61.0 1.13.7
4.48.1-4.56 1.12.5
4.46-4.48.0 1.12.4
4.44-4.45 1.13.4
4.37-4.43 1.11.0
4.36 1.13.0
4.30-4.35 0.0.2
If you use the java_offline_buildpack, you cannot change the geode_store value by using environment
variables. You must either use an online version of the Java Buildpack alongside the environment variable
or create a custom buildpack that specifies the version as described in Create a Custom Buildpack.
There are three ways to specify and use a different buildpack or geode-store:
Option 1: Replace the VMware Tanzu Platform for Cloud Foundry environment’s Java buildpack:
2. Delete the current Tanzu Platform for Cloud Foundry environment’s offline Java buildpack:
cf delete-buildpack java_buildpack_offline
3. Log in to the Broadcom Customer Support Portal with your customer credentials. For more
information about login requirements, see the Download Broadcom products and software
198
Tanzu GemFire on Cloud Foundry
article.
5. At the top you should see My Downloads - Tanzu. If you do not see this, make sure you
have selected Tanzu in the drop-down menu to the left of your username.
6. On the My Downloads - Tanzu page, search for Java Buildpack. Make sure to select Java
Buildpack and NOT the Java Buildpack for VMware Tanzu.
7. Click on Java Buildpack in the table to show the available versions, and select the version
needed for your project.
8. Click I agree to Terms and Conditions. Click the HTTPS Download icon next to the Java
Buildpack (offline) to download.
9. Upload the replacement Java buildpack (offline) to your Tanzu Platform for Cloud Foundry
environment. This following example specifies a version 4.70 buildpack:
Option 2: Specify BOTH a geode_store version environment variable and an online buildpack for
your application.
Choose one of the following two ways to set the geode_store version environment variable.
Set the geode_store version environment variable in your application’s manifest.yml file.
For example:
env:
JBP_CONFIG_TOMCAT: '{ geode_store: { version: 2.1.0 } }'
For details about specifying configuration values with an environment variable in the Java
Buildpack, see Configuration and Extension in the Cloud Foundry Java Buildpack
repository in GitHub.
You can find the buildpack’s geode_store version in the buildpacks /config directory:
/config/tomcat.yml file.
Or you can set the geode_store version environment variable with the cf set-env
command. For more information about this command, see set-env in the Cloud Foundry
CLI Reference Guide.
buildpacks:
- https://github.com/cloudfoundry/java-buildpack.git#v4.70
Option 3: Create a custom buildpack that specifies the version as described in Create a Custom
Buildpack.
199
Tanzu GemFire on Cloud Foundry
If you are not using an external repository for configuration, Create a Custom Buildpack to deactivate near
caching.
$ cd java-buildpack
3. Check out the desired version or release of the java-buildpack repository on a local branch. Use
v4.70 or the most recent version available.
4. To change the version of Tanzu GemFire on Cloud Foundry used by the buildpack, edit the
/config/tomcat.yml configuration file to specify the geode_store. Here is the portion of the file to
be changed, with the string to change in bold:
geode_store:
version: 2.1.0
repository_root: https://java-buildpack-tomcat-gemfire-store.s3-us-west-2.ama
zonaws.com
For Tanzu GemFire on Cloud Foundry version 1.11 - 2.1.0 and greater, set the geode_store version
to match your Tanzu GemFire on Cloud Foundry minor version.
For all previous versions of Tanzu GemFire on Cloud Foundry, set the geode_store version to
0.0.2.
5. If you changed the version of Tanzu GemFire on Cloud Foundry used by the buildpack, you may
also need to change the version of the Geode Session State Module used by the buildpack.
SESSION_MANAGER_CLASS_NAME = 'org.apache.geode.modules.session.catalina.Tomcat9
DeltaSessionManager'
200
Tanzu GemFire on Cloud Foundry
For geode_store versions earlier than 1.11, including version 0.0.2, use
Tomcat8DeltaSessionManager.
6. To deactivate near caching within the custom buildpack, edit the java-buildpack repository file
lib/java_buildpack/container/tomcat/tomcat_geode_store.rb to deactivate caching within
the app. Change the string true to false.
Before the change, here is the portion of the file to be modified, with the string to change
highlighted:
def add_manager(context)
context.add_element 'Manager',
'className' => SESSION_MANAGER_CLASS_NAME,
'enableLocalCache' => 'true',
'regionAttributesId' => REGION_ATTRIBUTES_ID
end
After changing the highlighted string from true to false, here is the updated portion of the file:
def add_manager(context)
context.add_element 'Manager',
'className' => SESSION_MANAGER_CLASS_NAME,
'enableLocalCache' => 'false',
'regionAttributesId' => REGION_ATTRIBUTES_ID
end
8. Create your custom Java buildpack on the Tanzu Platform for Cloud Foundry with the following
command:
Where: * BUILDPACK-NAME is the name you choose for your buildpack. * PATH is the location of your
local Java buildpack directory. * POSITION is the order in which your buildpack will be selected.
9. After building your application, push it such that it uses your buildpack:
cf restage APP-NAME
201
Tanzu GemFire on Cloud Foundry
used across multiple applications. By using an external repository for configuration, you ensure consistency
and reduce the effort required to manage configurations for various apps.
$ mkdir tomcat-config
2. Create the necessary files and directories within the new directory:
$ cd tomcat-config
$ mkdir public
$ mkdir -p tomcat-1.0.0/conf
$ touch Staticfile
root: public
directory: visible
4. Create a tomcat-1.0.0/conf/context.xml file with the following content. This example specifies
Tomcat version 9 and deactivates near caching:
You can further customize Tomcat by placing additional configuration files within the tomcat-
1.0.0/conf directory.
5. Compress the tomcat-1.0.0 directory into a TAR file and move it to the public directory:
202
Tanzu GemFire on Cloud Foundry
$ cp tomcat-1.0.0.tar.gz public/
6. With a current working directory of tomcat-config, use cf push to place the configuration into the
VMware Tanzu Platform for Cloud Foundry space that will host the app:
$ cf push tomcat-config
$ cf apps
Prepend the listed URL with http:// to get the URL to identify the location of the configuration
needed by the app. For example, http://tomcat-config.apps.yellow-green.cf-app.com.
---
1.0.0: http://tomcat-config.apps.yellow-green.cf-app.com/tomcat-1.0.0.tar.gz
cf push tomcat-config
env:
JBP_CONFIG_TOMCAT: "{ tomcat: { external_configuration_enabled: true }, ext
ernal_configuration: { repository_root: "http://tomcat-config.apps.yellow-gree
n.cf-app.com" } }"
---
applications:
- name: http-session-caching
path: build/libs/http-session-caching-0.0.1.war
buildpack: java_buildpack_offline
env:
JBP_CONFIG_TOMCAT: "{ tomcat: { external_configuration_enabled: true }, ext
ernal_configuration: { repository_root: "http://tomcat-config.apps.yellow-gree
n.cf-app.com" } }"
203
Tanzu GemFire on Cloud Foundry
Replace BUILDPACK-NAME with the name of your custom buildpack or the URL of the most recent
Java buildpack version if you did not create a custom buildpack.
Note The specification of the buildpack on the cf push command line takes precedence over the
specification within the manifest.
cf start APP-NAME
cf ssh APP-NAME
cat app/.java-buildpack/tomcat/conf/context.xml
To use Spring Session for VMware Tanzu GemFire for session state caching for apps with Tanzu GemFire
on Cloud Foundry, follow these steps:
1. In the app, replace the existing Spring Session @EnableXXXHttpSession annotation with:
@EnableGemFireHttpSession(maxInactiveIntervalInSeconds = N)
2. Follow the instructions in Getting Startedin the Spring Session for VMware GemFire product
documentation to add the appropriate dependencies to your app.
4. On a command line, connected with a security role that can manage cluster data, use gfsh to
create a region on the cluster servers named ClusteredSpringSessions:
Do not enable Tomcat session state caching as described in Enable Session State Caching in Tomcat
Session State Caching. Mixing Tomcat session state caching with Spring Session caching can cause
issues.
For reference documentation, see the Spring Session for VMware GemFire product documentation.
204
Tanzu GemFire on Cloud Foundry
GemFire Vector DB is an innovative extension that leverages GemFire’s powerful in-memory data
capabilities to provide lightning-fast storage and retrieval of vector data, ideal for machine learning and AI
applications. For more information, see the VMware GemFire Vector Database Product Documentation.
Prerequisites
The following are prerequisites to use GemFire Vector DB with your Tanzu GemFire on Cloud Foundry
service instances.
GemFire Vector DB is supported only on VMs with 2 or more CPU cores. While creating plans,
operators must choose the vm_types accordingly.
A Tanzu GemFire on Cloud Foundry service instance. For more information, see Create or Delete a
Service Instance.
A service key for the Tanzu GemFire on Cloud Foundry service instance. For more information, see
Create a Service Key.
For example, for a service key named “test-c1-key.key” created on a service instance named “test-c1”, you
would run the following command:
1. Extract username and password from a role of “users” group. If the foundation has UAA configured,
users must use their assigned credentials, which will not appear in the service key output. For
example, you can use the username and password for the cluster_operator role to create the
Authorization header for GemFire Vector Database API:
{
"password": "EZSy2WVHpCOtZLjZuNpVUA",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_2I5YlL2zEF8zkHYNYCaMw"
}
To create the Authorization header by using the Base64 encoded HTTP Basic Authentication
mechanism, see the GemFire Vector DB documentation.
2. Copy the vectordb URL from the service key urls group. For example:
"urls": {
"gfsh": "https://cloudcache-7a081d54-823b-45dd-990d-a88088be5c05.sys.coil-146
4369.cf-app.com/gemfire/v1",
"management": "https://cloudcache-7a081d54-823b-45dd-990d-a88088be5c05.sys.co
il-1464369.cf-app.com/management/docs",
"pulse": "https://cloudcache-7a081d54-823b-45dd-990d-a88088be5c05.sys.coil-14
64369.cf-app.com/pulse",
"vectordb": "https://gemfire-server-25d504b6-549c-4126-92ba-a4b53cb9fd5f.sys.
205
Tanzu GemFire on Cloud Foundry
mute-1513053.cf-app.com/gemfire-vectordb/v1"
},
{
"credentials": {
"distributed_system_id": "0",
"gfsh_login_string": "connect --url=https://cloudcache-32f36132-5b92-4b97-a
458-75dc906c5931.sys.iris-1594600.za3fcc275.shep.cf-app.com/gemfire/v1 --user=c
luster_operator_VH3vTL6Ti2YYPDM39ksc9w --password=6VlLxuiM7WSPfuUjFJERPg --skip
-ssl-validation",
"locators": [
"0c129cd6-4598-4286-8404-385838251bdc.locator-server.iris-1594600-service
s-subnet.service-instance-32f36132-5b92-4b97-a458-75dc906c5931.bosh[55221]"
],
"remote_cluster_info": {
"recursors": {
"iris-1594600-services-subnet.service-instance-32f36132-5b92-4b97-a458-
75dc906c5931.bosh": [
"10.0.8.5:1053"
]
},
"remote_locators": [
"0c129cd6-4598-4286-8404-385838251bdc.locator-server.iris-1594600-servi
ces-subnet.service-instance-32f36132-5b92-4b97-a458-75dc906c5931.bosh[55221]"
],
"trusted_sender_credentials": [
{
"password": "4M3x9fngMR9FGEYuL0eFvA",
"username": "gateway_sender_Q8lpVoaBEsabf05rAlYYQA"
}
]
},
"tls-enabled": "false",
"urls": {
"gfsh": "https://cloudcache-32f36132-5b92-4b97-a458-75dc906c5931.sys.iris
-1594600.za3fcc275.shep.cf-app.com/gemfire/v1",
"management": "https://cloudcache-32f36132-5b92-4b97-a458-75dc906c5931.sy
s.iris-1594600.za3fcc275.shep.cf-app.com/management/docs",
"pulse": "https://cloudcache-32f36132-5b92-4b97-a458-75dc906c5931.sys.iri
s-1594600.za3fcc275.shep.cf-app.com/pulse",
"vectordb": "https://gemfire-server-32f36132-5b92-4b97-a458-75dc906c5931.
sys.iris-1594600.za3fcc275.shep.cf-app.com/gemfire-vectordb/v1"
},
"users": [
{
"password": "6VlLxuiM7WSPfuUjFJERPg",
"roles": [
"cluster_operator"
],
"username": "cluster_operator_VH3vTL6Ti2YYPDM39ksc9w"
},
{
"password": "VZdFe2c6AhuGgq367Uq1mw",
"roles": [
"developer"
206
Tanzu GemFire on Cloud Foundry
],
"username": "developer_Xjl574YVY5qsSrJ9sFTjHw"
},
{
"password": "ouZ2o7LoR4lvDLsibGmZg",
"roles": [
"readonly"
],
"username": "readonly_nJFdX1wSx6bfM3mMPWbuFg"
}
],
"wan": {}
}
}
1. Create Index:
Request:
Response:
2. Retrieve Index:
Request:
Response:
{
"name" : "test_index_1",
"fields" : [ ],
"beam-width" : 100,
"max-connections" : 16,
"vector-similarity-function" : "COSINE",
"buckets" : 4,
"number-of-embeddings" : 0
207
Tanzu GemFire on Cloud Foundry
}
HTTP Status Code: 200
208
Tanzu GemFire on Cloud Foundry
Troubleshooting
This topic describes issues and solutions related to using VMware Tanzu GemFire on Cloud Foundry.
Alternatively, use bosh ssh to access Tanzu GemFire on Cloud Foundry service instance server VMs and
directly obtain the Tanzu GemFire logs that reside within the directory /var/vcap/sys/log/gemfire-
server.
See Visual Statistics Display (VSD) for information about loading the statistics files into VSD.
Acquire the Deployment Name instructs how to acquire the string to substitute for DEPLOYMENT.
2. Use the VM in a bosh ssh command to ssh in to the Tanzu GemFire on Cloud Foundry VM where
you want to produce the thread dumps. Tanzu GemFire on Cloud Foundry VMs can be referenced
using a 0-based index, for example server/0, or locator/2:
209
Tanzu GemFire on Cloud Foundry
4. Find the process ID (PID) that is running the Tanzu GemFire Java process by running
5. As you take multiple thread dumps, redirect the output of each to a uniquely named file. This
example uses the file name threaddump1.txt:
mv /var/vcap/data/gemfire-server/tmp/threaddump1.txt /tmp/
Or:
mv /var/vcap/data/gemfire-locator/tmp/threaddump1.txt /tmp/
7. Files can be copied to your local machine using bosh scp command. From your local machine,
run:
For example:
1. Use the Cloud Foundry CLI. Target the space where the service instance runs.
2. Discover the globally unique identifier (GUID) for the service instance:
210
Tanzu GemFire on Cloud Foundry
3. Prefix the GUID with the string service-instance_ to obtain the DEPLOYMENT name. For the
example GUID, the DEPLOYMENT name is service-instance_1fd2850e-b754-4c5e-aa5c-
ddb54ee301e6.
Cause of the Problem: The smoke tests could not create an instance of Tanzu GemFire.
Action: To troubleshoot why the deployment failed, use the CF CLI to create a new service
instance using the same plan and download the logs of the service deployment from BOSH.
Cause of the Problem: The smoke test attempted to clean up a service instance it created and
failed to delete the service using the cf delete-service command.
Action: Run BOSH logs to view the logs on the broker or the service instance to see why the
deletion may have failed.
Cause of the Problem: The smoke test was unable to connect to the cluster.
Action: Review the logs of your load balancer, and review the logs of your CF Router to ensure the
route to your Tanzu GemFire on Cloud Foundry cluster is properly registered.
You also can create a service instance and try to connect to it using the gfsh CLI. This requires
creating a service key.
Cause of the Problem: LOCATOR-ADDRESS is the BOSH DNS name of the locator. The smoke test
was unable to write data to the cluster. The user may not have permissions to create a region or
write data.
General Connectivity
Problem: Client-to-server communication
Cause of the Problem: Tanzu GemFire on Cloud Foundry clients communicate to Tanzu GemFire
on Cloud Foundry servers on port 40404 and with locators on port 55221. Both of these ports must
be reachable from the VMware Tanzu Platform for Cloud Foundry network to service the network.
Cause of the Problem: Tanzu GemFire on Cloud Foundry servers and locators communicate with
each other using UDP and TCP. The current port range for this communication is 49152-65535.
Solution: If you have a firewall between VMs, ensure this port range is open.
Cause of the Problem: Gateway receivers and gateway senders communicate across WAN-
separated service instances. Each Tanzu GemFire on Cloud Foundry service instance uses Tanzu
211
Tanzu GemFire on Cloud Foundry
GemFire defaults for the gateway receiver ports. The default is the inclusive range of port numbers
5000 to 5499.
Solution: Ensure this port range is open when WAN-separated service instances will
communicate.
org.apache.geode.cache.persistence.ConflictingPersistentDataException
at org.apache.geode.internal.cache.persistence.PersistenceAdvisorImpl.checkMy
StateOnMembers(PersistenceAdvisorImpl.java:743)
at org.apache.geode.internal.cache.persistence.PersistenceAdvisorImpl.getInit
ialImageAdvice(PersistenceAdvisorImpl.java:819)
at org.apache.geode.internal.cache.persistence.CreatePersistentRegionProcesso
r.getInitialImageAdvice(CreatePersistentRegionProcessor.java:52)
at org.apache.geode.internal.cache.DistributedRegion.getInitialImageAndRecove
ry(DistributedRegion.java:1178)
at org.apache.geode.internal.cache.DistributedRegion.initialize(DistributedRe
gion.java:1059)
at org.apache.geode.internal.cache.GemFireCacheImpl.createVMRegion(GemFireCac
heImpl.java:3089)
Cause of the Problem: The Tanzu GemFire on Cloud Foundry VMs are under-provisioned; the
quantity of disk space is too low.
Solution: Use Ops Manager to provision VMs of at least the minimum size. See Configure Service
Plans for minimum-size details.
212