本篇为快速入门,体验整个过程,后面有需要的朋友可自行深入研究,官方文档:https://docs.percona.com/percona-monitoring-and-management/index.html
Percona Monitoring and Management(PMM)是一款开源的数据库监控、管理和可观测性解决方案,适用于MySQL、PostgreSQL和MongoDB等数据库系统。
PMM的主要功能包括:
使用rpm存储库安装Docker Engine、containerd 和 Docker Compose
# 设置存储库
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# 开始安装
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
systemctl start docker
systemctl enable docker
docker run hello-world
# (可选)要安装特定版本,可以先列出存储库:
yum list docker-ce --showduplicates | sort -r
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin
curl -fsSL https://www.percona.com/get/pmm | /bin/bash
# 安装完成后,将显示有关如何访问界面的信息以及默认凭据,如下:
Gathering/downloading required components, this may take a moment
Checking docker installation - installed.
Starting PMM server...
Created PMM Data Volume: pmm-data
Created PMM Server: pmm-server
Use the following command if you ever need to update your container by hand:
docker run -d -p 443:443 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
PMM Server has been successfully setup on this system!
You can access your new server using one of the following web addresses:
https://127.0.0.1:443/
https://192.168.88.16:443/
https://172.17.0.1:443/
The default username is 'admin' and the password is 'admin' :) # 这里提示默认的用户名和密码均为admin
Note: Some browsers may not trust the default SSL certificate when you first open one of the urls above.
If this is the case, Chrome users may want to type 'thisisunsafe' to bypass the warning.
Enjoy Percona Monitoring and Management!
在安装有mysql的机器上安装pmm客户端
# 下载并安装 Percona Repo 软件包
yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
# 安装 Percona 监控和管理客户端
yum install pmm2-client -y
注册 PMM 客户端:
pmm-admin config --server-insecure-tls --server-url=https://admin:admin@192.168.88.16:443
我的mysql版本是 mysql Ver 8.0.27
登录数据库创建pmm用户:
CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD, BACKUP_ADMIN ON *.* TO 'pmm'@'localhost';
使用 Performance Schema 添加 MySQL 数据库:
[root@mysqldbsvr ~]# pmm-admin add mysql --username=pmm --password=pass --query-source=perfschema
截至目前,已经成功安装了基本的PMM。
打开浏览器访问,注意走的是https。
我的链接:https://192.168.88.16/graph/login
默认的用户名和密码均为:admin,首次登入会让你设置新的密码。
我之前添加了两台mysql加入监控:
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。