activiti7 cloud 安装配置

activiti7 cloud 安装配置
Docker 组成
遵循本指南,在Docker VM中设置Docker Compose以在本地计算机上运行Activiti Cloud。git
硬件设置
您将须要为Docker VM机器分配至少4个CPU内核和8gb RAM。github
软件设置
在开始以前,必须安装如下软件包:docker
桌面安装Docker或为操做系统安装Docker工具箱**  **
若是您在桌面使用Docker,请安装Docker-compose
安装GNU。对于Linux和Mac,它一般已经安装,对于Windows使用Chocolatey GNU Make来安装Make。
安装Git Bash终端。对于Linux和Maс一般是预装。若是您在Windows上使用Docker桌面,请使用Chocolatey Git Install安装Git Bash终端。

一、安装docker
一,Docker简介
百科说:Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化,容器是完全使用沙箱机制,相互之间不会有任何接口。

看起来有点雾,用过虚拟机的应该对虚拟化技术有点印象,不知道也没关系,就把它当成轻量级的虚拟机吧(虽然一个是完全虚拟化,一个是操作系统层虚拟化),这个解释到位:https://www.cnblogs.com/kex1n/p/6933039.html

百科又说:Docker 使用客户端-服务器 (C/S) 架构模式 使用远程API来管理和创建Docker容器。Docker 容器(Container)通过 Docker 镜像(Image)来创建,二者之间的关系类似于面向对象编程中的对象与类

那Docker由什么组成呢, 包括三个基本概念:

仓库(Repository)
镜像(Image)
容器(Container)
打个比方:你如果想玩英雄联盟中骚气的亚索,你首先得有这个英雄(Docker的镜像),然后你得花金币去英雄商店(Docker的仓库)买,接着进游戏就会看到一个半蹲的发型飘逸的剑客(Docker的容器),所以:

1,其中Registry是Docker用于存放镜像文件的仓库,Docker 仓库的概念跟Git 类似(就像商店存放所有的英雄,只是更改英雄的权限在某些非程序员手里)。

2,所谓镜像就是构建容器的源代码,是一个只读的模板,由一层一层的文件系统组成的,类似于虚拟机的镜像(英雄也是只读的,有自己的技能被动,你也不能进行操作)。

3,那么容器就是由Docker镜像创建的运行实例,类似于虚拟机,容器之间是相互隔离的,包含特定的应用及其所需的依赖文件(好比每个英雄都是隔离的,都有自己的皮肤,技能以及走的路线)。

注:Docker Hub是Docker公司提供的一个注册服务器(Register)来保存多个仓库,每个仓库又可以包含多个具备不同tag的镜像。

二,安装Docker
我是虚拟机装的Centos7,linux 3.10 内核,docker官方说至少3.8以上,建议3.10以上(ubuntu下要linux内核3.8以上, RHEL/Centos 的内核修补过, centos6.5的版本就可以——这个可以试试)
1,root账户登录,查看内核版本如下

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 
x86_64 x86_64 x86_64 GNU/Linux
 
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 

2,把yum包更新到最新(温馨提示:新环境或测试环境可随意操作,生产环境酌情慎重更新)

[root@localhost ~]# yum update
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.cn99.com
base                                                                                                  | 3.6 kB  00:00:00     
extras                                                                                                | 3.4 kB  00:00:00     
updates                                                                                               | 3.4 kB  00:00:00     
正在解决依赖关系
--> 正在检查事务
---> 软件包 NetworkManager.x86_64.1.1.12.0-6.el7 将被 升级
---> 软件包 NetworkManager.x86_64.1.1.12.0-10.el7_6 将被 更新

(期间要选择确认,输入 y 即可)

3,安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.cn99.com
软件包 device-mapper-persistent-data-0.7.3-3.el7.x86_64 已安装并且是最新版本
软件包 7:lvm2-2.02.180-10.el7_6.8.x86_64 已安装并且是最新版本
正在解决依赖关系
--> 正在检查事务
---> 软件包 yum-utils.noarch.0.1.1.31-50.el7 将被 安装
--> 正在处理依赖关系 python-kitchen,它被软件包 yum-utils-1.1.31-50.el7.noarch 需要
...
...

