首页 > 其他分享 >docker-compose部署prometheus+grafana进行服务器监控

docker-compose部署prometheus+grafana进行服务器监控

时间:2024-03-14 09:55:37浏览次数:29  
标签:compose 9090 grafana prometheus 服务器 docker yml

1、创建prometheus【prometheus.yml】配置

global: 
  scrape_interval:     15s 
  evaluation_interval: 15s 
 
scrape_configs: 
  - job_name: 'prometheus' 
    static_configs: 
      - targets: ['192.168.2.216:9090'] 
View Code

2、创建【docker-compose.yml】

version: '3' 
 
services: 
  prometheus: 
    image: prom/prometheus 
    container_name: prometheus 
    ports: 
      - "9090:9090" 
    volumes: 
      - ./config/prometheus.yml:/etc/prometheus/prometheus.yml 
      - ./data:/prometheus
View Code

3、启动prometheus

docker-compose up -d 

4、访问服务

http://192.168.2.216:9090/graph

5、需要检测的服务器部署检测端

 

标签:compose,9090,grafana,prometheus,服务器,docker,yml
From: https://www.cnblogs.com/raorao1994/p/18072164

相关文章

  • Prometheus多集群监控的3种方案,你选哪种?
    本文分享自华为云社区《Prometheus多集群监控方案》,作者:可以交个朋友。一、背景不少用户在k8s集群外裸机环境部署了prometheus监控组件想要查询k8s集群的监控指标,又或者是想采集多个k8s集群中的节点指标,容器指标,master组件指标等。二、Prometheus多集群监控能力介绍当前通过P......
  • Prometheus 同步告警到企业微信机器人
    方法1:一、使用webhook-adapter同步信息到企业微信1.编辑alertmanager.yml文件global:resolve_timeout:5mscrape_interval:15stemplates:-'/data/prometheus/alertmanager/template/*.tmpl'route:group_by:['alertname']group_wait:10sgroup_......
  • docker-compose安装minio集群
    一、docker-compose安装minio单机版直接使用docker安装单机版,可用于测试创建.env环境文件MINIO_PASSWORD=minio@123创建docker-compose.yml环境文件version:"3"services:minio:image:minio/miniocontainer_name:minioports:-9000:9000......
  • 45_docker-compose_mysql8.0
    1.安装Docker-composecurl-L"https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-composechmod+x/usr/local/bin/docker-composeln-s/usr/local/bin/docker-compose/usr/b......
  • 44_docker-compose_mysql5.7
    1.安装Docker-composecurl-L"https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-\$(uname-s)-\$(uname-m)"-o/usr/local/bin/docker-composechmod+x/usr/local/bin/docker-composeln-s/usr/local/bin/docker-compose/u......
  • 46_docker-compose_nginx
    1.安装Docker-composecurl-L"https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-composechmod+x/usr/local/bin/docker-composeln-s/usr/local/bin/docker-compose/usr/b......
  • docker-compose 部署gitlab
    主机ip:192.168.1.139[root@localhostgitlab_docker]#catdocker-compose.ymlversion:'3.1'services:gitlab:image:'gitlab/gitlab-ce:latest'container_name:gitlab#随着docker重启自动启动restart:alwaysenvironment:......
  • docker-compose 部署apollo
    apollo-1.9.2docker-compose.yamlversion:'3'services:#模拟一个正常的mysql数据库mysql8:image:mysql:5.7restart:alwayscontainer_name:mysqlports:-3306:3306volumes:-./databases/mysql/logs:/var/log/mysql......
  • docker-compose 部署nacos
    version:'3'services:#模拟一个正常的mysql数据库mysql8:image:mysql:5.7restart:alwayscontainer_name:mysqlports:-3306:3306volumes:-./databases/mysql/logs:/var/log/mysql-./databases/mysql/data:/v......
  • 在Debian系统上安装Prometheus
    在Debian系统上安装Prometheus,可以按照以下步骤操作:1.添加官方存储库首先,我们需要添加Prometheus的官方存储库到Debian系统中。以下是从Debian11Bullseye开始的安装步骤,对于Debian12Bookworm也应该适用:#安装所需的包管理工具sudoaptupdate&&sudoaptinstallcurlgnupg......