MySQL企业版工具——使用MySQL Enterprise Monitor监控MySQL数据库和主机---发表到爱可生开源社区

简介: MySQL在企业版里的有个工具MySQL Enterprise Monitor,可以用于监控MySQL实例和主机性能。现实验如下

MySQL在企业版里的有个工具MySQL Enterprise Monitor,可以用于监控MySQL实例和主机性能。现实验如下:

安装

下载

image.png

到https://edelivery.oracle.com/ 网站下软件:



安装服务端

unzip mysql_monitor.zip 
 ./mysqlmonitor-8.0.20.1237-linux-x86_64-installer.bin scutech@scutech:~/install$ ll
total 2819608
drwxrwxr-x  2 scutech scutech       4096 Jun  1 23:45 ./
drwxr-xr-x 30 scutech scutech       4096 Jun  1 23:43 ../
-rw-r-xr--  1 scutech scutech        975 Apr 23 05:50 README_en.txt*
-rw-r-xr--  1 scutech scutech        975 Apr 23 05:51 READ_ME_ja.txt*
-rw-r--r--  1 scutech scutech    6370627 Apr 22 08:14 monitor.a4.pdf
-rw-r--r--  1 scutech scutech    6377434 Apr 22 08:13 monitor.pdf
-rw-r--r--  1 scutech scutech    5277767 Apr 22 08:12 mysql-monitor-html.tar.gz
-rw-r--r--  1 scutech scutech    5302202 Apr 22 08:12 mysql-monitor-html.zip
-rw-r--r--  1 scutech scutech 1297382933 Jun  1 23:44 mysql_monitor.zip
-rw-r--r--  1 scutech scutech  270694162 Jun  1 23:44 mysql_monitor_agent.zip
-rwxrwxr-x  1 scutech scutech  647902090 Apr 22 12:26 mysqlmonitor-8.0.20.1237-linux-x86_64-installer.bin*
-rwxrwxr-x  1 scutech scutech  647923832 Apr 22 12:35 mysqlmonitor-8.0.20.1237-linux-x86_64-update-installer.bin*
 ./mysqlmonitor-8.0.20.1237-linux-x86_64-installer.bin


运行上面的命令后出现下面的画面:

image.png

选择小型模式

image.png

使用安装软件自带的MySQL数据库作为repository数据库

image.png

这个用户(service_manager)和密码等相关信息要记录下来。

image.png

提示下面的信息,其中提到的root用户是OS的用户,不是mysql的用户:

You have not installed the MySQL Enterprise Monitor as the root user. Therefore it could not be configured to auto-start on reboot. See the Installation section of the MySQL Enterprise Monitor documentation for instructions on how to do this manually.

开始安装:

image.png

安装完成提示:


Setup has completed installing the MySQL Enterprise Monitor files on your computer
Uninstalling the MySQL Enterprise Monitor files can be done by invoking:
/home/scutech/mysql/enterprise/monitor/uninstall
To complete the installation, launch the MySQL Enterprise Monitor UI and complete the initial setup. Refer to the readme file for additional information and a list of known issues.
Please press next to launch the Monitor UI.


管理脚本

usage: ./mysqlmonitorctl.sh help
       ./mysqlmonitorctl.sh (start|stop|status|restart)
       ./mysqlmonitorctl.sh (start|stop|status|restart) mysql
       ./mysqlmonitorctl.sh (start|stop|status|restart) tomcat
help       - this screen
start      - start the service(s)
stop       - stop  the service(s)
restart    - restart or start the service(s)
status     - report the status of the service(s)


使用下面的链接可以访问MySQL Enterprise Monitor https://192.168.???.???:18443

用户 sc_manager


安装客户端

客户端分两种,第一种是在客户端安装被监控的机器上(The architecture of a typical MySQL Enterprise Monitor installation),架构见下图:

image.png

第二种是不在被监控的机器上安装任何软件(Agentless Architecture),架构见下图:

image.png

这两者的对比:


从架构上看二者区别非常明显,一个有agent,另一个没有agent;

没有agent的方式用起来方便,配置IP地址,用户,密码等连接方式后直接就可以用了;

没有agent的方式不能监控主机上非MySQL的信息,而有agent的方式可以;

从性能的角度考虑,推荐使用有agent的方式。

下面是安装一个没有agent的客户端的例子:

image.png


使用

概览(overview)

image.png

从overview中可以看到被监控对象的大概情况,设置是点击右上角的齿轮。这是有agent的监控概览,包括了主机的信息,例如磁盘读写,内存使用等。没有agent的监控只有数据库的信息,如下图:

image.png


事件(event)

超过阀值的事件会在这里列出,阀值的配置在configuration->advisor里面,可以关闭的事件点击最右边action下面的叉叉符合即可关闭。

image.png


指标(metrics)

这里有很多衡量被监控对象的指标,这里列举比较有用的几例:

