Este conteúdo não está disponível no idioma selecionado.
Chapter 6. Connecting to Data Grid clusters
After you configure and deploy Data Grid clusters you can establish remote connections through the Data Grid Console, command line interface (CLI), Hot Rod client, or REST API.
6.1. Accessing Data Grid Console Copiar o linkLink copiado para a área de transferência!
Access the console to create caches, perform adminstrative operations, and monitor your Data Grid clusters.
Prerequisites
- Expose your Data Grid cluster on the network.
- Retrieve network service details.
Procedure
Access Data Grid Console from any browser at
$SERVICE_HOSTNAME:$PORT.Replace
$SERVICE_HOSTNAME:$PORTwith the hostname and port where Data Grid is available on the network.
6.2. Connecting with the command line interface (CLI) Copiar o linkLink copiado para a área de transferência!
Use the Data Grid CLI to connect to clusters and create caches, manipulate data, and perform administrative operations.
Prerequisites
- Expose your Data Grid cluster on the network.
- Retrieve network service details.
- Download the native Data Grid CLI distribution from the Data Grid software downloads.
-
Extract the
.ziparchive for the native Data Grid CLI distribution to your host filesystem.
Procedure
Start the Data Grid CLI with the network service as the value for the
-cargument, for example:{native_cli} -c http://cluster-name-myroute.hostname.net/$ {native_cli} -c http://cluster-name-myroute.hostname.net/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enter your Data Grid credentials when prompted.
Perform CLI operations as required.
TipPress the tab key or use the
--helpargument to view available options and help text.-
Use the
quitcommand to exit the CLI.
6.3. Connecting Hot Rod clients running on OpenShift Copiar o linkLink copiado para a área de transferência!
Access remote caches with Hot Rod clients running on the same OpenShift cluster as your Data Grid cluster.
Prerequisites
- Retrieve network service details.
Procedure
Specify the internal network service detail for your Data Grid cluster in the client configuration.
In the following configuration examples,
$SERVICE_HOSTNAME:$PORTdenotes the hostname and port that allows access to your Data Grid cluster.- Specify your credentials so the client can authenticate with Data Grid.
Configure client intelligence, if required.
Hot Rod clients running on OpenShift can use any client intelligence because they can access internal IP addresses for Data Grid pods.
The default intelligence,HASH_DISTRIBUTION_AWARE, is recommended because it allows clients to route requests to primary owners, which improves performance.
Programmatic configuration
Hot Rod client properties
6.3.1. Obtaining IP addresses for all Data Grid pods Copiar o linkLink copiado para a área de transferência!
You can retrieve a list of all IP addresses for running Data Grid pods.
Connecting Hot Rod clients running on OpenShift is the recommended approach as it ensures the initial connection to one of the available pods.
Procedure
Obtain all the IP addresses for a running Data Grid pods in the following ways:
Using the OpenShift API:
-
Access
${APISERVER}/api/v1/namespaces/<chart-namespace>/endpoints/<helm-release-name>to retrieve theendpointsOpenShift resource associated with the<helm-release-name>service.
-
Access
Using the OpenShift DNS service:
-
Query the DNS service for the name
<helm-release-name>-pingto obtain IPs for all the nodes in a cluster.
-
Query the DNS service for the name
6.4. Connecting Hot Rod clients running outside OpenShift Copiar o linkLink copiado para a área de transferência!
Access remote caches with Hot Rod clients running externally to the OpenShift cluster where you deploy your Data Grid cluster.
Prerequisites
- Expose your Data Grid cluster on the network.
- Retrieve network service details.
Procedure
Specify the internal network service detail for your Data Grid cluster in the client configuration.
In the following configuration examples,
$SERVICE_HOSTNAME:$PORTdenotes the hostname and port that allows access to your Data Grid cluster.- Specify your credentials so the client can authenticate with Data Grid.
-
Configure clients to use
BASICintelligence.
Programmatic configuration
Hot Rod client properties
6.5. Accessing the REST API Copiar o linkLink copiado para a área de transferência!
Data Grid provides a RESTful interface that you can interact with using HTTP clients.
Prerequisites
- Expose your Data Grid cluster on the network.
- Retrieve network service details.
Procedure
Access the REST API with any HTTP client at
$SERVICE_HOSTNAME:$PORT/rest/v2.Replace
$SERVICE_HOSTNAME:$PORTwith the hostname and port where Data Grid is available on the network.