How to Monitor MySQL/MariaDB through Prometheus & Grafana ?

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024
  • Please follow the below steps to install mysqld_exporter.
    curl -s api.github.com... | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi -
    tar xvf mysqld_exporter*.tar.gz
    sudo mv mysqld_exporter-*.linux-amd64/mysqld_exporter /usr/local/bin/
    sudo chmod +x /usr/local/bin/mysqld_exporter
    CREATE USER mysqld_exporter IDENTIFIED BY 'PASSWD';
    GRANT PROCESS, REPLICATION CLIENT, SELECT ON . TO 'mysqld_exporter';
    FLUSH PRIVILEGES;
    EXIT
    Configure DB Credential
    sudo vi /etc/.mysqld_exporter.cnf
    [client]
    user=mysqld_exporter
    password=PASSWD
    host=192.168.56.109
    Change ownership
    sudo chown root:prometheus /etc/.mysqld_exporter.cnf
    Create Systemd File
    sudo vi /etc/systemd/system/mysql_exporter.service
    [Unit]
    Description=Prometheus MySQL Exporter
    After=network.target
    User=prometheus
    Group=prometheus
    [Service]
    Type=simple
    Restart=always
    ExecStart=/usr/local/bin/mysqld_exporter \
    --config.my-cnf /etc/.mysqld_exporter.cnf \
    --collect.global_status \
    --collect.info_schema.innodb_metrics \
    --collect.auto_increment.columns \
    --collect.info_schema.processlist \
    --collect.binlog_size \
    --collect.info_schema.tablestats \
    --collect.global_variables \
    --collect.info_schema.query_response_time \
    --collect.info_schema.userstats \
    --collect.info_schema.tables \
    --collect.perf_schema.tablelocks \
    --collect.perf_schema.file_events \
    --collect.perf_schema.eventswaits \
    --collect.perf_schema.indexiowaits \
    --collect.perf_schema.tableiowaits \
    --collect.slave_status \
    --web.listen-address=0.0.0.0:9104
    [Install]
    WantedBy=multi-user.target
    sudo systemctl daemon-reload
    sudo systemctl enable mysql_exporter
    sudo systemctl start mysql_exporter
    Import Mysql Grafana Dashboard
    grafana.com/gr...

ความคิดเห็น • 11

  • @Jpes211
    @Jpes211 2 หลายเดือนก่อน +1

    prome~te~theus

  • @hazlanmuhammadqodri8469
    @hazlanmuhammadqodri8469 11 หลายเดือนก่อน

    Your explanation is so awesome and great sir! Thank you for the tutorial, it helped me a lot!

    • @avinashkumar-thelearningdest
      @avinashkumar-thelearningdest  11 หลายเดือนก่อน

      Thank you so much Brother for your kind words. Please share my channel within your network.

  • @rohitsaraf-qz9ue
    @rohitsaraf-qz9ue ปีที่แล้ว

    sir you are greatly explained everything ............................. thank you

  • @arielhumbertocorralessardi589
    @arielhumbertocorralessardi589 2 ปีที่แล้ว +2

    it's a good video, very precise and explicative

    • @avinashkumar-thelearningdest
      @avinashkumar-thelearningdest  2 ปีที่แล้ว

      Thank you so much Ariel for your encouraging comments. Please help me to share my channel within your friends. As despite of good contents, I have very few subscribers.

  • @desishofianasari8032
    @desishofianasari8032 ปีที่แล้ว

    hello I wanna ask, maybe there's people can help me. So I have 2 vm for monitoring and target. I install apache in monitor-vm, and install prometheus in target-vm. So, I install mysql_exporter in monitor and configured it on prometheus. But when I starting to enter localhost:9104, I can't access it. What should I use for the host, is IP Adress from Monitor-vm or Target-vm?

  • @ulfahfarhana178
    @ulfahfarhana178 2 ปีที่แล้ว

    may I know what kind of app you use to command?