Possible MySQL server UUID duplication for server

??

在mysql enterprise monitor监控过程中出现这样的event事件,Topic: Possible MySQL server UUID duplication for server 事件,从该提示的描述来看貌似是存在重复的uuid,而实际上主从关系并不存在重复的uuid。主从关系是通过xtrabackup来构建的。那到底是哪里的问题呢?下文是描述基于xtrabackup复制时导致监控出现重复uuid的问题。

1、故障现象
Topic: Possible MySQL server UUID duplication for server afd6bca4-6636-11e3-9d60-74867ae1c47c: NOTICE
Categories:Monitoring and Support Services
Current State:Open
Auto-Closes by Default:Yes
Advisor:Duplicate MySQL Server UUID
Current Status:Notice
Last Checked:May 4, 2015 2:18:02 PM

###提示uuid改变了N多次,在MySQL Instances监控见面会出现这2个主机配置在不停的切换中
MySQL server afd6bca4-6636-11e3-9d60-74867ae1c47c changed its hostname 181 times between the following hostnames:
DBSRV-TXT01
DBSRV-SLAVE02

MySQL server afd6bca4-6636-11e3-9d60-74867ae1c47c changed its connection TCP properties 96 times between the following TCP properties:

127.0.0.1:3306
127.0.0.1:3307

Advice
Check that you are not monitoring more than one instance with the following server UUID: afd6bca4-6636-11e3-9d60-74867ae1c47c.
This can be caused by server or host cloning. If this is expected (example: HA scenarios), then please ignore this notice.

2、校验uuid
###经google文章描述,mysql.inventory保存了被mysql enterpirse moitor监控用到的uuid信息
###查看主库上的uuid及mysql.inventory表
[[email protected] ~]# mysql -uroot -p -e "
show variables like ‘server_uuid‘;
select * from mysql.inventory;" -S /tmp/mysql3307.sock
Enter password:
+---------------+--------------------------------------+
| Variable_name | Value                                |
+---------------+--------------------------------------+
| server_uuid   | 1ed85852-dd27-11e4-aa4a-44a8420ba7a5 |
+---------------+--------------------------------------+
+--------+-------------------------------------------------------+
| name   | value                                                 |
+--------+-------------------------------------------------------+
| uuid   | afd6bca4-6636-11e3-9d60-74867ae1c47c                  |
| hostid | ssh:{8a:c7:a9:42:3a:6b:06:ad:fa:ed:04:ac:a5:fa:f0:b5} |
+--------+-------------------------------------------------------+

###查看从库上的uuid及mysql.inventory表
[[email protected] ~]# mysql -uroot -p -e "    ---Author : Leshami
> show variables like ‘server_uuid‘;            ---Blog   : http://blog.csdn.net/leshami
> select * from mysql.inventory;"
Enter password:
+---------------+--------------------------------------+
| Variable_name | Value                                |
+---------------+--------------------------------------+
| server_uuid   | f7e00194-2f59-11e4-bcf6-b82a72d46b21 |
+---------------+--------------------------------------+
+--------+-------------------------------------------------------+
| name   | value                                                 |
+--------+-------------------------------------------------------+
| uuid   | afd6bca4-6636-11e3-9d60-74867ae1c47c                   |
| hostid | ssh:{8a:c7:a9:42:3a:6b:06:ad:fa:ed:04:ac:a5:fa:f0:b5} |
+--------+-------------------------------------------------------+

###从上面的查询结果得知,mysql.inventory表里边确实保存了相同的uuid
###这个相同的uuid是由于使用了实例级别的热备,所以2个实例具有相同的uuid

###清空mysql.inventory,然后重启监控agent(略),问题解决
[[email protected] ~]# mysql -uroot -p -e "truncate table mysql.inventory" -S /tmp/mysql3307.sock
Enter password:

3、关于MySQL MEM UUID duplication

MySQL Enterprise Monitor uses a number of unique values known as UUIDs to identify the different components, including the MySQL instance being monitored. UUID values related to the MySQL instance and the host on which it runs are stored in a table mysql.inventory within the instance. MySQL Enterprise Monitor creates this table if it does not exist already.

  • Each MySQL Server has a UUID, stored in the mysql.inventory table, that uniquely identifies the MySQL server to the rest of MEM. The server UUID is used to collate information about a single MySQL instance.
  • Each host (the machine on which the agent is running) has a UUID to uniquely identify the host to the rest of MySQL Enterprise Monitor. This is used to collate the OS information (such as CPU, RAM and disk data). The host ID also determines whether the MySQL server is on the same host as it was before, to identify when data has been moved between machines, or when a machine has been upgraded. The host UUID is stored within the hostid row within the mysql.inventory table.
  • Each agent has a UUID to identify the agent to MEM. The agent UUID is defined within the agent-uuid parameter within the agent configuration file.

These UUIDs are used in combination to register and collate information, and to determine the location and source of an issue.

Note

Because each host must be unique, be careful when restoring from a backup so you do not have hosts with duplicated SSH keys or UUIDs.

http://dev.mysql.com/doc/mysql-monitor/2.3/en/mem-introduction-mysql-server.html

The MySQL Enterprise Monitor Agent and MySQL Enterprise Service Manager use the unique host ID, stored within the mysql.inventory table on the monitored MySQL Server, to determine whether the instance being monitored is a clone. The host ID of the current server is checked against the stored value when the agent starts. If the generated host ID and stored host ID do not match, you get an error similar to the following in the agent log file:

%s: [%s] the hostid from mysql.inventory doesn‘t match our agent‘s host-id (%s != %s)
We assume that this is a cloned host and shutdown now.
Please TRUNCATE TABLE mysql.inventory on this mysql-instance and restart the agent.
If this is a master for replication, please also run SET SQL_LOG_BIN = 0; first.

To fix the problem, connect to the MySQL server using the credentials configured when you installed the agent, and then truncate the mysql.inventory table:

mysql> TRUNCATE mysql.inventory;

Now restart the agent, which recreates the mysql.inventory table with the updated instance UUID and hostid information.

http://dev.mysql.com/doc/mysql-monitor/2.3/en/mem-troubleshooting-agent-start.html

??

时间: 2024-10-10 10:38:54

Possible MySQL server UUID duplication for server的相关文章

MySQL 之 导入外部SQL Server数据

在上一篇博客<MySQL 之 5.6.22安装教程>中,我们介绍了MySQL的安装.今天我们主要讲解一下怎么在MySQL中导入外部SQL Server数据,简而言之就是我们怎么将SQL Server数据库中的数据迁移到MySQL数据库中. 为了实现我们想要的数据迁移,我们首先需要下载一个小工具SQLyog,然后安装到我们的电脑上,接下来我们就一步一步用这个小工具开始我们的数据迁移: 首先看看我们SQL Server数据库中的表结构和表中的数据 打开SQLyog,设置数据连接: 创建跟SQL S

MySQL、Oracle和SQL Server的分页查询语句

原文地址:http://www.cnblogs.com/ginponson/p/5746435.html 假设当前是第PageNo页,每页有PageSize条记录,现在分别用Mysql.Oracle和SQL Server分页查询student表. 1.Mysql的分页查询 SELECT * FROM student LIMIT (PageNo - 1) * PageSize,PageSize; 理解:(Limit n,m)  =>从第n行开始取m条记录,n从0开始算. 2.Oracel的分页查询

连接mysql时报:message from server: &quot;Host &#39;192.168.76.89&#39; is not allowed to connect to this MySQL server

处理方案: 1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where user = 'root';  发现,host的值就是localhost. 所以将它的值改掉:update user set host='%' where user = 'root'; 3.修改完成后,执行:flush privileges; 将修改内容生效,再次配置时,用IP地址或者localhos

MySQL、Oracle、Sql Server数据库JDBC的连接方式

MySQL: 先添加MySQL的jar包 String url="jdbc:mysql://localhost:3306/数据库名";       //数据库地址 String name="root";       //数据库用户名 String password="123456";       //数据库用户密码 Class.forName("com.mysql.jdbc.Driver") ;      //加载MySQL驱

【MySQL】ould not connect, server may not be running. Can&#39;t connect to MySQL server on &#39;127.0.0.1&#39; (10

出现如下错误 21:11:36 Could not connect, server may not be running.Can't connect to MySQL server on '127.0.0.1' (10061) 解决方法很简单 打开Windows MySQL的服务即可 [MySQL]ould not connect, server may not be running. Can't connect to MySQL server on '127.0.0.1' (10

新安装的MySQL启动报错The server quit without updating PID file

安装的MySQL启动报错The server quit without updating PID file [[email protected] mysql]# service mysqld restart MySQL server PID file could not be found!                  [失败] Starting MySQL.The server quit without updating PID file (/[失败]ysql/l ocalhost.loc

Java连接mysql——Establishing SSL connection without server&#39;s identity verification is not recommended.

Establishing SSL connection without server's identity verification is not recommended. 出现这个错误的原因是因为mysql版本问题,不同的mysql对ssl使用情况不一样,尝试不采用ssl连接即可.操作方法如下. 正常情况下访问的url String url = "jdbc:mysql://192.168.61.123:3306/cpc"; 改正后的url String url = "jdb

Mysql报错message from server: ERROR 1062 (23000):

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to connect. 原因是:远程服务器不允许你的java程序访问它的数据库.所以,我们要对远程服务器进行设置,使它允许你进行连接. 工具sqldeveloper连接远程的MySQL 数据库时,配置连接信息,连接发生错误,提示:message from server: "Host '192.168.1

java连接MySQL运行报错The server time zone value &#39;&#214;&#208;&#185;&#250;&#177;&#234;&#215;&#188;&#202;&#177;&#188;&#228;&#39; is unrecognized or represents more than

错误:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than 原因:time zone 时区错误 解决方法: 1.使用root用户登录mysql,输入下面命令. show variables like '%time_zone%';SYSTEM为SQL默认美国时间,而我们中国要比他们迟8小时 2.SYSTEM为SQL默认美国时间,而我们中国要比他们迟8小时,因此将时区设置为当前系统时区即可,