Earlier we talked about using Prometheus to monitor server status; today we use Prometheus to monitor databases.
Install the configuration
-
Download mysqLD_exporter from mysqLD_exporter and upload it to the server.
-
Modify the EXPORTER configuration. Create the.my. CNF file in the root directory and enter the mysql access parameters
[client]
host = 192.168.249.129
user = root
password = 000000
Copy the code
Run the following shell command to install and start the installation
Tar ZXVF mysqLD_bull-0.12.linux-amd64.tar. gz MV node_exporters 0.18.1.linux-amd64 mysqLD_bull-nohup ./mysqld_exporter --web.listen-address=":9200" &Copy the code
Activation is completed, a browser open http://192.168.249.129:9200/ access, display effect is as follows:
- Modify Prometheus configuration in Prometheus
scrape_configs
Add mysql listener address to mysql.sql
- job_name: 'mysql29'
static_configs:
- targets: ['192.168.249.129:9200']
Copy the code
Monitoring report
-
Look for Mysql’s monitoring dashboard MySQL_Overview on grafana’s website and import it into Grafana.
-
Viewing the Monitoring Effect
For more content, please pay attention to the public number: JAVA Daily Records