Este contenido no está disponible en el idioma seleccionado.
Chapter 3. Creating Data Grid Services
Data Grid services are stateful applications that provide flexible and robust in-memory data storage.
3.1. Cache Service Copiar enlaceEnlace copiado en el portapapeles!
Cache service provides a volatile, low-latency data store that dramatically increases application response rates.
Cache service nodes:
- Synchronously distribute data across the cluster to ensure consistency.
- Maintain single copies of cache entries to reduce size.
- Store cache entries off-heap and use eviction for JVM efficiency.
- Ensure data consistency with a default partition handling configuration.
You can create multiple cache definitions with Cache service but only as copies of the default configuration.
If you update Cache service nodes with the Infinispan CR or update the version, you lose all data in the cache.
3.1.1. Cache Configuration Copiar enlaceEnlace copiado en el portapapeles!
Cache service nodes use the following cache configuration:
- 1
- Names the cache instance as "default".
- 2
- Uses synchronous distribution for storing data across the cluster.
- 3
- Configures one replica for each cache entry across the cluster.
- 4
- Stores cache entries as bytes in native memory (off-heap).
- 5
- Removes old entries to make space when adding new entries.
- 6
- Specifies a conflict resolution strategy that allows read and write operations for cache entries even if segment owners are in different partitions.
- 7
- Specifies a merge policy that removes entries from the cache when Data Grid detects conflicts.
3.2. Data Grid Service Copiar enlaceEnlace copiado en el portapapeles!
Data Grid service provides a configurable Data Grid server distribution for OpenShift.
- Use with advanced capabilities like cross-site replication as well as indexing and querying.
Remotely access Data Grid service clusters from Hot Rod or REST clients and dynamically create caches using any Data Grid cache mode and configuration.
NoteData Grid does not provide default caches for Data Grid service nodes. However, you can use cache configuration templates to get started.
3.3. Creating Data Grid Services Copiar enlaceEnlace copiado en el portapapeles!
Define the .spec.service.type resource to create Cache service and Data Grid service nodes with Data Grid Operator.
By default, Data Grid Operator creates Data Grid clusters configured as a Cache service.
Procedure
-
Specify the service type for Data Grid clusters with
spec.service.typein your Infinispan CR and then apply the changes.
For example, create Data Grid service clusters as follows:
spec:
...
service:
type: DataGrid
spec:
...
service:
type: DataGrid
You cannot change .spec.service.type after you create Data Grid clusters.
For example, if you create a cluster of Cache service nodes, you cannot change the service type to Data Grid service. In this case you must create a new cluster with Data Grid service nodes in a different OpenShift namespace.
3.3.1. Cache Service Resources Copiar enlaceEnlace copiado en el portapapeles!
- 1
- Names the Data Grid cluster.
- 2
- Specifies the number of nodes in the cluster.
- 3
- Creates Cache service clusters.
- 4
- Adds an authentication secret with user credentials.
- 5
- Adds a custom encryption secret for secure connections.
- 6
- Allocates resources to nodes.
- 7
- Configures logging.
- 8
- Configures services for external traffic.
3.3.2. Data Grid Service Resources Copiar enlaceEnlace copiado en el portapapeles!
- 1
- Names the Data Grid cluster.
- 2
- Specifies the number of nodes in the cluster.
- 3
- Creates Data Grid service clusters.
- 4
- Configures size of the persistent volume.
- 5
- Provides connection information for backup locations.
- 6
- Adds an authentication secret with user credentials.
- 7
- Adds a custom encryption secret for secure connections.
- 8
- Allocates resources to nodes.
- 9
- Configures logging.
- 10
- Configures services for external traffic.