MHA手动切换 原创4 (非交互式切换)
非交互式切换:不输 YES 或者 NO [root@monitor app1]# masterha_master_switch --conf=/etc/masterha/app1.conf --master_state=alive --new_master_host=slave1 --orig_master_is_new_slave --interactive=;
Mon May :: - [info] MHA::MasterRotate version 0.56.
Mon May :: - [info] Starting online master switch..
Mon May :: - [info]
Mon May :: - [info] * Phase : Configuration Check Phase..
Mon May :: - [info]
Mon May :: - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Mon May :: - [info] Reading application default configuration from /etc/masterha/app1.conf..
Mon May :: - [info] Reading server configuration from /etc/masterha/app1.conf..
Mon May :: - [debug] Connecting to servers..
Mon May :: - [debug] Connected to: server1(10.24.220.232:), user=root
Mon May :: - [debug] Number of slave worker threads on host server1(10.24.220.232:):
Mon May :: - [debug] Connected to: slave1(10.24.220.70:), user=root
Mon May :: - [debug] Number of slave worker threads on host slave1(10.24.220.70:):
Mon May :: - [debug] Connected to: slave2(10.169.214.33:), user=root
Mon May :: - [debug] Number of slave worker threads on host slave2(10.169.214.33:):
Mon May :: - [debug] Comparing MySQL versions..
Mon May :: - [debug] Comparing MySQL versions done.
Mon May :: - [debug] Connecting to servers done.
Mon May :: - [info] Multi-master configuration is detected. Current primary(writable) master is server1(10.24.220.232:)
Mon May :: - [info] Master configurations are as below:
Master slave1(10.24.220.70:), replicating from 10.24.220.232(10.24.220.232:), read-only
Master server1(10.24.220.232:), replicating from slave1(10.24.220.70:) Mon May :: - [info] GTID failover mode =
Mon May :: - [info] Current Alive Master: server1(10.24.220.232:)
Mon May :: - [info] Alive Slaves:
Mon May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Mon May :: - [info] GTID ON
Mon May :: - [debug] Relay log info repository: FILE
Mon May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Mon May :: - [info] Primary candidate for the new Master (candidate_master is set)
Mon May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Mon May :: - [info] GTID ON
Mon May :: - [debug] Relay log info repository: FILE
Mon May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Mon May :: - [info] Not candidate for the new Master (no_master is set)
Mon May :: - [info] Executing FLUSH NO_WRITE_TO_BINLOG TABLES. This may take long time..
Mon May :: - [info] ok.
Mon May :: - [info] Checking MHA is not monitoring or doing failover..
Mon May :: - [info] Checking replication health on slave1..
Mon May :: - [info] ok.
Mon May :: - [info] Checking replication health on slave2..
Mon May :: - [info] ok.
Mon May :: - [info] slave1 can be new master.
Mon May :: - [info]
From:
server1(10.24.220.232:) (current master)
+--slave1(10.24.220.70:)
+--slave2(10.169.214.33:) To:
slave1(10.24.220.70:) (new master)
+--slave2(10.169.214.33:)
+--server1(10.24.220.232:)
Mon May :: - [info] Checking whether slave1(10.24.220.70:) is ok for the new master..
Mon May :: - [info] ok.
Mon May :: - [info] ** Phase : Configuration Check Phase completed.
Mon May :: - [info]
Mon May :: - [debug] Disconnected from server1(10.24.220.232:)
Mon May :: - [info] * Phase : Rejecting updates Phase..
Mon May :: - [info]
Mon May :: - [warning] master_ip_online_change_script is not defined. Skipping disabling writes on the current master.
Mon May :: - [info] Locking all tables on the orig master to reject updates from everybody (including root):
Mon May :: - [info] Executing FLUSH TABLES WITH READ LOCK..
Mon May :: - [info] ok.
Mon May :: - [info] Orig master binlog:pos is log.:.
Mon May :: - [debug] Fetching current slave status..
Mon May :: - [debug] Fetching current slave status done.
Mon May :: - [info] Waiting to execute all relay logs on slave1(10.24.220.70:)..
Mon May :: - [info] master_pos_wait(log.:) completed on slave1(10.24.220.70:). Executed events.
Mon May :: - [info] done.
Mon May :: - [debug] Stopping SQL thread on slave1(10.24.220.70:)..
Mon May :: - [debug] done.
Mon May :: - [info] Getting new master's binlog name and position..
Mon May :: - [info] log.:
Mon May :: - [info] All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='slave1 or 10.24.220.70', MASTER_PORT=, MASTER_AUTO_POSITION=, MASTER_USER='repl', MASTER_PASSWORD='xxx';
Mon May :: - [info] Setting read_only= on slave1(10.24.220.70:)..
Mon May :: - [info] ok.
Mon May :: - [info]
Mon May :: - [info] * Switching slaves in parallel..
Mon May :: - [info]
Mon May :: - [info] -- Slave switch on host slave2(10.169.214.33:) started, pid:
Mon May :: - [info]
Mon May :: - [info] Log messages from slave2 ...
Mon May :: - [info]
Mon May :: - [info] Waiting to execute all relay logs on slave2(10.169.214.33:)..
Mon May :: - [info] master_pos_wait(log.:) completed on slave2(10.169.214.33:). Executed events.
Mon May :: - [info] done.
Mon May :: - [debug] Stopping SQL thread on slave2(10.169.214.33:)..
Mon May :: - [debug] done.
Mon May :: - [info] Resetting slave slave2(10.169.214.33:) and starting replication from the new master slave1(10.24.220.70:)..
Mon May :: - [debug] Stopping slave IO/SQL thread on slave2(10.169.214.33:)..
Mon May :: - [debug] done.
Mon May :: - [info] Executed CHANGE MASTER.
Mon May :: - [debug] Starting slave IO/SQL thread on slave2(10.169.214.33:)..
Mon May :: - [debug] done.
Mon May :: - [info] Slave started.
Mon May :: - [info] End of log messages from slave2 ...
Mon May :: - [info]
Mon May :: - [info] -- Slave switch on host slave2(10.169.214.33:) succeeded.
Mon May :: - [info] Unlocking all tables on the orig master:
Mon May :: - [info] Executing UNLOCK TABLES..
Mon May :: - [info] ok.
Mon May :: - [info] Starting orig master as a new slave..
Mon May :: - [info] Resetting slave server1(10.24.220.232:) and starting replication from the new master slave1(10.24.220.70:)..
Mon May :: - [debug] Stopping slave IO/SQL thread on server1(10.24.220.232:)..
Mon May :: - [debug] done.
Mon May :: - [info] Executed CHANGE MASTER.
Mon May :: - [debug] Starting slave IO/SQL thread on server1(10.24.220.232:)..
Mon May :: - [debug] done.
Mon May :: - [info] Slave started.
Mon May :: - [debug] ok.
Mon May :: - [info] All new slave servers switched successfully.
Mon May :: - [info]
Mon May :: - [info] * Phase : New master cleanup phase..
Mon May :: - [info]
Mon May :: - [debug] Clearing slave info..
Mon May :: - [debug] Stopping slave IO/SQL thread on slave1(10.24.220.70:)..
Mon May :: - [debug] done.
Mon May :: - [debug] SHOW SLAVE STATUS shows new master does not replicate from anywhere. OK.
Mon May :: - [info] slave1: Resetting slave info succeeded.
Mon May :: - [info] Switching master to slave1(10.24.220.70:) completed successfully.
Mon May :: - [debug] Disconnected from server1(10.24.220.232:)
Mon May :: - [debug] Disconnected from slave1(10.24.220.70:)
Mon May :: - [debug] Disconnected from slave2(10.169.214.33:)
[root@monitor app1]#
MHA手动切换 原创4 (非交互式切换)的更多相关文章
- 关于mha手动切换的一些记录(mha方案来自网络)
mha方案出自:http://www.cnblogs.com/xuanzhi201111/p/4231412.html 当主服务器故障时,人工手动调用MHA来进行故障切换操作,具体命令如下: 先停MH ...
- parted分区和挂载及非交互式操作
author : headsen chen date : 2017-11-17 09:45:36 个人原创,转载请注明作者,出处,否则依法追究法律责任 1,将磁盘上原有的分区删除掉: 进入:#pa ...
- 鸿蒙内核源码分析(任务切换篇) | 看汇编如何切换任务 | 百篇博客分析OpenHarmony源码 | v41.03
百篇博客系列篇.本篇为: v41.xx 鸿蒙内核源码分析(任务切换篇) | 看汇编如何切换任务 | 51.c.h .o 任务管理相关篇为: v03.xx 鸿蒙内核源码分析(时钟任务篇) | 触发调度谁 ...
- (转)SSH批量分发管理&非交互式expect
目录 1 SSH批量分发管理 1.1 测试环境 1.2 批量管理步骤 1.3 批量分发管理实例 1.3.1 利用sudo提权来实现没有权限的用户拷贝 1.3.2 利用sudo提权开发管理脚本 1.3. ...
- mysql交互式连接&非交互式连接
交互式操作:通俗的说,就是你在你的本机上打开mysql的客户端,就是那个黑窗口,在黑窗口下进行各种sql操作,当然走的肯定是tcp协议. 非交互式操作:就是你在你的项目中进行程序调用.比如一边是tom ...
- 登录式与非登录式&交互式与非交互式shell及其环境初始化过程
交互式shell和非交互式shell(interactive shell and non-interactive shell) 交互式模式就是在终端上执行,shell等待你的输入,并且立即执行你提交的 ...
- Android的Activity屏幕切换动画(一)-左右滑动切换
(国内知名Android开发论坛eoe开发者社区推荐:http://www.eoeandroid.com/) Android的Activity屏幕切换动画(一)-左右滑动切换 在Android开发过程 ...
- LTE 切换过程中的数据切换
http://blog.sina.com.cn/s/blog_673b30dd0100j4p4.html LTE中的切换,根据无线承载(Radio Bearer)的QoS要求的不同,可以分为无缝切换( ...
- 交互式shell和非交互式shell、登录shell和非登录shell的区别
交互式shell和非交互式shell.登录shell和非登录shell的区别.首先,这是两个不同的维度来划分的,一个是是否交互式,另一个是是否登录. 交互式shell和非交互式shell(intera ...
随机推荐
- (原创)LAMP教程1-下载虚拟机软件
(原创)LAMP教程1 从今天开始会在我的博客更新LAMP教程,第一章节就是安装虚拟机,因为不可能所有的人都有机会操作服务器,所以今天我打算教大家用虚拟机安装配置当下比较流行的框架,lamp. 好了费 ...
- 炮兵阵地(POJ 1185状压dp)
题意:n*m地图'H'能放'p'不能放,布兵的方格上下左右不能布兵,给你地图求最大布兵数 分析:关系到前两行,所以dp[i][j][k]第i行状态为j,i-1行状态为k时的最大布兵数, 先求出所有可行 ...
- Tableau学习笔记之二
2张图片解析下Tableau 9.0界面的功能 1.数据加载界面: 2.数据分析界面:
- bzoj 2959 长跑(LCT+BCC+并查集)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=2959 [题意] n个点,提供操作:连边,修改点权,查询自定义边的方向后起点a终点b能经 ...
- [Hive - LanguageManual] Hive Default Authorization - Legacy Mode
Disclaimer Prerequisites Users, Groups, and Roles Names of Users and Roles Creating/Dropping/Using R ...
- Classes and Objects :类和对象(2)
类内部可以有另一个类,也就是内部类,如果带static则为静态内部类静态内部类当然不能直接访问实例变量内部类修饰符可以有四种,而外部类只有两种 内部类的意义:这个内部类只适用于这个外部类因为外部类的某 ...
- flash图标插件
http://pullmonkey.com/projects/open_flash_chart2/
- (R)?ex - A simple framework to simplify system administration and datacenter automation
找工作-互联网招聘求职网-拉勾网 5-10年 (R)?ex - A simple framework to simplify system administration and datacenter ...
- 第二百八十天 how can I 坚持
今天发现一只大bug,目前还没有解决掉... 晚上和徐斌还有他同学一块吃了个饭.还有.没了. 今天想早睡觉. 今天股市暴跌,二度熔断,好精彩,哈哈,不说啥了,还有苹果股票和谷歌市值越来越接近了,要走下 ...
- linux性能问题(CPU,内存,磁盘I/O,网络)
一. CPU性能评估 1.vmstat [-V] [-n] [depay [count]] -V : 打印出版本信息,可选参数 -n : 在周期性循环输出时,头部信息仅显示一次 delay : 两次输 ...