Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 3. Setting Up Data Grid Services
Use Data Grid Operator to create clusters of either Cache service or Data Grid service nodes.
3.1. Service Types Link kopierenLink in die Zwischenablage kopiert!
Services are stateful applications, based on the Data Grid server image, that provide flexible and robust in-memory data storage.
Cache service
Use Cache service if you want a volatile, low-latency data store with minimal configuration. Cache service nodes:
- Automatically scale to meet capacity when data storage demands go up or down.
- Synchronously distribute data to ensure consistency.
- Replicates each entry in the cache across the cluster.
- Store cache entries off-heap and use eviction for JVM efficiency.
- Ensure data consistency with a default partition handling configuration.
Because Cache service nodes are volatile you lose all data when you apply changes to the cluster with the Infinispan CR or update the Data Grid version.
Data Grid service
Use Data Grid service if you want to:
- Back up data across global clusters with cross-site replication.
- Create caches with any valid configuration.
- Add file-based cache stores to save data in the persistent volume.
- Use Data Grid search and other advanced capabilities.
3.2. Creating Cache service Nodes Link kopierenLink in die Zwischenablage kopiert!
By default, Data Grid Operator creates Data Grid clusters with Cache service nodes.
Procedure
Create an
InfinispanCR.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Creates nodes Cache service nodes. This is the default for the
InfinispanCR.
-
Apply your
InfinispanCR to create the cluster.
3.2.1. Configuring Automatic Scaling Link kopierenLink in die Zwischenablage kopiert!
If you create clusters with Cache service nodes, Data Grid Operator can automatically scale nodes up or down based on memory usage for the default cache.
Data Grid Operator monitors default caches on Cache service nodes. As you add data to the cache, memory usage increases. When it detects that the cluster needs additional capacity, Data Grid Operator creates new nodes rather than eviciting entries. Likewise, if it detects that memory usage is below a certain threshold, Data Grid Operator shuts down nodes.
Automatic scaling works with the default cache only. If you plan to add other caches to your cluster, you should not include the autoscale field in your Infinispan CR. In this case you should use eviction to control the size of the data container on each node.
Procedure
-
Add the
spec.autoscaleresource to yourInfinispanCR to enable automatic scaling. Configure memory usage thresholds and number of nodes for your cluster with the
autoscalefield.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Configures the maximum threshold, as a percentage, for memory usage on each node. When Data Grid Operator detects that any node in the cluster reaches the threshold, it creates a new node if possible. If Data Grid Operator cannot create a new node then it performs eviction when memory usage reaches 100 percent.
- 2
- Defines the maximum number of number of nodes for the cluster.
- 3
- Configures the minimum threshold, as a percentage, for memory usage across the cluster. When Data Grid Operator detects that memory usage falls below the minimum, it shuts down nodes.
- 4
- Defines the minimum number of number of nodes for the cluster.
- Apply the changes.
3.2.2. Configuring the Number of Owners Link kopierenLink in die Zwischenablage kopiert!
The number of owners controls how many copies of each cache entry are replicated across your Data Grid cluster. The default for Cache service nodes is two, which duplicates each entry to prevent data loss.
Procedure
Specify the number of owners with the
spec.service.replicationFactorresource in yourInfinispanCR as follows:spec: ... service: type: Cache replicationFactor: 3spec: ... service: type: Cache replicationFactor: 31 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Configures three replicas for each cache entry.
- Apply the changes.
3.2.3. Cache Service Resources Link kopierenLink in die Zwischenablage kopiert!
3.3. Creating Data Grid service Nodes Link kopierenLink in die Zwischenablage kopiert!
To use custom cache definitions along with Data Grid capabilities such as cross-site replication, create clusters of Data Grid service nodes.
Procedure
Specify
DataGridas the value forspec.service.typein yourInfinispanCR.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou cannot change the
spec.service.typefield after you create nodes. To change the service type, you must delete the existing nodes and create new ones.- Configure nodes with any other Data Grid service resources.
-
Apply your
InfinispanCR to create the cluster.
3.3.1. Data Grid service Resources Link kopierenLink in die Zwischenablage kopiert!
3.4. Adding Labels to Data Grid Resources Link kopierenLink in die Zwischenablage kopiert!
Attach key/value labels to pods and services that Data Grid Operator creates and manages. These labels help you identify relationships between objects to better organize and monitor Data Grid resources.
Red Hat subscription labels are automatically applied to Data Grid pods.
Procedure
-
Open your
InfinispanCR for editing. -
Add any labels that you want Data Grid Operator to attach to resources with
metadata.annotations. Add values for your labels with
metadata.labels.Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Apply your
InfinispanCR.