Mysql5.6 show slave hosts 发现数据库配置参数异常

一、环境描述

单机多实例,一主多从


1
2
3
4
5
6
7
8
9
mysql> show slave hosts;
+-----------+----------------+------+-----------+--------------------------------------+
| Server_id | Host           | Port | Master_id | Slave_UUID                           |
+-----------+----------------+------+-----------+--------------------------------------+
|      3308 | 192.168.80.123 | 3308 |      3307 | e7bb816c-c823-11e6-abf0-00e06f68209e |
|      3309 | 192.168.80.122 | 3309 |      3307 | c1039a79-c82b-11e6-ac23-00e06f68209e |
|     10123 | 192.168.80.123 | 3306 |      3307 | a817b53d-5a23-11e6-9ea4-00e06f68209e |
+-----------+----------------+------+-----------+--------------------------------------+
3 rows  in  set  (0.00 sec)


二、分析 

Host 列不应该出现192.168.80.122 ,应该是192.168.80.123,判断应该和复制相关的参数设置的

不争取引起的。检查参数文件即可。

1
2
3
4
5
6
7
8
9
10
mysql> show variables like  'report%' ;
+-----------------+----------------+
| Variable_name   | Value          |
+-----------------+----------------+
| report_host     | 192.168.80.122 |
| report_password |                |
| report_port     | 3309           |
| report_user     |                |
+-----------------+----------------+
4 rows  in  set  (0.01 sec)


三、解决问题

  1. 直接在线修改

  2. 修改参数文件重启数据库,因为是一个slave 节点,没有太大影响

1
2
mysql>  set  global report_host= '192.168.80.122' ;
ERROR 1238 (HY000): Variable  'report_host'  is a  read  only variable


第一种方式不行,直接修改参数文件吧,然后重启搞定。

1
2
vi  /etc/my3309 .cnf 
report-host=192.168.80.123

保存退出,重启数据库


这几个参数之前没有细研究,正好可以好好查看一下官方文档。

1
http: //dev .mysql.com /doc/refman/5 .6 /en/replication-options-slave .html #option_mysqld_report-host

 --report-host=host_name

Command-Line Format--report-host=host_name
System VariableNamereport_host
Variable ScopeGlobal
Dynamic VariableNo
Permitted ValuesTypestring

The host name or IP address of the slave to be reported to the master during slave registration. This value appears in the output of SHOW SLAVE HOSTS on the master server. Leave the value unset if you do not want the slave to register itself with the master.










本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/1886947,如需转载请自行联系原作者
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值