The documentation you are viewing is for Dapr v1.12 which is an older version of Dapr. For up-to-date documentation, see the latest version.
Hazelcast
Hazelcast 状态存储组件的详细信息
创建 Dapr 组件
要设置 Hazelcast 状态储存,请创建一个类型为 state.hazelcast
的组件。 请参阅本指南,了解如何创建和应用状态存储配置。
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
namespace: <NAMESPACE>
spec:
type: state.hazelcast
version: v1
metadata:
- name: hazelcastServers
value: <REPLACE-WITH-HOSTS> # Required. 逗号分隔的服务器地址 Example: "hazelcast:3000,hazelcast2:3000"
- name: hazelcastMap
value: <REPLACE-WITH-MAP> # Required. Hazelcast map configuration.
Warning
以上示例将密钥明文存储, 更推荐的方式是使用 Secret 组件, 这里。元数据字段规范
字段 | 必填 | 详情 | 示例 |
---|---|---|---|
hazelcastServers | Y | 逗号分隔的服务器地址 | "hazelcast:3000,hazelcast2:3000" |
hazelcastMap | Y | Hazelcast Map 配置 | "foo-map" |
设置 Hazelcast
你可以使用Docker在本地运行Hazelcast:
docker run -e JAVA_OPTS="-Dhazelcast.local.publicAddress=127.0.0.1:5701" -p 5701:5701 hazelcast/hazelcast
然后你可以通过127.0.0.1:5701
与服务器交互。
在Kubernetes上安装Hazelcast的最简单方法是使用Helm chart。
相关链接
- Dapr组件的基本格式
- 阅读 本指南 以获取配置状态存储组件的说明
- 状态管理构建块
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.