标签:mod exp -- plugins net issue mct tor glob
1 系统安装docker
yum install -y docker
systemctl enable docker
systemctl start docker
2 下载镜像包:
docker pull prom/prometheus
docker pull prom/node-exporter
docker pull grafana/grafana
3启动node-exporter
3.1 启动镜像
docker run -d -p 9100:9100 -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v /:/rootfs:ro --net=host prom/node-exporter
注:
3.2 登陆
http://ipserver:9100/metrics
4 启动prometheus
4.1 新建目录prometheus,编辑配置文件prometheus.yml,内容如下
global:
scrape_interval: 60s
evaluation_interval: 60s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: [‘localhost:9090‘]
labels:
instance: prometheus
- job_name: linux
static_configs:
- targets: [‘ipserver:9100‘] --这个是需要监控的linux服务器的地址
labels:
instance: localhost
4.2 启动prometheus
docker run -d -p 19090:9090 -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
4.3 登陆url
http://ipserver:19090/graph http://ipserver:19090/status
5 安装grafana
5.1 新建空文件夹/opt/grafana-storage
mkdir /opt/grafana-storage
chmod 777 -R /opt/grafana-storage
5.2 启动grafana
docker run -d -p 13000:3000 --name=grafana -v /opt/grafana-storage:/var/lib/grafana grafana/grafana
5.3 登陆url
http://ipserver:13000/login
######错误######
启动grafana容器出错的话,
GF_PATHS_DATA=‘/var/lib/grafana‘ is not writable.
You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later
mkdir: cannot create directory ‘/var/lib/grafana/plugins‘: Permission denied
---------解决办法:chmod 777 -R /opt/grafana-storage
node-exporter+prometheus+grafana
标签:mod exp -- plugins net issue mct tor glob
原文地址:https://www.cnblogs.com/yintian908/p/11157447.html