运维资源统计升级部署
如果想要给平台安装最新的资源统计功能,可以按以下步骤操作:
下载镜像
x86 平台
ARM64 平台
info
请根据平台选择正确的版本,下载最新版的运维服务镜像。
导入镜像
将镜像放到 app
目录
将下载的 prometheus.tar.gz
、node-exporter.tar.gz
和运维服务的 operation-linux-x86_64.tar.gz
文件放置于 app
目录中。
导入镜像
执行以下命令导入镜像到 Docker:
cd app
docker load < prometheus.tar.gz
docker load < node-exporter.tar.gz
docker load < operation-linux-x86_64.tar.gz
修改 app/docker-compose-operation.yml
添加 node-exporter 和 prometheus 服务
info
需要注意运维镜像版本号。
version: '3'
services:
operation:
container_name: operation
image: airiot/operation:V4.3.0
restart: always
environment:
- PROJECTNAME=app
- REPOS=https://airiot.link/strapi/repos/v4/latest
networks:
- backend
ports:
- "13030:10088"
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- $PWD/:/app/compose/
- $PWD/airiot/web/html:/app/html
- $PWD/operation/data:/data
- $PWD/operation/log:/log
- $PWD/operation/build:/app/web
- $PWD/operation/driverRepo:/driverRepo
- $PWD/operation/repos:/app/repos
- $PWD/airiot/web/cors:/app/cors
- $PWD/operation/protocolProxyRepo:/app/protocolProxyRepo
ulimits:
nproc: 40960
nofile:
soft: 10240
hard: 30720
logging:
driver: "json-file"
options:
max-size: 100m
max-file: "1"
node-exporter:
image: prom/node-exporter:v1.6.1
container_name: node-exporter
restart: always
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
networks:
- backend
ulimits:
nproc: 40960
nofile:
soft: 10240
hard: 30720
logging:
driver: "json-file"
options:
max-size: 100m
max-file: "1"
prometheus:
image: prom/prometheus:v2.47.2
container_name: prometheus
restart: always
volumes:
- $PWD/operation/monitor/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
networks:
- backend
ulimits:
nproc: 40960
nofile:
soft: 10240
hard: 30720
logging:
driver: "json-file"
options:
max-size: 100m
max-file: "1"
networks:
backend: {}
重启运维
cd app
./runOperation.sh