去年安装的多项目版本没有资源统计功能,今年买的有
平台安装
-
title: 运维资源统计功能安装
sidebar_label: 运维资源统计功能安装
sidebar_position: 10如果想要给平台安装最新的资源统计功能,可以按以下步骤操作:
1. 下载镜像
x86 平台
ARM64 平台
说明: 请根据平台选择正确的版本,下载最新版的运维服务镜像。
2. 导入镜像
1. 将镜像放到
app
目录将下载的
prometheus.tar.gz
、node-exporter.tar.gz
和运维服务的operation-linux-x86_64.tar.gz
文件放置于app
目录中。2. 导入镜像
执行以下命令导入镜像到 Docker:
cd app docker load < prometheus.tar.gz docker load < node-exporter.tar.gz docker load < operation-linux-x86_64.tar.gz
3. 修改docker-compose-operation.yml
添加 node-exporter 和 prometheus 服务
注: 需要注意运维镜像版本号
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: {}
4. 重启运维
cd app ./runOperation.sh
5. 更新运维前端