image.png




查询分析(Query Analyzer)

查询分析的数据来自 Performance Schema Statement Digests 特性Performance Schema Statement Digests and Sampling,早于MySQL 5.6.14的版本不支持这个特性。

被分析的语句的长度不能超过下面的参数,否则截断


$ mysqladmin variables|grep max_digest_leng
| max_digest_length                                        | 1024                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| performance_schema_max_digest_length                     | 1024                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |


注意:第一个参数max_digest_length是session级别的,而第二个performance_schema_max_digest_length是语句级别的,只对performance_schema起作用。

MySQL Enterprise Monitor Agent每分钟收集一次表performance_schema.events_statements_summary_by_digest,这个表由下面的参数statements_digest 决定是否激活,默认是激活的:


mysql> SELECT * FROM performance_schema.setup_consumers WHERE name = 'statements_digest';
+-------------------+---------+
| NAME              | ENABLED |
+-------------------+---------+
| statements_digest | YES     |
+-------------------+---------+
1 row in set (0.00 sec)


监控的样图如下:

image.png

在每个SQL statement后面有细节选项,点击进入可看这个SQL statement的细节:

image.png

当看这个SQL statement的例子的时候,可能因为配置的原因没有显示,这时会有下面的提示:

image.png

设置正确后会出现下面的画面:


image.png

image.png

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。   相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情: https://www.aliyun.com/product/rds/mysql 
相关文章
|
存储 关系型数据库 MySQL
在CentOS 8.x上安装Percona Xtrabackup工具备份MySQL数据步骤。
以上就是在CentOS8.x上通过Perconaxtabbackup工具对Mysql进行高效率、高可靠性、无锁定影响地实现在线快速全量及增加式数据库资料保存与恢复流程。通过以上流程可以有效地将Mysql相关资料按需求完成定期或不定期地保存与灾难恢复需求。
946 10
|
关系型数据库 MySQL 数据库连接
数据库连接工具连接mysql提示:“Host ‘172.23.0.1‘ is not allowed to connect to this MySQL server“
docker-compose部署mysql8服务后,连接时提示不允许连接问题解决
646 69
|
canal 关系型数据库 MySQL
MySQL 自动同步开源工具
本文介绍了几种开源工具用于实现 MySQL 数据库的自动同步。
|
Oracle 关系型数据库 MySQL
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
716 1
|
SQL 关系型数据库 MySQL
MySQL 窗口函数详解:分析性查询的强大工具
MySQL 窗口函数从 8.0 版本开始支持,提供了一种灵活的方式处理 SQL 查询中的数据。无需分组即可对行集进行分析,常用于计算排名、累计和、移动平均值等。基本语法包括 `function_name([arguments]) OVER ([PARTITION BY columns] [ORDER BY columns] [frame_clause])`,常见函数有 `ROW_NUMBER()`, `RANK()`, `DENSE_RANK()`, `SUM()`, `AVG()` 等。窗口框架定义了计算聚合值时应包含的行。适用于复杂数据操作和分析报告。
928 11
|
SQL 分布式计算 关系型数据库
Hadoop-21 Sqoop 数据迁移工具 简介与环境配置 云服务器 ETL工具 MySQL与Hive数据互相迁移 导入导出
Hadoop-21 Sqoop 数据迁移工具 简介与环境配置 云服务器 ETL工具 MySQL与Hive数据互相迁移 导入导出
551 3
|
缓存 关系型数据库 BI
使用MYSQL Report分析数据库性能(下)
使用MYSQL Report分析数据库性能
709 158
|
关系型数据库 MySQL 数据库
自建数据库如何迁移至RDS MySQL实例
数据库迁移是一项复杂且耗时的工程,需考虑数据安全、完整性及业务中断影响。使用阿里云数据传输服务DTS,可快速、平滑完成迁移任务,将应用停机时间降至分钟级。您还可通过全量备份自建数据库并恢复至RDS MySQL实例,实现间接迁移上云。
|
关系型数据库 MySQL 数据库
阿里云数据库RDS费用价格:MySQL、SQL Server、PostgreSQL和MariaDB引擎收费标准
阿里云RDS数据库支持MySQL、SQL Server、PostgreSQL、MariaDB,多种引擎优惠上线!MySQL倚天版88元/年,SQL Server 2核4G仅299元/年,PostgreSQL 227元/年起。高可用、可弹性伸缩,安全稳定。详情见官网活动页。
1863 152
|
关系型数据库 MySQL 数据库
阿里云数据库RDS支持MySQL、SQL Server、PostgreSQL和MariaDB引擎
阿里云数据库RDS支持MySQL、SQL Server、PostgreSQL和MariaDB引擎,提供高性价比、稳定安全的云数据库服务,适用于多种行业与业务场景。
1272 156

热门文章

最新文章

推荐镜像

更多