4,设置yum源(选择其中一个)

yum-config-manager --add-repo http://download.docker.com/linux/centos/docker-ce.repo(中央仓库)

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo(阿里仓库)

[root@localhost ~]# yum-config-manager --add-repo 
https://download.docker.com/linux/centos/docker-ce.repo
已加载插件:fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to 
/etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

5,可以查看所有仓库中所有docker版本,并选择特定版本安装

[root@localhost ~]# yum list docker-ce --showduplicates | sort -r
已加载插件:fastestmirror
可安装的软件包
 * updates: mirrors.cn99.com
Loading mirror speeds from cached hostfile
 * extras: mirrors.aliyun.com
docker-ce.x86_64            3:19.03.2-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.1-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.0-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.8-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.7-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.6-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.5-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.4-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.3-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.2-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.1-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.0-3.el7                     docker-ce-stable
docker-ce.x86_64            18.06.3.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.2.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.1.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.0.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.03.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            18.03.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.12.1.ce-1.el7.centos             docker-ce-stable

6,安装Docker,命令:yum install docker-ce-版本号,我选的是docker-ce-18.03.1.ce,如下

[root@localhost ~]# yum install docker-ce-18.03.1.ce
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.cn99.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 docker-ce.x86_64.0.18.03.1.ce-1.el7.centos 将被 安装

(期间要选择确认,输入 y 即可)
7, 启动Docker,命令:systemctl start docker,然后加入开机启动,如下

