Este conteúdo não está disponível no idioma selecionado.
Chapter 5. Configuring Data Grid clusters
Apply custom Data Grid configuration to clusters that Data Grid Operator manages.
5.1. Applying custom configuration to Data Grid clusters Copiar o linkLink copiado para a área de transferência!
Add Data Grid configuration to a ConfigMap
and make it available to Data Grid Operator. Data Grid Operator can then apply the custom configuration to your Data Grid cluster.
Data Grid Operator applies default configuration on top of your custom configuration to ensure it can continue to manage your Data Grid clusters.
Be careful when applying custom configuration outside the cache-container
element or field. You can apply custom configuration to underlying Data Grid Server mechanisms such as endpoints, security realms, and cluster transport. Changing this configuration can result in error and result in service downtime for your Data Grid deployment.
Use the Data Grid Helm chart to deploy clusters of fully configurable Data Grid Server instances on OpenShift.
Prerequisites
- Have valid Data Grid configuration in XML, YAML, or JSON format.
Procedure
Add Data Grid configuration to a
infinispan-config.[xml|yaml|json]
key in thedata
field of yourConfigMap
.XML
Copy to Clipboard Copied! Toggle word wrap Toggle overflow YAML
Copy to Clipboard Copied! Toggle word wrap Toggle overflow JSON
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
ConfigMap
from your YAML file.oc apply -f cluster-config.yaml
oc apply -f cluster-config.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the name of the
ConfigMap
with thespec.configMapName
field in yourInfinispan
CR and then apply the changes.spec: configMapName: "cluster-config"
spec: configMapName: "cluster-config"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Next steps
If your cluster is already running Data Grid Operator restarts it to apply the configuration. Each time you modify the Data Grid configuration in the ConfigMap
, Data Grid Operator detects the updates and restarts the cluster to apply the changes.
5.2. Custom Data Grid configuration Copiar o linkLink copiado para a área de transferência!
You can add Data Grid configuration to a ConfigMap
in XML, YAML, or JSON format.
5.2.1. Cache template Copiar o linkLink copiado para a área de transferência!
XML
YAML
JSON
5.2.2. Logging configuration Copiar o linkLink copiado para a área de transferência!
You can also include Apache Log4j configuration in XML format as part of your ConfigMap
.
Use the spec.logging.categories
field in your Infinispan
CR to adjust logging levels for Data Grid clusters. Add Apache Log4j configuration only if you require advanced file-based logging capabilities.
5.3. Securing custom Data Grid configuration Copiar o linkLink copiado para a área de transferência!
Securely define and store custom Data Grid Server configuration. To protect sensitive text strings such as passwords, add the entries in a credential store rather than directly in the Data Grid Server configuration.
Prerequisites
- Have a valid Data Grid configuration in XML, YAML, or JSON format.
Procedure
-
Create a
CredentialStore Secret
file. Use the
data
field to specify the credentials and its aliases.user-secret.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply your Secret file.
oc apply -f user-secret.yaml
oc apply -f user-secret.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open the
Infinispan
CR for editing. In the
spec.security.credentialStoreSecretName
field, specify the name of the credential store secret.Infinispan CR
spec: security: credentialStoreSecretName: user-secret
spec: security: credentialStoreSecretName: user-secret
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Apply the changes.
- Open your Data Grid Server configuration for editing.
Add a
credential-reference
to your configuration.-
Specify the
credentials
as the name of thestore
. Specify the
alias
attribute as one of the keys defined in your credential secret.Data Grid.xml
<credential-store> <credential-reference store="credentials" alias="postgres_cred"/> </credential-store>
<credential-store> <credential-reference store="credentials" alias="postgres_cred"/> </credential-store>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Specify the