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.

元数据字段规范

字段 必填 详情 示例
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

相关链接