[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable  docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# docker version
Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:20:16 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:23:58 2018
  OS/Arch:      linux/amd64
  Experimental: false

附一些常用Docker命令,更多命令详解,请访问:http://www.docker.org.cn/dockerppt/106.html:

-----------------     docker ps 查看当前正在运行的容器

-----------------    docker ps -a 查看所有容器的状态

-----------------    docker start/stop id/name 启动/停止某个容器

-----------------    docker attach id 进入某个容器(使用exit退出后容器也跟着停止运行)

-----------------    docker exec -ti id 启动一个伪终端以交互式的方式进入某个容器(使用exit退出后容器不停止运行)

-----------------    docker images 查看本地镜像
 -----------------    docker rm id/name 删除某个容器
-----------------     docker rmi id/name 删除某个镜像

-----------------    docker run --name test -ti ubuntu /bin/bash  复制ubuntu容器并且重命名为test且运行,然后以伪终端交互式方式进入容器,运行bash

-----------------     docker build -t soar/centos:7.1 .  通过当前目录下的Dockerfile创建一个名为soar/centos:7.1的镜像

-----------------    docker run -d -p 2222:22 --name test soar/centos:7.1  以镜像soar/centos:7.1创建名为test的容器,并以后台模式运行,并做端口映射到宿主机2222端口,P参数重启容器宿主机端口会发生改变
————————————————
版权声明:本文为CSDN博主「秋刀鱼亦会过期」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u014069688/article/details/100532774

二、克隆Activiti Cloud 实例
打开Bash命令行终端并运行这些命令,将https://github.com/Activiti/activiti-cloud-examples克隆到您的本地环境中:json

git clone https://github.com/Activiti/activiti-cloud-examples
cd activiti-cloud-examples/docker-compose

配置环境
您须要编辑.env文件来根据操做系统和Docker VM类型配置DOCKER_IP属性。a

vim .env

在Linux、Mac或Windows桌面上使用Docker的本地计算机IP地址
若是使用Docker工具箱,请使用Docker -machine ip命令
不要使用127.0.0.1或localhost
三、如何运行Activity Cloud

安装docker-compose

yum -y install epel-release

yum -y install python-pip

pip install --upgrade pip

pip install docker-compose

pip install --proxy http://10870004:ZouQH%40900825@172.16.56.29:8080 docker-compose

启动Modeler浏览器

make modeler

启动Modeler后,等待容器启动。您能够经过运行make ps和make logs命令来检查状态,以确保容器已经准备好。app
要访问modeler,请在浏览器中打开url:http://$DOCKER_IP/modelingssh
 
您将被重定向到keycloak,在那里您必须使用凭据modeler/password工具
启动应用程序

make application

您将须要使用Postman来使用Activiti Rest apipost
启动Postman并将其添加到Postman收集Activiti v7 REST API.postman_collection.json位于https://github.com/Activiti/activiti-cloud-examples
而后在右上角选择“管理环境”,而后在“当前值”选项卡中使用您本身的ip。
而后使用activiti做为默认环境。
要开始工做,请在邮递员密钥斗篷集合中执行getKeycloakToken hruser。而后在rb-my-app Postman集合中运行startProcess。
启动全部服务

make all

使用Docker组合启动全部服务

docker-compose up

中止全部服务

make stop

中止应用程序

make application/stop

中止Modeler

make modeler/stop

关闭全部服务

make down

使用Docker组合关闭全部服务

docker-compose down

有用的命令
查看和跟踪终端中的日志

make logs

只查看一个服务的日志

make  example-runtime-bundle/logs

快速ssh到服务pod

make  example-runtime-bundle/ssh

其余可用的行动

make help

常见的错误
在运行命令以前,请确保您位于docker-compose文件夹中。
若是有些东西不能与模型首先清除饼干或开始在incognito窗口
若是你正在使用nip.io地址确保本地防火墙或公司防火墙不会阻止需求

【注意】
设置代理服务器
1、yum代理
注意密码中有@符需转义为%40

vim /etc/yum.conf

添加

proxy=http://10870004:ZouQH%40900825@172.16.56.29:8080

2、git代理

git config --global http.proxy proxy=http://10870004:ZouQH%40900825@172.16.56.29:8080

3、docker代理
1 创建目录

mkdir /etc/systemd/system/docker.service.d

2 创建配置文件

touch /etc/systemd/system/docker.service.d/http-proxy.conf

3 编辑文件并加入以下内容

vim/vi http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://ip:port"

4 更新重加载配置&重启Docker服务

systemctl daemon-reload
systemctl restart docker

此时docker search ubuntu就能使用了。。

4、防火墙开放端口
问题:页面打开问题,查看日志

make logs

错误信息:No route to host

firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@centos-2 docker-compose]# make all


Keycloak path: http://10.9.70.145/auth
Modeling app: http://10.9.70.145/modeling
Runtime bundle entry point: http://10.9.70.145/rb

