小标
2018-08-20
来源 :
阅读 2570
评论 0
摘要:本文主要向大家介绍了MySQL数据库之Mysql5.6 show slave hosts 发现数据库配置参数异常 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
本文主要向大家介绍了MySQL数据库之Mysql5.6 show slave hosts 发现数据库配置参数异常 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
一、环境描述单机多实例,一主多从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,判断应该和复制相关的参数设置的不争取引起的。检查参数文件即可。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)三、解决问题直接在线修改修改参数文件重启数据库,因为是一个slave 节点,没有太大影响mysql> set global report_host=‘192.168.80.122‘;
ERROR 1238 (HY000): Variable ‘report_host‘ is a read only variable第一种方式不行,直接修改参数文件吧,然后重启搞定。vi /etc/my3309.cnf
report-host=192.168.80.123保存退出,重启数据库这几个参数之前没有细研究,正好可以好好查看一下官方文档。//dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#option_mysqld_report-host --report-host=host_nameCommand-Line Format--report-host=host_nameSystem VariableNamereport_hostVariable ScopeGlobalDynamic VariableNoPermitted ValuesTypestringThe 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.
本文由职坐标整理并发布,希望对同学们学习MySQL有所帮助,更多内容请关注职坐标数据库MySQL数据库频道!
喜欢 | 0
不喜欢 | 0
您输入的评论内容中包含违禁敏感词
我知道了

请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号