zeebe 0.20.0 集群部署试用
zeebe 0.20.0 是生产可用的第一个版本,同时也有好多变动,以下是一个简单集群的运行以及一个简单
的运行说明
环境准备
- docker-compose 文件
version: "3"
services:
db:
image: 1000kit/h2
container_name: zeebe_db
ports:
- "1521:1521"
- "8181:8181"
monitor:
image: camunda/zeebe-simple-monitor
environment:
- spring.datasource.url=jdbc:h2:tcp://db:1521/zeebe-monitor;DB_CLOSE_DELAY=-1
- io.zeebe.monitor.connectionString=broker-1:26500
- spring.datasource.user=sa
- spring.datasource.password=
- spring.jpa.hibernate.ddl-auto=create
- io.zeebe.monitor.hazelcast.connection=broker-1:5701
ports:
- "8080:8080"
broker-1:
image: camunda/zeebe:${ZEEBE_VERSION:-latest}
ports:
- 26500:26500
- 26501:26501
- 5701:5701
environment:
- ZEEBE_LOG_LEVEL=${ZEEBE_LOG_LEVEL:-debug}
- ZEEBE_NODE_ID=0
- ZEEBE_PARTITIONS_COUNT=3
- ZEEBE_CLUSTER_SIZE=3
- ZEEBE_REPLICATION_FACTOR=3
volumes:
- ./zeebe-hazelcast-exporter-0.5.0.jar:/usr/local/zeebe/lib/zeebe-hazelcast-exporter.jar
- ./broker_1:/usr/local/zeebe/data
- ./zeebe.cfg.toml:/usr/local/zeebe/conf/zeebe.cfg.toml
broker-2:
image: camunda/zeebe:${ZEEBE_VERSION:-latest}
ports:
- 26510:26500
environment:
- ZEEBE_LOG_LEVEL=${ZEEBE_LOG_LEVEL:-debug}
- ZEEBE_NODE_ID=1
- ZEEBE_PARTITIONS_COUNT=3
- ZEEBE_CLUSTER_SIZE=3
- ZEEBE_REPLICATION_FACTOR=3
- ZEEBE_CONTACT_POINTS=broker-1:26502
volumes:
- ./broker_2:/usr/local/zeebe/data
broker-3:
image: camunda/zeebe:${ZEEBE_VERSION:-latest}
ports:
- 26520:26500
environment:
- ZEEBE_LOG_LEVEL=${ZEEBE_LOG_LEVEL:-debug}
- ZEEBE_NODE_ID=2
- ZEEBE_PARTITIONS_COUNT=3
- ZEEBE_CLUSTER_SIZE=3
- ZEEBE_REPLICATION_FACTOR=3
- ZEEBE_CONTACT_POINTS=broker-1:26502
volumes:
- ./broker_3:/usr/local/zeebe/data
- docker 镜像版本
镜像版本的使用,通过环境变量文件.env
,内容如下:
ZEEBE_VERSION=0.20.0
- broker exporter 配置
zeebe.cfg.toml 文件
[[exporters]]
id = "hazelcast"
className = "io.zeebe.hazelcast.exporter.HazelcastExporter"
[exporters.args]
# comma separated list of io.zeebe.protocol.record.ValueType
enabledValueTypes = "JOB,WORKFLOW_INSTANCE,DEPLOYMENT,INCIDENT"
port = 5701
# If true, the exporter update its position after publish the record to Hazelcast.
# Otherwise, it never update its position. On broker start, it will always start from the begin of the log.
# CAUTION! The broker can't delete data and may run out of disk space if set to false.
updatePosition = false
同时需要注意HazelcastExporter 的版本zeebe-hazelcast-exporter-0.5.0.jar
- simple-monitor
simple-monitor 是一个简单的UI 操作界面,通过与zeebe gateway 以及HazelcastExporter 通信获取信息
配置通过环境变量
environment:
- spring.datasource.url=jdbc:h2:tcp://db:1521/zeebe-monitor;DB_CLOSE_DELAY=-1
- io.zeebe.monitor.connectionString=broker-1:26500
- spring.datasource.user=sa
- spring.datasource.password=
- spring.jpa.hibernate.ddl-auto=create
- io.zeebe.monitor.hazelcast.connection=broker-1:5701
运行&&测试
- 一个简单的bpmn
可以参考
https://github.com/rongfengliang/zeebe-0.20.0-cluster-docker-compose/blob/master/flow.bpmn - 启动
docker-compose up -d
- 界面
说明
在运行之后,发现官方也提供可一个不错的docker-compose 运行说明,也是很值得参考的
参考资料
https://github.com/rongfengliang/zeebe-0.20.0-cluster-docker-compose
https://github.com/zeebe-io/zeebe-docker-compose