Hazelcast

Detailed information on the Hazelcast state store component

创建 Dapr 组件

To setup Hazelcast state store create a component of type 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.

元数据字段规范

字段必填详情Example
hazelcastServersYA comma delimited string of servers"hazelcast:3000,hazelcast2:3000"
hazelcastMapYHazelcast Map configuration"foo-map"

Setup 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

相关链接