一、一键化部署介绍
Aops服务一键化部署采用docker容器,搭配docker-compose服务编排,简化部署难度,实现一键启动/暂停。
1.1、一键部署优缺点介绍
优点
- 简化部署操作,无需执行多个rpm包的重复性安装。
- 无特定的OS版本要求,可运行在openeuler的任意发行版中,同时支持多平台运行。
缺点
- 单服务启动都是基于openeuler:22.03-lts-sp1的docker镜像,服务占用内存及空间增大,造成资源浪费。
二、环境要求
建议使用2台openEuler 22.03 LTS SP2及以上机器完成部署(单台机器内存8G+),具体用途及部署方案如下:
- 机器A用于部署mysql、elasticsearch、kafka、redis、prometheus等,主要提供基础数据服务支持;
- 机器B用于部署A-Ops服务端,提供业务功能支持。部署A-Ops前端服务,提供展示、操作;
| 机器编号 | 配置IP | 部署服务 |
|---|---|---|
| 机器A | 192.168.1.1 | mysql elasticsearch redis kafka prometheus |
| 机器B | 192.168.1.2 | aops-zeus aops-diana aops-apollo aops-hermes |
三、配置环境部署
3.1、 关闭机器A防火墙
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
3.2、 安装docker docker-compose
dnf install docker docker-compose -y
# 设置docker开机启动
systemctl enable docker
3.3、 安装aops-vulcanus aops-tools
dnf install aops-vulcanus aops-tools -y
3.4、 一键部署
- 执行部署脚本
cd /opt/aops/scripts/deploy/container
# 执行run.sh部署脚本
bash run.sh
进入交互式命令行
===========================Container arrangement=========================== Welcome to the one-click deployment script, supporting pre-building of container images and start-stop of services. Image Building (build): supports the generation of docker images for zeus, apollo, hermes services. Service Start (start): the service types are divided into basic environment services and application services. Basic environment services include mysql, elasticsearch, redis, kafka, prometheus, which can be started by entering the 'start-env' option. Application services include apollo, zeus, hermes, which can be started by entering the 'start-service' option. please remember that, in the absence of a pre-existing environment, the correct order of using one-click startup services is to first execute "start-env" and then "start-service" Both steps are essential and cannot be skipped. Stop Service (stop): enter 'stop-env' or 'stop-service' to stop the basic environment services and application services respectively. After the basic environment services are stopped, if the configuration items of the application services are not reconfigured, it will cause the application services to be unusable. Conversely, after stopping the application services, there is no impact on the basic environment services. Enter to exit the operation (Q/q). Please enter build, start-env, start-service, stop-env, stop-service, or q/Q to proceed to the next step:build: 部署基础服务(mysql、kafka等)不需要执行build操作
start-service: 启动A-Ops服务及前端应用
start-env: 启动基础服务,包括mysql、redis、kafka等
stop-service: 停止A-Ops服务及前端应用
stop-env: 停止基础服务(数据会依然保留)
Q/q: 退出命令交互模式
- 部署A-Ops服务端
# 切换在机器B上执行部署脚本
cd /opt/aops/scripts/deploy/container
bash run.sh
# 交互式命令中执行start-service
- 更改服务配置文件
注意:当A-Ops服务和基础服务在同一台机器上部署时,则无需调整配置文件即可使用。若部署方案与本文档中类似(机器A、B),则需要将所有的配置文件中连接基础服务的配置项更改为机器A的ip
默认的mysql连接字符串中使用无密码模式,基础服务的mysql配置了默认密码“123456”,视具体情况调整
# 调整 apollo.ini diana.ini zeus.ini配置文件中连接mysql、elasticsearch、kafka、redis的ip地址
cd /etc/aops/
- FAQ
1. elasticsearch基础服务无法正常启动
查看/opt/es文件夹的权限,默认权限需要调整为777,可执行 "chmod -R 777 /opt/es" 。
2. prometheus 基础服务无法正常启动
查看/etc/prometheus目录下是否存在prometheus.yml配置文件,如果不存在,请添加配置文件。
文档捉虫




