初体验:数据库监控、管理和可观测性工具(PMM)

​> 本篇为快速入门,体验整个过程,后面有需要的朋友可自行深入研究,官方文档:https://docs.percona.com/percona-monitoring-and-management/index.html

本文转载来源:https://mp.weixin.qq.com/s?__biz=MzUzMTkyODc4NQ==&mid=2247486795&idx=1&sn=269b73360bb8992ecce7382aa6a0b689&chksm=faba4ef5cdcdc7e387e49a5f333f3da2e7f3c0d3558578979cf9abb70db8d5e3fc48883da039&scene=178&cur_album_id=2869345486221262853#rd

Percona Monitoring and Management(PMM)是一款开源的数据库监控、管理和可观测性解决方案,适用于MySQL、PostgreSQL和MongoDB等数据库系统。

PMM的主要功能包括:

    1. 监控数据库系统的运行状况:PMM可以收集数千个开箱即用的性能指标,从数据库及其主机获取数据,帮助用户实时了解数据库系统的运行状态。
    1. 探索数据库行为的新模式:PMM提供了丰富的数据可视化功能,在仪表板中展示数据库性能数据,帮助用户发现数据库行为的新模式,识别潜在的性能问题。
    1. 故障排除和数据库管理操作:PMM提供了故障排除工具和数据库管理操作的支持,帮助用户及时解决数据库系统的问题,并执行必要的管理操作。
    1. 跨本地和云中的数据库监控:无论数据库系统位于本地服务器还是云中,PMM都能够对其进行监控,为用户提供统一的监控和管理界面。
    1. 数据可视化:PMM的Web UI提供了直观的数据可视化功能,用户可以通过仪表板轻松地查看数据库性能指标的变化趋势和历史数据。
    1. 数据库运行状况评估顾问:PMM还提供了数据库运行状况评估顾问功能,帮助用户评估数据库系统的健康状况,并提供相关建议和优化建议。

安装docker

https://docs.docker.com/engine/install/

使用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

安装 PMM 服务器

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!

安装 PMM 客户端

在安装有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上创建用于监控的 PMM 用户

我的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加入监控:

本文转载来源:https://mp.weixin.qq.com/s?__biz=MzUzMTkyODc4NQ==&mid=2247486795&idx=1&sn=269b73360bb8992ecce7382aa6a0b689&chksm=faba4ef5cdcdc7e387e49a5f333f3da2e7f3c0d3558578979cf9abb70db8d5e3fc48883da039&scene=178&cur_album_id=2869345486221262853#rd

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值