posts - 159,  comments - 0,  views - 11万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

1、Docker、Docker-Compose安装

1
2
https://www.cnblogs.com/a120608yby/p/9883175.html
https://www.cnblogs.com/a120608yby/p/14582853.html

2、基于Docker-Compose部署PMM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# vim docker-compose.yml
version: '3'
 
services:
  pmm-server:
    image: percona/pmm-server:latest
    container_name: pmm-server
    cap_add:
      - SYS_PTRACE
    security_opt:
      - seccomp:unconfined
    ulimits:
      memlock: 67108864
    ports:
      - '80:80'
      - '443:443'
      - '2345:2345'
      - '15432:5432'
      - '9090:9090'
      - '11000:9000'
      - '11123:8123'
    networks:
      - ops_default
    restart: always
    volumes:
      - ./pmm-data:/srv
 
networks:
  ops_default:
    external: true

3、启动服务

1
docker compose up -d

4、查看服务启动状态

1
docker compose ps

5、访问

1
2
3
访问地址:https://部署主机的IP/
默认账号:admin
默认密码:admin

6、PMM Client安装

1
2
3
4
5
# 下载
https://docs.percona.com/percona-monitoring-and-management/setting-up/server/docker.html
 
# 安装
dnf localinstall /usr/local/src/pmm2-client-2.41.0-6.el9.x86_64.rpm -y

7、配置连接PMM Server

1
2
3
4
5
6
7
8
9
10
# pmm-admin config --server-insecure-tls --server-url=https://admin:admin@部署主机IP/
Checking local pmm-agent status...
pmm-agent is running.
Registering pmm-agent on PMM Server...
Registered.
Configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml updated.
Reloading pmm-agent configuration...
Configuration reloaded.
Checking local pmm-agent status...
pmm-agent is running.

8、配置MySQL监控用户

1
2
> CREATE USER 'pmm'@'127.0.0.1' IDENTIFIED BY 'password';
> GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'127.0.0.1';

9、将MySQL添加到PMM中

1
2
3
4
5
6
# pmm-admin add mysql --username pmm --password 'password' demo-mysql8 localhost:3306
MySQL Service added.
Service ID  : /service_id/539ff836-d99b-491f-a0bf-379eb28b1c69
Service name: demo-mysql8
 
Table statistics collection enabled (the limit is 1000, the actual table count is 330).

10、查看添加的服务

1
2
3
4
5
6
7
8
9
10
# pmm-admin list
Service type        Service name        Address and port        Service ID
MySQL               demo-mysql8         localhost:3306          /service_id/539ff836-d99b-491f-a0bf-379eb28b1c69
 
Agent type                 Status           Metrics Mode        Agent ID                                              Service ID                                              Port
pmm_agent                  Connected                            /agent_id/140e73b3-6401-4dd9-8e84-b3e85d92eb89                                                                0
node_exporter              Running          push                /agent_id/e58886b6-17c9-49b7-9bcf-83e809504b03                                                                42000
mysqld_exporter            Running          push                /agent_id/d577b7a6-b2d9-4819-8cfe-d78eefbc6cfb        /service_id/539ff836-d99b-491f-a0bf-379eb28b1c69        42002
mysql_slowlog_agent        Running                              /agent_id/00c437ab-5099-4582-aec6-866c99812c4d        /service_id/539ff836-d99b-491f-a0bf-379eb28b1c69        0
vmagent                    Running          push                /agent_id/f85813fc-2d69-4d21-ae05-1f47006937ba                                                                42001

11、查看服务监控

参考:

1
2
https://docs.percona.com/percona-monitoring-and-management/setting-up/server/docker.html
https://www.percona.com/software/pmm/quickstart

  

posted on   a120608yby  阅读(263)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
历史上的今天:
2018-12-12 Win7 远程桌面:发生身份验证错误
点击右上角即可分享
微信分享提示