Data Grid 提供了一个可扩展的数据层,可让您智能、高效地使用可用的计算资源。为了通过数据网格服务器部署实现此目的,配置被分为两个层: dynamic 和 static。
动态配置
动态配置是可变的,在运行时更改,在创建缓存时,向集群添加和删除节点。
部署 Data Grid Server 集群后,您可以通过 Data Grid CLI、Data Grid Console 或 Hot Rod 和 REST 端点创建缓存。Data Grid Server 将这些缓存永久存储为跨节点分布的集群状态的一部分。每个加入节点都会收到在发生更改时,Data Grid Server 会在所有节点间自动同步的完整集群状态。
<!-- Creates a cache manager named "default" that exports statistics. -->
<cache-container name="default"
statistics="true">
<!-- Defines cluster transport properties, including the cluster name. -->
<!-- Uses the default TCP stack for inter-cluster communication. -->
<transport cluster="${infinispan.cluster.name}"
stack="${infinispan.cluster.stack:tcp}"
node-name="${infinispan.node.name:}"/>
</cache-container>
<!-- Creates a cache manager named "default" that exports statistics. -->
<cache-container name="default"
statistics="true">
<!-- Defines cluster transport properties, including the cluster name. -->
<!-- Uses the default TCP stack for inter-cluster communication. -->
<transport cluster="${infinispan.cluster.name}"
stack="${infinispan.cluster.stack:tcp}"
node-name="${infinispan.node.name:}"/>
</cache-container>
Copy to ClipboardCopied!Toggle word wrapToggle overflow
cache-container 元素也可以包含以下配置元素:
缓存管理器 的安全性。
MicroProfile 兼容指标的指标。
JMX 用于 JMX 监控和管理.
重要
在以前的版本中,您可以在 Data Grid 配置中定义多个 cache-container 元素,以便在不同的端点上公开缓存容器。
在 Data Grid 8 中,不得配置多个缓存容器,因为 Data Grid CLI 和 Console 只能处理每个集群的一个缓存管理器。但是,如果需要,您可以将缓存容器的名称更改为比"default"更有意义的环境。