Zeebe入门系列:2、Zeebe运行环境搭建

本入门基于开源版的,将使用zeebe-simple-monitor管理台,可将zeebe-simple-monitor代码下载到本地,或者在虚拟机中,本文将在虚拟机中直接用docker-compose运行,其他方法请查看zeebe-simple-monitor的使用说明。

1、虚拟机创建

使用下面命令创建一个名为docker的基于ubuntu的docker就绪虚拟机,内存配置为4G、磁盘空间40G,使用的本机的网卡为WLAN,启动成功后进入终端,安装docker-compose。

C:\# multipass launch docker -n docker -m 4G -d 40G --network WLAN
launch failed: The following errors occurred:
timed out waiting for initialization to complete

C:\# multipass list
Name                    State             IPv4             Image
docker                  Running           192.168.1.105    Ubuntu 21.10

C:\# multipass shell docker
Welcome to Ubuntu 21.10 (GNU/Linux 5.13.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Jun 15 15:36:09 UTC 2022

  System load:  0.17              Processes:               113
  Usage of /:   3.6% of 38.60GB   Users logged in:         0
  Memory usage: 5%                IPv4 address for enp0s3: 10.0.2.15
  Swap usage:   0%                IPv4 address for enp0s8: 192.168.1.105


0 updates can be applied immediately.

New release '22.04 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@docker:~$ sudo apt install docker-compose

2、虚拟机配置

镜像源:可参考“使用grep&sed快速更换Ubuntu为国内镜像源”进行配置置

JDK17环境:可参考“Ubuntu 21.10下安装配置JDK17”进行配置

3、克隆zeebe-simple-monitor工程

git clone https://github.com/camunda-community-hub/zeebe-simple-monitor

 查看文件

ubuntu@docker:~$ ls
camunda-web-modeler-examples  zeebe-simple-monitor
ubuntu@docker:~$ cd ./zeebe-simple-monitor/
ubuntu@docker:~/zeebe-simple-monitor$ ls -la
total 80
drwxrwxr-x 7 ubuntu ubuntu  4096 Jun 30 22:07 .
drwxr-x--- 7 ubuntu ubuntu  4096 Jun 30 22:07 ..
drwxrwxr-x 8 ubuntu ubuntu  4096 Jun 30 22:07 .git
drwxrwxr-x 3 ubuntu ubuntu  4096 Jun 30 22:07 .github
-rw-rw-r-- 1 ubuntu ubuntu   444 Jun 30 22:07 .gitignore
-rw-rw-r-- 1 ubuntu ubuntu  3198 Jun 30 22:07 CODE_OF_CONDUCT.md
-rw-rw-r-- 1 ubuntu ubuntu  3444 Jun 30 22:07 CONTRIBUTING.md
-rw-rw-r-- 1 ubuntu ubuntu 11357 Jun 30 22:07 LICENSE
-rw-rw-r-- 1 ubuntu ubuntu  5852 Jun 30 22:07 README.md
-rw-rw-r-- 1 ubuntu ubuntu  3181 Jun 30 22:07 UPGRADE.md
drwxrwxr-x 2 ubuntu ubuntu  4096 Jun 30 22:07 docker
drwxrwxr-x 2 ubuntu ubuntu  4096 Jun 30 22:07 docs
-rw-rw-r-- 1 ubuntu ubuntu 13436 Jun 30 22:07 pom.xml
drwxrwxr-x 4 ubuntu ubuntu  4096 Jun 30 22:07 src
ubuntu@docker:~/zeebe-simple-monitor$ ls -la ./docker/
total 16
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 30 22:07 .
drwxrwxr-x 7 ubuntu ubuntu 4096 Jun 30 22:07 ..
-rw-rw-r-- 1 ubuntu ubuntu  170 Jun 30 22:07 application.yaml
-rw-rw-r-- 1 ubuntu ubuntu 1913 Jun 30 22:07 docker-compose.yml
ubuntu@docker:~/zeebe-simple-monitor$ 

使用mvn编译,需要一定时间,

ubuntu@docker:~/zeebe-simple-monitor$ ls
CODE_OF_CONDUCT.md  CONTRIBUTING.md  LICENSE  README.md  UPGRADE.md  docker  docs  pom.xml  src
ubuntu@docker:~/zeebe-simple-monitor$ mvn clean -install -DskipTests
Command 'mvn' not found, but can be installed with:
sudo apt install maven
ubuntu@docker:~/zeebe-simple-monitor$ sudo apt install maven
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:

4、使用docker-compose启动

cd docker
docker-compose --profile in-memory up

也可以使用PostgreSQL来启动,若使用Mysql,则需修改pom.xml增加mysql的驱动,重新编译,并修改docker-compose.yml文件

docker-compose --profile postgres up

注意:若使用--profile遇到问题,可以复制docker-compose.yml后指定文件单独启动,如下所示:

ubuntu@docker:~/zeebe-simple-monitor/docker$ cp docker-compose.yml  docker-compose-mem.yml
ubuntu@docker:~/zeebe-simple-monitor/docker$ cat docker-compose-mem.yml
version: "3"

networks:
  zeebe_network:
    driver: bridge

services:
  zeebe:
    container_name: zeebe_broker
    image: camunda/zeebe:1.3.4
    environment:
      - ZEEBE_LOG_LEVEL=debug
    ports:
      - "26500:26500"
      - "9600:9600"
      - "5701:5701"
    volumes:
      - ../target/exporter/zeebe-hazelcast-exporter.jar:/usr/local/zeebe/exporters/zeebe-hazelcast-exporter.jar
      - ./application.yaml:/usr/local/zeebe/config/application.yaml
    networks:
      - zeebe_network

  simple-monitor-in-memory:
    container_name: zeebe-simple-monitor-in-memory
    image: ghcr.io/camunda-community-hub/zeebe-simple-monitor:2.3.0
    environment:
      - zeebe.client.broker.gateway-address=zeebe:26500
      - zeebe.client.worker.hazelcast.connection=zeebe:5701
    ports:
      - "8082:8082"
    depends_on:
      - zeebe
    networks:
      - zeebe_network

 5、指定yml配置文件启动

ubuntu@docker:~/zeebe-simple-monitor/docker$ sudo COMPOSE_PROFILES=in-memory docker-compose up

 注意:在本文写作时,使用上面命令启动遇到不成功,通过升级系统版本后启动正常

C:\# multipass shell docker
Welcome to Ubuntu 21.10 (GNU/Linux 5.13.0-52-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri Jul  1 22:27:06 CST 2022

  System load:                      0.16
  Usage of /:                       14.9% of 39.76GB
  Memory usage:                     5%
  Swap usage:                       0%
  Processes:                        115
  Users logged in:                  0
  IPv4 address for br-934237a14c4a: 172.18.0.1
  IPv4 address for docker0:         172.17.0.1
  IPv4 address for enp0s3:          10.0.2.15
  IPv4 address for enp0s8:          192.168.1.103


0 updates can be applied immediately.

New release '22.04 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Fri Jul  1 22:12:09 2022 from 10.0.2.2
ubuntu@docker:~$ do-release-upgrade
Checking for a new Ubuntu release

= Welcome to Ubuntu 22.04 'Jammy Jellyfish' =

The Ubuntu team is proud to announce Ubuntu 22.04 'Jammy Jellyfish'.

启动成功信息如下

ubuntu@docker:~/zeebe-simple-monitor/docker$ sudo COMPOSE_PROFILES=in-memory docker-compose up
Starting zeebe_broker ... done
Starting zeebe-simple-monitor-in-memory ... done
Attaching to zeebe_broker, zeebe-simple-monitor-in-memory
zeebe_broker                | ++ hostname -i
zeebe_broker                | + HOST=172.18.0.2
zeebe_broker                | + '[' false = true ']'
zeebe_broker                | + export ZEEBE_BROKER_NETWORK_HOST=172.18.0.2
zeebe_broker                | + ZEEBE_BROKER_NETWORK_HOST=172.18.0.2
zeebe_broker                | + export ZEEBE_BROKER_GATEWAY_CLUSTER_HOST=172.18.0.2
zeebe_broker                | + ZEEBE_BROKER_GATEWAY_CLUSTER_HOST=172.18.0.2
zeebe_broker                | + exec /usr/local/zeebe/bin/broker
zeebe_broker                | OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=deny; support was removed in 17.0
zeebe-simple-monitor-in-memory | 14:57:24.424 [Thread-0] DEBUG org.springframework.boot.devtools.restart.classloader.RestartClassLoader - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@7eccd722
zeebe_broker                |   ______  ______   ______   ____    ______     ____    _____     ____    _  __  ______   _____  
zeebe_broker                |  |___  / |  ____| |  ____| |  _ \  |  ____|   |  _ \  |  __ \   / __ \  | |/ / |  ____| |  __ \
zeebe_broker                |     / /  | |__    | |__    | |_) | | |__      | |_) | | |__) | | |  | | | ' /  | |__    | |__) |
zeebe_broker                |    / /   |  __|   |  __|   |  _ <  |  __|     |  _ <  |  _  /  | |  | | |  <   |  __|   |  _  /
zeebe_broker                |   / /__  | |____  | |____  | |_) | | |____    | |_) | | | \ \  | |__| | | . \  | |____  | | \ \
zeebe_broker                |  /_____| |______| |______| |____/  |______|   |____/  |_|  \_\  \____/  |_|\_\ |______| |_|  \_\
zeebe_broker                |
zeebe_broker                | 2022-07-01 14:57:25.128 [] [main] INFO 
zeebe_broker                |       io.camunda.zeebe.broker.StandaloneBroker - Starting StandaloneBroker v1.3.4 using Java 17.0.2 on e113ea20696d with PID 8 (/usr/local/zeebe/lib/camunda-cloud-zeebe-1.3.4.jar started by root in /usr/local/zeebe)
zeebe_broker                | 2022-07-01 14:57:25.140 [] [main] DEBUG
zeebe_broker                |       io.camunda.zeebe.broker.StandaloneBroker - Running with Spring Boot v2.6.1, Spring v5.3.14
zeebe_broker                | 2022-07-01 14:57:25.143 [] [main] INFO
zeebe_broker                |       io.camunda.zeebe.broker.StandaloneBroker - The following profiles are active: broker
zeebe-simple-monitor-in-memory | 
zeebe-simple-monitor-in-memory | ___                 __
zeebe-simple-monitor-in-memory |  _/  _  _ |_   _   (_  .  _   _  |  _   |\/|  _   _  . |_  _   _
zeebe-simple-monitor-in-memory | /__ (- (- |_) (-   __) | ||| |_) | (-   |  | (_) | ) | |_ (_) |
zeebe-simple-monitor-in-memory |                              |
zeebe-simple-monitor-in-memory |
zeebe-simple-monitor-in-memory | ================================================================
zeebe-simple-monitor-in-memory |
zeebe-simple-monitor-in-memory |
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:25.350  INFO 1 --- [  restartedMain] io.zeebe.monitor.ZeebeSimpleMonitorApp   : Starting ZeebeSimpleMonitorApp using Java 11.0.13 on fdaf62642081 with PID 1 (/app/classes started by root in /)
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:25.358 DEBUG 1 --- [  restartedMain] io.zeebe.monitor.ZeebeSimpleMonitorApp   : Running with Spring Boot v2.6.3, Spring v5.3.15
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:25.359  INFO 1 --- [  restartedMain] io.zeebe.monitor.ZeebeSimpleMonitorApp   : No active profile set, falling back to default profiles: default


zeebe_broker                | 2022-07-01 14:57:32.240 [Broker-0-Exporter-1] [Broker-0-zb-fs-workers-1] INFO 
zeebe_broker                |       com.hazelcast.core.LifecycleService - [172.18.0.2]:5701 [dev] [5.1.1] [172.18.0.2]:5701 is STARTING
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:33.037  INFO 1 --- [  restartedMain] i.z.monitor.zeebe.ZeebeHazelcastService  : Connecting to Hazelcast 'zeebe:5701'
zeebe-simple-monitor-in-memory | WARNING: An illegal reflective access operation has occurred
zeebe-simple-monitor-in-memory | WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/app/libs/hazelcast-5.0.2.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
zeebe-simple-monitor-in-memory | WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
zeebe-simple-monitor-in-memory | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
zeebe-simple-monitor-in-memory | WARNING: All illegal access operations will be denied in a future release
zeebe_broker                | 2022-07-01 14:57:34.341 [Broker-0-Exporter-1] [Broker-0-zb-fs-workers-1] INFO 
zeebe_broker                |       com.hazelcast.internal.cluster.ClusterService - [172.18.0.2]:5701 [dev] [5.1.1]
zeebe_broker                |
zeebe_broker                | Members {size:1, ver:1} [
zeebe_broker                |   Member [172.18.0.2]:5701 - acea24f5-a8ec-4e8e-96d5-9f458a630b9a this
zeebe_broker                | ]
zeebe_broker                |
zeebe_broker                | 2022-07-01 14:57:34.350 [Broker-0-Exporter-1] [Broker-0-zb-fs-workers-1] INFO 
zeebe_broker                |       com.hazelcast.core.LifecycleService - [172.18.0.2]:5701 [dev] [5.1.1] [172.18.0.2]:5701 is STARTED
zeebe_broker                | 2022-07-01 14:57:34.358 [Broker-0-Exporter-1] [Broker-0-zb-fs-workers-1] INFO
zeebe_broker                |       com.hazelcast.internal.partition.impl.PartitionStateManager - [172.18.0.2]:5701 [dev] [5.1.1] Initializing cluster partition table arrangement...
zeebe_broker                | 2022-07-01 14:57:34.403 [Broker-0-Exporter-1] [Broker-0-zb-fs-workers-1] INFO 
zeebe_broker                |       io.camunda.zeebe.broker.exporter.hazelcast - Export records to ring-buffer with name 'zeebe' [head: 0, tail: -1, size: 0, capacity: 10000]
zeebe_broker                | 2022-07-01 14:57:34.447 [] [hz.inspiring_neumann.priority-generic-operation.thread-0] INFO 
zeebe_broker                |       com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask - [172.18.0.2]:5701 [dev] [5.1.1] Received auth from Connection[id=1, /172.18.0.2:5701->/172.18.0.3:59391, qualifier=null, endpoint=[172.18.0.3]:59391, remoteUuid=946f3950-dd91-4224-b4c6-935b6036671e, alive=true, connectionType=JVM, planeIndex=-1], successfully authenticated, clientUuid: 946f3950-dd91-4224-b4c6-935b6036671e, client name: hz.client_1, client version: 5.0.2
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:34.943  INFO 1 --- [  restartedMain] i.z.monitor.zeebe.ZeebeHazelcastService  : Importing records from Hazelcast...
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:35.105  INFO 1 --- [  restartedMain] i.z.h.connect.java.ZeebeHazelcast        : Read from ringbuffer 'zeebe' starting from sequence '0'
zeebe-simple-monitor-in-memory | 2022-07-01 14:57:37.094  INFO 1 --- [  restartedMain] io.zeebe.monitor.ZeebeSimpleMonitorApp   : Started ZeebeSimpleMonitorApp in 12.625 seconds (JVM running for 13.482)
zeebe_broker                | 2022-07-01 14:58:28.990 [Broker-0-HealthCheckService] [Broker-0-zb-actors-1] DEBUG
zeebe_broker                |       io.camunda.zeebe.broker.system - Detected 'HEALTHY' components. The current health status of components: [Partition-1{status=HEALTHY}]
zeebe_broker                | 2022-07-01 14:58:30.370 [Broker-0-ZeebePartition-1] [Broker-0-zb-actors-1] DEBUG
zeebe_broker                |       io.camunda.zeebe.broker.system - Detected 'HEALTHY' components. The current health status of components: [ZeebePartition-1{status=HEALTHY}, raft-partition-partition-1{status=HEALTHY}, Broker-0-Exporter-1{status=HEALTHY}, Broker-0-StreamProcessor-1{status=HEALTHY}, Broker-0-LogStream-1{status=HEALTHY}, Broker-0-SnapshotDirector-1{status=HEALTHY}] 

6、浏览器访问Zeebe Simple Monitor

         若看到如下图所示的界面,至此基础环境搭建完成了

7、修改Zeebe引擎版本

        在本文写作时,docker-compose.yml配置的zeebe版本为1.3.4,查看Zeebe发版记录,v1.3的最新版本为1.3.11,也可以切换为v8.0,具体版本号可访问:Docker Hub

        修改前:

version: "3"

networks:                                                                                                                                                                                        
  zeebe_network:
    driver: bridge

services:
  zeebe:
    container_name: zeebe_broker
    image: camunda/zeebe:1.3.4

        修改后:

version: "3"

networks:                                                                                                                                                                                        
  zeebe_network:
    driver: bridge

services:
  zeebe:
    container_name: zeebe_broker
    image: camunda/zeebe:1.3.11

        v8版本: 

version: "3"

networks:                                                                                                                                                                                        
  zeebe_network:
    driver: bridge

services:
  zeebe:
    container_name: zeebe_broker
    image: camunda/zeebe:8.0.4

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值