栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

银河麒麟部署PMM

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

银河麒麟部署PMM

PMM逻辑架构图

安装server端
[root@localhost ~]# docker pull percona/pmm-server:2
2: Pulling from percona/pmm-server
2d473b07cdd5: Pull complete 
e05cef0f5a85: Pull complete 
Digest: sha256:57a7a150218e35c0126466294367c18de12fe7d4b0076ab587684cc2110691ee
Status: Downloaded newer image for percona/pmm-server:2
#创建数据卷容器
[root@localhost ~]# docker create --volume /srv --name pmm-data percona/pmm-server:2 /bin/true
8caf217e44cf0cf18c5342c917e333375ef266378a243b5fc378e75b0c2779d4
#运行server容器,防火墙放行映射的端口
[root@localhost ~]# docker run -d -p 443:443 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
47ebbbcdb79016e94caf79a3c585cf96424df2f160e322b6a55ed31fe328a85a
安装client端(server端必须通过容器部署,client端可以通过容器或者二进制包部署)
[root@localhost ~]# yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum install pmm2-client
[root@localhost ~]# pmm-admin --version
ProjectName: pmm-admin
Version: 2.25.0
PMMVersion: 2.25.0
Timestamp: 2021-12-13 09:38:36 (UTC)
FullCommit: 4b81157ad02975c417daef2600cb0dcd3907ffa1
向server注册(注册强制TLS连接,默认使用443端口注册,如果需要使用其它端口,在server端IP地址后面指定端口号)
#PMM默认管理员admin@admin
[root@localhost ~]# pmm-admin config --server-insecure-tls --server-url=https://admin:admin@172.16.200.12
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.
创建数据库用户,赋权
MariaDB [(none)]> CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_ConNECTIONS 10;
Query OK, 0 rows affected (0.016 sec)

MariaDB [(none)]> GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.004 sec)
添加监控数据源performance schema

#修改配置文件,启用performance schema
[root@localhost ~]# vim /etc/my.cnf.d/mariadb-server.cnf
performance_schema=ON
[root@localhost ~]# systemctl restart mariadb.service 
[root@localhost ~]# mysql -uroot -ppassword
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 19
Server version: 10.3.9-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> SHOW VARIABLES LIKE 'performance_schema';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| performance_schema | ON    |
+--------------------+-------+
1 row in set (0.001 sec)
#添加监控服务
[root@localhost ~]# pmm-admin add mysql --query-source=perfschema --username=pmm --password=pass --service-name=MYSQL_NODE --host=127.0.0.1 --port=3306
MySQL Service added.
Service ID  : /service_id/e74ada1c-44ed-4cf6-b3bf-ba0b37ca4f2d
Service name: MYSQL_NODE

Table statistics collection enabled (the limit is 1000, the actual table count is 307).

[root@localhost ~]# pmm-admin inventory list services
Services list.

Service type           Service name         Address and Port  Service ID
MySQL                  MYSQL_NODE           127.0.0.1:3306    /service_id/e74ada1c-44ed-4cf6-b3bf-ba0b37ca4f2d
PostgreSQL             pmm-server-postgresql 127.0.0.1:5432    /service_id/7b3fc98e-3e6e-4e46-865c-85fd207ab42e

组件间数据流

参考文献

https://www.percona.com/doc/percona-monitoring-and-management/2.x/index.html

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/728145.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号