docker-compose up -d
Pulling activiti-postgres (postgres:)...
latest: Pulling from library/postgres
69692152171a: Pull complete
a31b993d5cc6: Pull complete
f65921886500: Pull complete
b9c1a94e4ca8: Pull complete
435dd99ceb68: Pull complete
d3ee8e88c67c: Pull complete
84b08674f942: Pull complete
7d358e850d3e: Pull complete
adf2c63307b4: Pull complete
27ff0e95dd24: Pull complete
550e7b1ab95a: Pull complete
2287baf15bf8: Pull complete
97d11a196325: Pull complete
0f11fc82fe79: Pull complete
Digest: sha256:0eee5caa50478ef50b89062903a5b901eb818dfd577d2be6800a4735af75e53f
Status: Downloaded newer image for postgres:latest
Pulling nginx (nginx:latest)...
latest: Pulling from library/nginx
69692152171a: Already exists
49f7d34d62c1: Pull complete
5f97dc5d71ab: Pull complete
cfcd0711b93a: Pull complete
be6172d7651b: Pull complete
de9813870342: Pull complete
Digest: sha256:df13abe416e37eb3db4722840dd479b00ba193ac6606e7902331dcea50f4f1f2
Status: Downloaded newer image for nginx:latest
Pulling rabbitmq (rabbitmq:)...
latest: Pulling from library/rabbitmq
01bf7da0a88c: Pull complete
f3b4a5f15c7a: Pull complete
57ffbe87baa1: Pull complete
5ef3ef76b1b5: Pull complete
e9f255817d55: Pull complete
13dc549f3930: Pull complete
a895181f23e6: Pull complete
3d373f7d2d0c: Pull complete
37bf565e5165: Pull complete
e8847c14de68: Pull complete
Digest: sha256:bab178419907cdbc561c0222ac4cdbbbdea2d390dab0a84d7972be3bdb537d13
Status: Downloaded newer image for rabbitmq:latest
Pulling keycloak (activiti/activiti-keycloak:)...
latest: Pulling from activiti/activiti-keycloak
469cfcc7a4b3: Pull complete
05677e4d61f0: Pull complete
a9520f492457: Pull complete
4d201219d6b1: Pull complete
7cb337c0f950: Pull complete
cddac7589776: Pull complete
3f04e60d9c59: Pull complete
8c8465c52a96: Pull complete
3dd7ea569b8b: Pull complete
10476db72123: Pull complete
eb65d27622b1: Pull complete
881a258d46b7: Pull complete
a3358dc93681: Pull complete
8c69db03e4a4: Pull complete
d225afcfd42d: Pull complete
97efcfcda6f1: Pull complete
ab15dad40d6b: Pull complete
535a90be11e9: Pull complete
33df0586e0bb: Pull complete
cef5c10bcd76: Pull complete
53d44eb07015: Pull complete
Digest: sha256:ea3220b599adaa31c5d350d6fe641f57f8f0d29d9a92f2fa0cd41bb14f9e97f1
Status: Downloaded newer image for activiti/activiti-keycloak:latest
Pulling example-runtime-bundle (activiti/example-runtime-bundle:7.1.0-M12)...
7.1.0-M12: Pulling from activiti/example-runtime-bundle
898c46f3b1a1: Pull complete
63366dfa0a50: Pull complete
041d4cd74a92: Pull complete
6e1bee0f8701: Pull complete
8fb802d85d60: Pull complete
08a0d02a4ea8: Pull complete
ae546bb81870: Pull complete
9567f33c890a: Pull complete
6e6621ca58e9: Pull complete
267222e7fa13: Pull complete
9a8398a61335: Pull complete
Digest: sha256:be1fcdf823be9065dd42764ce8a26a4ba58f49da708d8f1d003e036ffbebcd74
Status: Downloaded newer image for activiti/example-runtime-bundle:7.1.0-M12
Pulling example-cloud-connector (activiti/example-cloud-connector:7.1.0-M12)...
7.1.0-M12: Pulling from activiti/example-cloud-connector
4fe2ade4980c: Pull complete
1a36acaaef24: Pull complete
19eba5217a6f: Pull complete
88a280fbd4ab: Pull complete
c75272041691: Pull complete
Digest: sha256:26e897d2450c1af2027f69887b29605540f2042befa3c570579c659ba7c284d4
Status: Downloaded newer image for activiti/example-cloud-connector:7.1.0-M12
Pulling activiti-cloud-query (activiti/activiti-cloud-query:7.1.0-M12)...
7.1.0-M12: Pulling from activiti/activiti-cloud-query
32802c0cfa4d: Pull complete
da1315cffa03: Pull complete
fa83472a3562: Pull complete
f85999a86bef: Pull complete
246acdde9daa: Pull complete
106806dce6a5: Pull complete
eb9acd875a67: Pull complete
768f1342bfed: Pull complete
e25d70554331: Pull complete
d7beca2c9876: Pull complete
6084cb743f7f: Pull complete
811bee19abc2: Pull complete
8c1336bfaeb8: Pull complete
Digest: sha256:88f1ee3dd7d9e0463720cf238e9b5fb60c568f9fb55f221bf6f61fcf09ee746b
Status: Downloaded newer image for activiti/activiti-cloud-query:7.1.0-M12
Pulling activiti-cloud-modeling (activiti/activiti-modeling-app:7.1.0-M12)...
7.1.0-M12: Pulling from activiti/activiti-modeling-app
df20fa9351a1: Pull complete
afc5aa2635e8: Pull complete
1d6235c5b72c: Pull complete
7b66dfc760f4: Pull complete
95a71d6e7714: Pull complete
596ced4cb7a8: Pull complete
023ee3949e03: Pull complete
f4b02c03059b: Pull complete
1e4858396d7c: Pull complete
444b289ad4bd: Pull complete
67a575414f13: Pull complete
Digest: sha256:788ed94e8e0541058ef01c9ab38044c09d62d93e1afb341b4d00fd9c4ecb01cf
Status: Downloaded newer image for activiti/activiti-modeling-app:7.1.0-M12
Pulling activiti-cloud-modeling-backend (activiti/activiti-cloud-modeling:7.1.0-M12)...
7.1.0-M12: Pulling from activiti/activiti-cloud-modeling
5e6ec7f28fb7: Pull complete
1cf4e4a3f534: Pull complete
5d9d21aca480: Pull complete
0a126fb8ec28: Pull complete
1904df324545: Pull complete
e6d9d96381c8: Pull complete
758effa4960f: Pull complete
168616098e60: Pull complete
4828d91c0c81: Pull complete
b75377dfcd7b: Pull complete
Digest: sha256:f27ee4cb9142198ae0bc393718d09b05a16f335a0cac513953a4876dcfdce5a8
Status: Downloaded newer image for activiti/activiti-cloud-modeling:7.1.0-M12
Creating activiti-cloud-modeling            ... done
Creating nginx                              ... done
Creating activiti-cloud-modeling-backend    ... done
Creating docker-compose_activiti-postgres_1 ... done
Creating rabbitmq                           ... done
Creating keycloak                           ... done
Creating activiti-cloud-query               ... done
Creating example-runtime-bundle             ... done
Creating example-cloud-connector            ... done

