1)docker fileを作成する。
vi docker-compose_gra.yml
============= docker-compose_gra.yml ===========================
version: '3'
services:
prometheus:
image: prom/prometheus:v2.2.0
container_name: prometheus
volumes:
- ./prometheus.yml:/Users/User_Home/prometheus/prometheus.yml
- ./prometheus-data:/prometheus
ports:
- 9090:9090
grafana:
image: grafana/grafana:5.1.2
container_name: grafana
volumes:
- ./grafana-data:/var/lib/grafana
ports:
- 3000:3000
================================================================
◾️ポイント:
/Users/User_Home/は、個人でフォルダを生成する
2)prometheus.ymlを作成する。
vi prometheus.yml
======================== prometheus.yml =====================================
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'codelab-monitor'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
=============================================================================
2)ファイルの実行を行う
docker-compose -f docker-compose_gra.yml up -d
参考ページ:
https://hakengineer.xyz/2018/05/12/post-1185/
参考ページ:
https://hakengineer.xyz/2018/05/12/post-1185/
0 件のコメント:
コメントを投稿