Este contenido no está disponible en el idioma seleccionado.

Chapter 2. Getting Started with Data Grid Operator


Data Grid Operator lets you create, configure, and manage Data Grid clusters.

Prerequisites

  • Create a Data Grid Operator subscription.
  • Have an oc client.

2.1. Infinispan Custom Resource (CR)

Data Grid Operator adds a new Custom Resource (CR) of type Infinispan that lets you handle Data Grid clusters as complex units on OpenShift.

You configure Data Grid clusters running on OpenShift by modifying the Infinispan CR.

The minimal Infinispan CR for Data Grid clusters is as follows:

apiVersion: infinispan.org/v1
kind: Infinispan
metadata:
  name: 
1

spec:
  replicas: 
2
Copy to Clipboard Toggle word wrap
1
Names the Data Grid cluster.
2
Sets the number of nodes in the Data Grid cluster.

2.2. Creating Data Grid Clusters

Use Data Grid Operator to create clusters of two or more Data Grid nodes.

Procedure

  1. Specify the number of Data Grid nodes in the cluster with spec.replicas in your Infinispan CR.

    For example, create a cr_minimal.yaml file as follows:

    $ cat > cr_minimal.yaml<<EOF
    apiVersion: infinispan.org/v1
    kind: Infinispan
    metadata:
      name: example-rhdatagrid
    spec:
      replicas: 2
    EOF
    Copy to Clipboard Toggle word wrap
  2. Apply your Infinispan CR.

    $ oc apply -f cr_minimal.yaml
    Copy to Clipboard Toggle word wrap
  3. Watch Data Grid Operator create the Data Grid nodes.

    $ oc get pods -w
    
    NAME                        READY  STATUS              RESTARTS   AGE
    example-rhdatagrid-1        0/1    ContainerCreating   0          4s
    example-rhdatagrid-2        0/1    ContainerCreating   0          4s
    example-rhdatagrid-3        0/1    ContainerCreating   0          5s
    infinispan-operator-0       1/1    Running             0          3m
    example-rhdatagrid-3        1/1    Running             0          8s
    example-rhdatagrid-2        1/1    Running             0          8s
    example-rhdatagrid-1        1/1    Running             0          8s
    Copy to Clipboard Toggle word wrap

Next Steps

Try changing the value of replicas: and watching Data Grid Operator scale the cluster up or down.

2.3. Verifying Data Grid Clusters

Review log messages to ensure that Data Grid nodes receive clustered views.

Procedure

  • Do either of the following:

    • Retrieve the cluster view from logs.

      $ oc logs example-rhdatagrid-0 | grep ISPN000094
      
      INFO  [org.infinispan.CLUSTER] (MSC service thread 1-2) \
      ISPN000094: Received new cluster view for channel infinispan: \
      [example-rhdatagrid-0|0] (1) [example-rhdatagrid-0]
      
      INFO  [org.infinispan.CLUSTER] (jgroups-3,{example_crd_name-0) \
      ISPN000094: Received new cluster view for channel infinispan: \
      [example-rhdatagrid-0|1] (2) [example-rhdatagrid-0, example-rhdatagrid-1]
      Copy to Clipboard Toggle word wrap
    • Retrieve the Infinispan CR for Data Grid Operator.

      $ oc get infinispan -o yaml
      Copy to Clipboard Toggle word wrap

      The response indicates that Data Grid pods have received clustered views:

      conditions:
          - message: 'View: [example-rhdatagrid-0, example-rhdatagrid-1]'
            status: "True"
            type: wellFormed
      Copy to Clipboard Toggle word wrap
Tip

Use oc wait with the wellFormed condition for automated scripts.

$ oc wait --for condition=wellFormed --timeout=240s infinispan/example-rhdatagrid
Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat