# because the directory/data user group and the user is the Jtserver,docker execution command is the root user,/data/lib/prometheus to the other group permissions to perform
sudo mkdir/data/lib/prometheus
sudo chown 767/data/lib/prometheus
docker run-d \
p 9090:9090 \
--restart=always \
--name Prometheus \
-v/data/lib/prometheus:/data/lib/prometheus \
-v/etc/prometheus/prometheus.yml:/etc/ PROMETHEUS/PROMETHEUS.YML \
prom/prometheus \
--config.file=/etc/prometheus/prometheus.yml \--
Storage.tsdb.path=/data/lib/prometheus
Docker run-d-P 9100:9100 \
v "/proc:/host/proc:ro" \
V "/sys:/host/sys:ro" \
V "/:/rootfs:ro" \
--net= "host" \
--restart=always \
prom/node-exporter \
--collector.procfs/host/proc \
Collector.sysfs/host/sys \
--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc) ($|/)"
Docker run-d \
p 3000:3000 \
--restart=always \
--name=grafana \
E "gf_security_admin_password= Admin "\
E" Gf_install_plugins=grafana-clock-panel,grafana-simple-json-datasource,raintank-worldping-app, Grafana-piechart-panel "\
-v/data/lib/grafana:/var/lib/grafana \
Grafana/grafana
Docker installation Mysql_exporterDownload Mysql_exporter Mirrors
Docker Pull Prom/mysqld-exporter
Mysql_exporter need to link the database, MySQL create mysql_monitor users, add process, REPLICATION client permissions
Mysql> INSERT into Mysql.user (Host,user,password) VALUES ("localhost", "Mysql_monitor", Password ("Mysql_monitor")) ;
Mysql> GRANT PROCESS, REPLICATION CLIENT, SELECT on *.* to ' mysql_monitor ' @ ' localhost ' identified by ' mysql_monitor '; 1/>mysql> GRANT PROCESS, REPLICATION CLIENT, SELECT on *.* to ' mysql_monitor ' @ '% ' identified by ' mysql_monitor ';
mysql> FLUSH privileges;
Docker Start Mysql_exporter Mirroring
Docker run-d-P 9104:9104 \
--name=mysqld-exporter \
--restart=always \
e data_source_name= "Mysql_ monitor:mysql_monitor@ (172.17.0.1:3306)/"\
Prom/mysqld-exporter
Reference
-Https://github.com/prometheus/node_exporter
-Https://github.com/grafana/grafana-docker
-http://www.ywnds.com/?p=9668