【参考】
linux connect非阻塞 - 尚码园
Centos7下安装Docker(详细安装教程)_docker安装centos7创建不同账号-CSDN博客

Activiti 7是基于Spring Boot 2和Spring Cloud的,因此您可以使用Spring Boot配置方式来配置Activiti 7。以下是配置Activiti 7的步骤: 1. 在您的Spring Boot项目中添加一个名为“application.yml”的文件。 2. 在该文件中定义Activiti配置属性。以下是一个Activiti 7 YAML配置文件的示例: ``` spring: activiti: process-definition-location-prefix: classpath:/processes/ process-definition-location-suffix: .bpmn20.xml rest: enable: true path: /activiti-api database: schema-update: true schema: activiti7 type: mysql url: jdbc:mysql://localhost:3306/activiti7?useSSL=false driver: com.mysql.cj.jdbc.Driver username: root password: password ``` 在此示例中,我们定义了以下属性: - process-definition-location-prefix:用于指定流程定义文件的前缀路径。 - process-definition-location-suffix:用于指定流程定义文件的后缀名。 - rest.enable:用于启用或禁用Activiti 7 REST API。 - rest.path:用于指定Activiti 7 REST API的路径。 - database.schema-update:用于指定Activiti 7启动时是否应更新数据库模式。 - database.schema:用于指定要使用的数据库模式名称。 - database.type:用于指定要使用的数据库类型。 - database.url:用于指定要连接的数据库的JDBC URL。 - database.driver:用于指定要使用的JDBC驱动程序。 - database.username:用于指定要使用的数据库用户名。 - database.password:用于指定要使用的数据库密码。 3. 启动您的应用程序。Activiti 7将自动加载并使用配置文件中定义的属性。 希望这可以帮助您配置Activiti 7!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rainbow酱

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值