Develop Paper
  • Program
  • Server
  • Development Tool
  • Blockchain
  • Database
  • Artificial Intelligence
  • Blogs
Position: Home > Database > Content

Prometheus architecture from introduction to practice (6) — monitoring various indicators of MySQL service

Time:2022-5-16

1. Download the metric indicator collection plug-in of mysqld

Official website address

      https://github.com/prometheus/mysqld_exporter/releases/

mysqld_ Exporter acquisition and decompression

      # wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gz

      # tar zxf mysqld_exporter-0.12.1.linux-amd64.tar.gz

2. Create an account for Prometheus to collect data in MySQL

mysql> create user ‘promethues’@’localhost’ IDENTIFIED BY ‘promethues1’;

Query OK, 0 rows affected (0.00 sec)

mysql> grant select,replication client,process on *.* to ‘promethues’@’localhost’;

Query OK, 0 rows affected (0.00 sec)

※ localhost here does not refer to the IP address of mysqld service, but refers to mysqld_ The IP address of the exporter, because when the promethues service comes to mysqld to obtain data, it first finds mysqld_ Exporter, then mysqld_ The exporter goes to mysqld to get the data. So make sure mysqld_ The IP address of the exporter can connect to mysqld service.

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

3. In mysqld_ Configure MySQL information in the exporter component

      # cp -p mysqld_exporter/.my.cnf mysqld_exporter/.my.cnf.org

      # vi mysqld_exporter/.my.cnf

[client]

user=promethues

password=promethues1

4. Start mysqld_ Exporter component, configure promethues YML, and specify the MySQL account information file

      # ./mysqld_exporter –help

      # nohup ./mysqld_exporter –web.listen-address=”:9104″ –config.my-cnf=”.my.cnf” &> /dev/null  &

##Add the following configuration: VIM Prometheus yml

– job_name: ‘mysqld’

    static_configs:

    – targets: [‘localhost:9104’]

5. Add mysqld template in grafana

Grafana finds MySQL related templates and imports them by referring to and signing Josn files to generate dashboards

Prometheus architecture from introduction to practice (6) -- monitoring various indicators of MySQL service

Tags: Account number, assembly, file, Plug-in unit, template

Recommended Today

Centos8 system, how to beautify the desktop effect

CentOS, one of the Linux distributions, is compiled from the source code released by Red Hat Enterprise Linux according to the open source regulations. In other words, CentOS is a Linux system. It is a POSIX based multi-user, multi tasking, multi threading and multi CPU operating system. As a server, RHEL is indeed more secure […]

  • R for Data Science (notes) — data sorting (sorting and merging)
  • MySQL’s faster drop table method for deleting large tables
  • Big data Hadoop — computing engine spark
  • Mybatis source code – load mapping file and dynamic agent
  • CIO / CTO must read 𞓜 how much do you know about enterprise storage expenditure in the era of digital transformation
  • [serial] how to master the core technology of opengauss database? Secret 4: handle the transaction mechanism (3)
  • Talk about claudib’s database
  • Map type: support for dynamic fields in Clickhouse
  • MySQL lock learning notes!
  • Mybatis plus prints beautified SQL statements with p6spy console
Pre: Monibuca, an open source streaming media server development framework implemented in go language, helps you solve streaming media problems
Next: Centos8 system, how to beautify the desktop effect

    Tags

    address algorithm array assembly attribute Browser c Catalog Character string Client code command configuration file container data Database Definition Edition element Example file function java javascript Journal link linux Memory method Modular mysql node object page parameter php Plug-in unit project python Route source code The server Thread time user

    Recent Posts

    • Centos8 system, how to beautify the desktop effect
    • Prometheus architecture from introduction to practice (6) — monitoring various indicators of MySQL service
    • Monibuca, an open source streaming media server development framework implemented in go language, helps you solve streaming media problems
    • H5 authorize wechat third party login
    • Audio and video quick start

    Recent Comments

    • Coca Cola Zizi on Answer for How to keep two decimal places (without rounding) in JavaScript
    • Niu Shushu on Answer for How to keep two decimal places (without rounding) in JavaScript
    • Plasiqiang on Answer for How to keep two decimal places (without rounding) in JavaScript
    • izengx on Answer for How to keep two decimal places (without rounding) in JavaScript
    • feikerwu on Answer for How to keep two decimal places (without rounding) in JavaScript

    Categories

    • .NET Core
    • Agile Development
    • Algorithm And Data Structure
    • Android
    • Apple MAC
    • Architecture Design
    • Artificial Intelligence
    • ASP.NET
    • Backend
    • Blockchain
    • C
    • C#
    • C++
    • Cloud
    • Database
    • Design Pattern
    • Development Tool
    • Embedded
    • Erlang
    • Freshman
    • Game
    • Golang
    • HTML/CSS
    • HTML5
    • Informal Essay
    • Information Security
    • IOS
    • Java
    • JavaScript
    • JSP
    • Linux
    • Lua
    • MongoDB
    • MsSql
    • MySql
    • Network Security
    • OOP
    • oracle
    • Other DB
    • Other Technologies
    • Other Technology
    • Perl
    • PHP
    • Program
    • Python
    • Redis
    • Regular Expression
    • Ruby
    • Rust
    • SAP
    • Server
    • Software Testing
    • Team Management
    • VBS
    • VUE
    • WEB Front End
    • Windows
    • XML/XSLT
  • java
  • php
  • python
  • linux
  • windows
  • android
  • ios
  • mysql
  • html
  • .net
  • github
  • node.js

Copyright © 2022 Develop Paper All Rights Reserved      Sitemap    About DevelopPaper    Privacy Policy    Contact Us