![]() I’ve walked you through the process of installing Grafana on Ubuntu Server 20.04, and this time around, I’ll help you connect that newly installed platform to a MySQL database, so you can visualize that data. It’s open-source, powerful, highly configurable and free to use. Grafana is one of the most widely-used interactive data visualization tools on the market. Phil Hajjar walks you through the process of using a MySQL database as a source for data visualization in Grafana. Your support is our everlasting motiv Ubuntu 18.How to Connect Grafana to a Remote MySQL Database Monitor Apache Web Server with Prometheus and Grafana in 5 minutes Monitor Linux Server Performance with Prometheus and Grafana in 5 minutes How to monitor Linux systems with Grafana, telegraf, and InfluxDB. ![]() I’ll do a guide for how to Monitor Linux server with Prometheus, for OS metrics, before then, check similar guides below: You can then start using the dashboards on Grafana. You need to restart Grafana server to import these dashboards. Locate the directory with dashboard file and import Upload Prometheus MySQL dashboard(s) to grafana Job names should be unique for each target.Ĭreate / Import Grafana Dashboard for MySQL Prometheus exporter Let’s download MySQL_Overview dashboard which has a good overview of database performance. Add other targets using the similar format. The first server has the IP address 10.10.1.10 and the second one is 10.10.1.11. Below is an example for two MySQL database servers. $ sudo systemctl start mysql_exporter Step 7 – Configure MySQL endpoint to be scraped by Prometheus Server Login to your Prometheus server and Configure endpoint to scrape. 192.168.4.5:9104 Step 6 – When done, reload systemd and start mysql_exporter service $ sudo systemctl daemon-reload If your server has a public and private network, you may need to replace 0.0.0.0:9104 with private IP, e.g. config.my-cnf /etc/.mysqld_exporter.cnf \ Sudo vi /etc/systemd/system/mysql_rviceĮxecStart=/usr/local/bin/mysqld_exporter \ This is for systemd servers, for SysV init system, use Prometheus MySQL exporter init script for SysV init system $ 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |