此内容没有您所选择的语言版本。

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
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部