Docker installation Prometheus,grafana display data

Source: Internet
Author: User
Tags mysql create grafana docker run
# 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.