$ sudo chown root:prometheus /etc/.mysqld_exporter.cnf Step 5 – Create systemd unit file ( For Systemd systems ) # Add correct username and password for user create Step 4 – Configure database credentials # Create database credentials file: # WITH MAX_USER_CONNECTIONS 2 is used to set a max connection limit for the user to avoid overloading the server with monitoring scrapes under heavy load. # If you have a Master-Slave database architecture, create user on the master servers only. Mysql> GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO FLUSH PRIVILEGES Mysql> CREATE USER IDENTIFIED BY 'StrongPassword' The user should have PROCESS, SELECT, REPLICATION CLIENT grants: $ mysqld_exporter -version Step 3 – Create Prometheus exporter database user $ mysql -u root -p # Confirm installation by checking version of mysqld_exporter $ sudo chmod +x /usr/local/bin/mysqld_exporter $ sudo mv mysqld_exporter-*.linux-amd64/mysqld_exporter /usr/local/bin/ $ curl -s | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi. You may need to check Prometheus MySQL exporter releases page for the latest release, then export the latest version. This should be done on MySQL / MariaDB servers, both slaves and master servers. Step 2 – Download and install Prometheus MySQL Exporter # This user will manage the exporter service. $ sudo useradd -s /sbin/nologin -system -g prometheus prometheus Step 1 – Add Prometheus system user and group: $ sudo groupadd -system prometheus Create / Import Grafana Dashboard for MySQL Prometheus exporter.Step 7 – Configure MySQL endpoint to be scraped by Prometheus Server.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |