15.3.1 添加MySQL实例

本节介绍如何监控 MySQL 实例。

连接设置

连接设置选项卡

图 15.1 添加实例连接设置

内容在周围的文字中描述。

表 15.5 连接设置选项卡

姓名 描述

监控自

从代理列表中选择一个代理来监视此 MySQL 数据库实例。

建议为每台主机安装一个 Agent,并使用该 Agent 监控其所有 MySQL 实例。

通过指定 TCP/IP 和实例地址127.0.0.1 将代理设置为本地连接,或使用套接字文件。如果Host上没有本地Agent,又无法安装,可以使用内置或其他Agent进行远程监控。

笔记

如果实例受到远程监控,则无法检索主机上的任何信息。要监视主机,必须在该主机上安装代理。

连接使用

选择 TCP/IP 或套接字以连接到实例。套接字连接只能用于与目标实例安装在同一台机器上的代理,并且不适用于在 Windows 上运行的实例。

实例地址端口

实例正在侦听的 IP 地址或有效主机名和端口号。如果选择的主机/代理是该实例的本地主机,则应在此处使用 127.0.0.1。

管理员用户密码

root 用户,或具有在 创建管理员用户 和密码中定义的权限的用户。

自动创建低权限用户

选择是以在 MySQL 实例上创建普通用户和受限用户。您必须为两者添加用户名和密码。有关这些用户的更多信息,请参阅第 5.2 节 “为 Monitor Agent 创建 MySQL 用户帐户”

如果您打算使用管理员用户收集所有数据,请选择否。

笔记

强烈建议使用普通用户和受限用户。

General User and Password

Add a user name and password for the General User.

Limited User and Password

Add a user name and password for the Limited User.


Encryption Settings

Figure 15.2 Add Instance Encryption Settings

内容在周围的文字中描述。

Table 15.6 Encryption Settings Tab

Name Description

Require Encryption

Defines whether the connection uses TLS for security.

Allow Self-Signed Certificates

Specifies whether the connection permits self-signed certificates.

CA Certificate

Paste the CA certificate's contents here.

Note

This is not required if you are using a self-signed certificate.


Advanced Settings

Figure 15.3 Add Instance Advanced Settings

内容在周围的文字中描述。

Table 15.7 Advanced Settings

Name Description

Discover Replication Topologies

Specifies whether the agent attempts to discover if the instance is part of a replication group and discover the other members of that replication group.

When performing replication topology discovery, the agent attempts to read the slave's master.info, and use the stored credentials to log in to the master to read its inventory table and retrieve the master's UUID.

If set to No, no replication discovery is attempted.

MySQL Identity Source

Choose the mechanism used to generate a unique identity for the MySQL instance if one does not already exist.

  • Default: uses either the server_uuid variable if present, or generates a random new UUID

  • Host Plus Datadir generates a hash of the host identity and the path to the MySQL instances data directory to create a unique identity.

    Note

    Host Plus Datadir can be used only if the agent is running on the same host as the MySQL instance for this connection.

Inventory Table Schema

When the Agent connects to the MySQL Instance, it creates an inventory table, if one does not already exist, and stores two rows within it: a generated Instance UUID, and the host ID.

By default this is created within the mysql database. On shared hosts or cloud environments this may not be accessible to the Agent user; provide a database name to override where the inventory table is created.

Connection Timeout

JDBC 驱动程序使用的连接超时(以毫秒为单位)。

套接字超时

JDBC 驱动程序使用的套接字超时(以毫秒为单位)。


群组设置

输入要将实例添加到的组。也可以在此字段中定义新组。

笔记

要添加组,您至少 必须将Server Group权限设置为 Read-Only 。

要创建新组,您必须将New Group Creation权限设置为 Administer