Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Prometheus
docker-compose
version: '3.2'
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
ports:
- '9090:9090'
user: '0'
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus/data'
- '--storage.tsdb.retention=90d'
- '--web.enable-lifecycle'
volumes:
- ./etc/prometheus:/etc/prometheus
- ./data/prometheus/data:/prometheus/data
- /etc/localtime:/etc/localtime
depends_on:
- cadvisor
cadvisor:
image: google/cadvisor:latest
container_name: cadvisor
restart: unless-stopped
ports:
- '8080:8080'
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
ports:
- '9100:9100'
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
- '--collector.textfile.directory=/node_exporter/prom'
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /:/rootfs
- ./etc/node_exporter/prom:/node_exporter/prom
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
ports:
- '3000:3000'
user: '0'
volumes:
- ./data/grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
vim ./etc/prometheus/prometheus.yml
scrape_configs:
start
docker-compose up -d
Rabbit Cluster
docker-compose
rabbit1:
image: bijukunjummen/rabbitmq-server:3.7.0
hostname: rabbit1
ports:
- "5672:5672"
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=123456
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
rabbit2:
image: bijukunjummen/rabbitmq-server:3.7.0
hostname: rabbit2
links:
- rabbit1
environment:
start
docker-compose up -d
https://github.com/kbudde/rabbitmq_exporter/releases
wget https://github.com/kbudde/rabbitmq_exporter/releases/download/v1.0.0-RC4/rabbitmq_exporter-1.0.0-RC4.linux-amd64.tar.gz
tar zxf rabbitmq_exporter-1.0.0-RC4.linux-amd64.tar.gz
start
RABBIT_USER=admin RABBIT_PASSWORD=123456 OUTPUT_FORMAT=JSON PUBLISH_PORT=9099 RABBIT_URL=http://192.168.1.24:15672 nohup ./rabbitmq_exporter &
cadvisor Error
Failed to start container manager: inotify_add_watch
/sys/fs/cgroup/cpuacct,cpu: no such file or directory
solution
mount -o remount,rw '/sys/fs/cgroup'
ln -s /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct,cpu
grafana import Json File
手机扫一扫
移动阅读更方便
你可能感兴趣的文章