Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Pmm deployment monitoring mysql database

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

For more information on deployment, please refer to the official documentation:

Https://www.percona.com/doc/percona-monitoring-and-management/deploy/server/docker.setting-up.html#pmm-server-docker-image-pulling

1. Server deployment:

1. Monitor machine installation docker:

Ip:192.168.56.101

Operating system version:

[root@my-mm ~] # cat / etc/centos-release

CentOS Linux release 7.5.1804 (Core)

Installation:

Yum install-y docker

Start:

Systemctl start docker

Systemctl enable docker

two。 Pull the PMM server image:

Docker pull percona/pmm-server:latest

[root@my-mm ~] # docker pull percona/pmm-server:latest

Trying to pull repository docker.io/percona/pmm-server...

Latest: Pulling from docker.io/percona/pmm-server

Aeb7866da422: Pull complete

904d1ed4e1e3: Pull complete

Digest: sha256:5eb0fe89d2e93198e7070e92f22cdd95fcef5db257f70a3e05071685f2503a56

Status: Downloaded newer image for docker.io/percona/pmm-server:latest

3. Create an PMM data container:

Docker create\

-v / opt/prometheus/data\

-v / opt/consul-data\

-v / var/lib/mysql\

-v / var/lib/grafana\

-- name pmm-data\

Percona/pmm-server:latest / bin/true

[root@my-mm ~] # docker create\

>-v / opt/prometheus/data\

>-v / opt/consul-data\

>-v / var/lib/mysql\

>-v / var/lib/grafana\

>-- name pmm-data\

> percona/pmm-server:latest / bin/true

8448b22b99f7d667f6bfa9dcc78a4e662aed57a4d36473061d2533afa6c3e515

4. Create and run PMM Server Container:

Docker run-d-p 80:80-volumes-from pmm-data-name pmm-server-restart always percona/pmm-server:latest

[root@my-mm] # docker run-d-p 80:80-- volumes-from pmm-data-- name pmm-server-- restart always percona/pmm-server:latest

56372ece726b9e61f29d2f0dd1e72a5353237015997f2e7637a7164b05f38727

Check the docker status:

[root@my-mm ~] # docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

56372ece726b percona/pmm-server:latest "/ opt/entrypoint.sh" 28 seconds ago Up 27 seconds 0.0.0.0 seconds ago Up 80-> 80/tcp, 443/tcp pmm-server

5. Login:

Http://192.168.56.101

The default login information is as follows, which can be modified by yourself:

Username:admin password:admin

Login interface:

2. Client deployment:

6. Deploy the software on the client side and install pmm-client on the MySQL server that needs to be monitored:

Client information (192.168.56.102)

Add a yum source (or download the installation package):

Rpm-ivh https://www.percona.com/redir/downloads/percona-release/redhat/latest/percona-release-0.1-6.noarch.rpm

Install pmm-client:

Yum install pmm-client-y

Uninstall the software:

Yum remove pmm-client-y

6. Add Monitoring:

The client connects to pmm server and configures the monitoring server:

Pmm-admin config-server 192.168.56.101

Add operating system monitoring:

[root@my2 ~] # pmm-admin add linux:metrics

OK, now monitoring this system.

Create a user on top of the database to be monitored:

GRANT ALL PRIVILEGES ON *. * TO 'pmm-monitor'@'%' IDENTIFIED BY' pmm-monitor'

Flush privileges

Add mysql Monitoring:

Pmm-admin add mysql-user pmm-monitor-password pmm-monitor-host 192.168.56.102-port 3306

[root@my2] # pmm-admin add mysql-user pmm-monitor-password pmm-monitor-host 192.168.56.102-port 3306

[linux:metrics] OK, already monitoring this system.

[mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm-monitor:***@tcp (192.168.56.102)

[mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN pmm-monitor:***@tcp (192.168.56.102)

View the added mysql monitoring information on the web page:

The client views monitoring information:

[root@my2 ~] # pmm-admin list

Pmm-admin 1.16.0

PMM Server | 192.168.56.101

Client Name | my2.ml.com

Client Address | 192.168.56.102

Service Manager | linux-upstart

-

SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS

-

Mysql:queries my2.ml.com-YES pmm-monitor:***@tcp (192.168.56.102 query_source=slowlog) query_source=slowlog, query_examples=true, slow_log_rotation=true, retain_slow_logs=1

Linux:metrics my2.ml.com 42000 YES-

Mysql:metrics my2.ml.com 42002 YES pmm-monitor:***@tcp (192.168.56.102 3306)

The default monitoring display is displayed as the name of the host. If multiple mysql are deployed on the machine or the hostname to be displayed needs to be specified:

Pmm-admin config-- server 192.168.56.101 client-name # client-name is the specified monitor display name client-name

For example:

Pmm-admin add mysql--user pmm-monitor-password 'pmm-monitor'-socket=/data/mysql_3317/data/mysql.sock mysql-3307

Clear monitoring data:

Pmm-admin purge prompts for help, as shown in the following example:

Pmm-admin purge linux:metrics my2.ml.com

Pmm-admin purge mysql:metrics my2.ml.com

Delete the added monitoring item:

Pmm-admin remove mysql:metrics my2.ml.com

Entering pmm-admin directly displays all the help information:

[root@my2 ~] # pmm-admin

Usage:

Pmm-admin [flags]

Pmm-admin [command]

Available Commands:

Config Configure PMM Client.

Add Add service to monitoring.

Annotate Annotate application events.

Remove Remove service from monitoring.

List List monitoring services for this system.

Info Display PMM Client information (works offline).

Check-network Check network connectivity between client and server.

Ping Check if PMM server is alive.

Start Start monitoring service.

Stop Stop monitoring service.

Restart Restart monitoring service.

Show-passwords Show PMM Client password information (works offline).

Purge Purge metrics data on PMM server.

Repair Repair installation.

Uninstall Removes all monitoring services with the best effort.

Summary Fetch system data for diagnostics.

Help Help about any command

Flags:

-c,-- config-file string PMM config file (default "/ usr/local/percona/pmm-client/pmm.yml")

-h,-- help help for pmm-admin

-- skip-root skip UID check (experimental)

-- timeout duration timeout (default 5s)

-- verbose verbose output

-v,-- version show version

Use "pmm-admin [command]-help" for more information about a command.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report