bashkubectl apply -f https://git.ooxo.cc/k8s/yaml/raw/branch/main/prom/prom.yaml
使用docker-compose部署
ymlversion: '3' services: prometheus: image: prom/prometheus restart: always volumes: - '/root/prometheus/rules:/etc/prometheus/rules' - '/root/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml' - '/root/prometheus/targets.json:/etc/prometheus/targets.json' command: - '--config.file=/etc/prometheus/prometheus.yml' - '--web.enable-lifecycle' ports: - '9090:9090' blackbox: image: prom/blackbox-exporter restart: always ports: - '9115:9115' alertmanager: image: prom/alertmanager restart: always ports: - '9093:9093' volumes: - /root/prometheus/alertmanager.yml:/etc/alertmanager/alertmanager.yml grafana: image: grafana/grafana ports: - "3000:3000" restart: always
推荐使用 Kubernetes 安装 Grafana,可以参考 Grafana 官方文档。如果在内网环境中,可以直接执行以下命令:
bashkubectl apply -f https://git.ooxo.cc/k8s/yaml/src/branch/main/prom/grafana.yaml
也可以使用 Docker Compose 进行安装,详细教程可以参考 MidwayJS 文档。
在 https://grafana.ooxo.cc/connections/datasources 中添加prometheus数据源,
地址为https://prom.ooxo.cc
在 Grafana 仪表盘导入页面 导入以下常用的仪表盘 ID:
linux监控
黑盒监控
nohup ./blackbox_exporter --config.file="./blackbox.yml" --web.listen-address=":9098" --log.level=debug > /dev/null 2>&1 &