Este contenido no está disponible en el idioma seleccionado.
Chapter 10. Connecting to Data Grid Clusters
Connect to Data Grid via the REST or Hot Rod endpoints. You can then remotely create and modify cache definitions and store data across Data Grid clusters.
The examples in this section use $SERVICE_HOSTNAME to denote the service that provides access to your Data Grid cluster.
Clients running in OpenShift can specify the name of the internal service that Data Grid Operator creates.
Clients running outside OpenShift should specify hostnames according to the type of external service and provider. For example, if using a load balancer service on AWS, the service hostname could be:
.status.loadBalancer.ingress[0].hostname
On GCP or Azure, hostnames might be as follows:
.status.loadBalancer.ingress[0].ip
10.1. Invoking the Data Grid REST API Copiar enlaceEnlace copiado en el portapapeles!
You can invoke the Data Grid REST API with any appropriate HTTP client.
For convenience, the following examples show how to invoke the REST API with curl using unencrypted connections. It is beyond the scope of this document to describe how to configure HTTP clients to use encryption.
Procedure
Open a remote shell to a Data Grid node, for example:
oc rsh example-rhdatagrid
$ oc rsh example-rhdatagridCopy to Clipboard Copied! Toggle word wrap Toggle overflow Cache service provides a default cache instance, but Data Grid service does not. Before you can store data with Data Grid service clusters, you must create a cache as in the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Put an entry in the cache.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the entry.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.2. Configuring Hot Rod Clients Copiar enlaceEnlace copiado en el portapapeles!
Configure Hot Rod Java clients to connect to Data Grid clusters.
Hot Rod client ConfigurationBuilder
Hot Rod client properties