mysql

Dashboard

https://github.com/prometheus/mysqld_exporter
Last updated: 2 years ago

Start with Grafana Cloud and the new FREE tier. Includes 10K series Prometheus or Graphite Metrics and 50gb Loki Logs

Downloads: 2027

Reviews: 1

    mysql授权

    CREATE USER 'exporter'@'192.168.1.2' IDENTIFIED BY 'password';
    GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'192.168.1.2' WITH MAX_USER_CONNECTIONS 3;
    commit;
    FLUSH PRIVILEGES;
    select User,Host,authentication_string,Password from mysql.user;
    

    mysqld-exporter部署

    date -R
    mv /etc/timezone /etc/timezone-`date +%Y%m%d-%H%M%S`
    echo 'Asia/Shanghai' > /etc/timezone
    mv /etc/localtime /etc/localtime-`date +%Y%m%d-%H%M%S`
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    
    docker pull prom/mysqld-exporter
    docker rm -f mysqld-exporter
    docker run -d \
    --name mysqld-exporter \
    -v /etc/timezone:/etc/timezone \
    -v /etc/localtime:/etc/localtime \
    -p 9104:9104 \
    -e DATA_SOURCE_NAME="exporter:password@(192.168.1.1:3306)/" \
    --restart=unless-stopped \
    prom/mysqld-exporter
    docker logs -f --tail 10 mysqld-exporter
    

    dashboard from

    https://github.com/percona/grafana-dashboards/blob/master/dashboards/MySQL_Overview.json

    2020.4.16 增加主从复制同步相关

    Dependencies: