prometheus + grafana container monitoring K8S

Machine: 172.27.143.155 [grafana + Prometheus]

A, Prometheus installation:
. 1, wget https://github.com/prometheus/prometheus/releases/download/v2.8.1/prometheus-2.8.1.linux-amd64.tar.gz

2、tar -zxvf prometheus-2.8.1.linux-amd64.tar.gz -C /usr/local/

. 3, CD / usr / local
. 4, Music Videos Prometheus-2.8.1.linux-AMD64 / Prometheus
. 5, Prometheus CD /
. 6, see version
./prometheus --version
prometheus + grafana container monitoring K8S
. 7, modify the configuration file
prometheus.yml
prometheus + grafana container monitoring K8S

8, after completion of service and services made
Vim /lib/systemd/system/prometheus.service
[Unit]
the Description Prometheus =
Documentation = https://prometheus.io/
the After network.target =

[Service]
Type=simple
User=root

ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/home/software/prometheus-data
Restart=on-failure

[Install]
WantedBy=multi-user.target
prometheus + grafana container monitoring K8S

And then start it
and then verify
systemctl Start Prometheus
http://172.27.143.155:9090/targets
prometheus + grafana container monitoring K8S

Second, the installation grafana
. 1, https://grafana.com/grafana/download
2, wget https://dl.grafana.com/oss/release/grafana-6.5.2.linux-amd64.tar.gz
. 3, the tar grafana-6.5.2.linux-amd64.tar.gz -zxvf
. 4, Music Videos grafana-6.5.2 / usr / local / grafana
. 5, CD / usr / local / grafana / bin
. 6, the nohup ./grafana-server &
HTTP : //172.27.143.155: 3000 /
account number and password are default ADMIN
. 7, the data source configuration, where when Prometheus
prometheus + grafana container monitoring K8S

8, when introduced into the template ID No. 193
prometheus + grafana container monitoring K8S
9 after completion of review performance
prometheus + grafana container monitoring K8S

Guess you like

Origin blog.51cto.com/xiaorenwutest/2462621