自动failover


slave1:
stop slave io_thread slave2
stop slave io_thread server1:

  create database sbtest;

  /usr/local/bin/sysbench --test=/root/sysbench-0.5/sysbench/tests/db/oltp.lua --oltp-table-size=10000 --oltp-tables-count=1 --mysql-user=root --mysql-password=123 --   mysql-
  host=10.24.220.232 --mysql-port=3306 --num-threads=4 --max-requests=0 --max-time=30 --report-interval=3 prepare

  /usr/local/bin/sysbench --test=/root/sysbench-0.5/sysbench/tests/db/oltp.lua --oltp-table-size=10000 --oltp-tables-count=1 --mysql-user=root --mysql-password=123 --  mysql- 
host=10.24.220.232 --mysql-port=3306 --num-threads=4 --max-requests=0 --max-time=30 --report-interval=3 run

slave2:
start slave io_thread slave1
start slave io_thread

  server1

  service mysql.server stop


  Sun May  ::  - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun May :: - [info] Reading application default configuration from /etc/masterha/app1.conf..
Sun May :: - [info] Reading server configuration from /etc/masterha/app1.conf..
Sun May :: - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun May :: - [info] Reading application default configuration from /etc/masterha/app1.conf..
Sun May :: - [info] Reading server configuration from /etc/masterha/app1.conf..
:):
Sun May :: - [debug] Connected to: slave1(10.24.220.70:), user=root
Sun May :: - [debug] Number of slave worker threads on host slave1(10.24.220.70:):
Sun May :: - [debug] Connected to: slave2(10.169.214.33:), user=root
Sun May :: - [debug] Number of slave worker threads on host slave2(10.169.214.33:):
Sun May :: - [debug] Comparing MySQL versions..
Sun May :: - [debug] Comparing MySQL versions done.
Sun May :: - [debug] Connecting to servers done.
Sun May :: - [info] GTID failover mode =
Sun May :: - [info] Dead Servers:
Sun May :: - [info] Alive Servers:
Sun May :: - [info] server1(10.24.220.232:)
Sun May :: - [info] slave1(10.24.220.70:)
Sun May :: - [info] slave2(10.169.214.33:)
Sun May :: - [info] Alive Slaves:
Sun May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Primary candidate for the new Master (candidate_master is set)
Sun May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Not candidate for the new Master (no_master is set)
Sun May :: - [info] Current Alive Master: server1(10.24.220.232:)
Sun May :: - [info] Checking slave configurations..
Sun May :: - [info] Checking replication filtering settings..
Sun May :: - [info] binlog_do_db= , binlog_ignore_db=
Sun May :: - [info] Replication filtering check ok.
Sun May :: - [info] GTID (with auto-pos) is supported. Skipping all SSH and Node package checking.
Sun May :: - [info] Checking SSH publickey authentication settings on the current master..
Sun May :: - [debug] SSH connection test to server1, option -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o BatchMode=yes -o ConnectTimeout=, timeout
Sun May :: - [info] HealthCheck: SSH to server1 is reachable.
Sun May :: - [info]
server1(10.24.220.232:) (current master)
+--slave1(10.24.220.70:)
+--slave2(10.169.214.33:) Sun May :: - [info] Checking master_ip_failover_script status:
Sun May :: - [info] /usr/local/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=server1 --orig_master_ip=10.24.220.232 --orig_master_port= IN SCRIPT TEST====/sbin/ifconfig eth0: down==/sbin/ifconfig eth0: 10.24.220.100/=== Checking the Status of the script.. OK
Sun May :: - [info] OK.
Sun May :: - [warning] shutdown_script is not defined.
Sun May :: - [debug] Disconnected from server1(10.24.220.232:)
Sun May :: - [debug] Disconnected from slave1(10.24.220.70:)
Sun May :: - [debug] Disconnected from slave2(10.169.214.33:)
Sun May :: - [debug] SSH check command: exit
Sun May :: - [info] Set master ping interval seconds.
Sun May :: - [info] Set secondary check script: /usr/bin/masterha_secondary_check -s 10.169.214.33 -s 10.24.220.70 --user=root --master_host=10.24.220.232 --master_port=
Sun May :: - [info] Starting ping health check on server1(10.24.220.232:)..
Sun May :: - [debug] Connected on master.
Sun May :: - [debug] Set short wait_timeout on master: seconds
Sun May :: - [debug] Trying to get advisory lock..
Sun May :: - [info] Ping(SELECT) succeeded, waiting until MySQL doesn't respond..
Sun May :: - [warning] Got error on MySQL select ping: (MySQL server has gone away)
Sun May :: - [info] Executing SSH check script: exit
Sun May :: - [debug] SSH connection test to server1, option -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o BatchMode=yes -o ConnectTimeout=, timeout
Sun May :: - [info] Executing secondary network check script: /usr/bin/masterha_secondary_check -s 10.169.214.33 -s 10.24.220.70 --user=root --master_host=10.24.220.232 --master_port= --user=root --master_host=server1 --master_ip=10.24.220.232 --master_port= --master_user=root --master_password= --ping_type=SELECT
Sun May :: - [info] HealthCheck: SSH to server1 is reachable.
Monitoring server 10.169.214.33 is reachable, Master is not reachable from 10.169.214.33. OK.
Monitoring server 10.24.220.70 is reachable, Master is not reachable from 10.24.220.70. OK.
Sun May :: - [info] Master is not reachable from all other monitoring servers. Failover should start.
Sun May :: - [warning] Got error on MySQL connect: (Lost connection to MySQL server at 'reading initial communication packet', system error: )
Sun May :: - [warning] Connection failed time(s)..
Sun May :: - [warning] Got error on MySQL connect: (Lost connection to MySQL server at 'reading initial communication packet', system error: )
Sun May :: - [warning] Connection failed time(s)..
Sun May :: - [warning] Got error on MySQL connect: (Lost connection to MySQL server at 'reading initial communication packet', system error: )
Sun May :: - [warning] Connection failed time(s)..
Sun May :: - [warning] Master is not reachable from health checker!
Sun May :: - [warning] Master server1(10.24.220.232:) is not reachable!
Sun May :: - [warning] SSH is reachable.
Sun May :: - [info] Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /etc/masterha/app1.conf again, and trying to connect to all servers to check server status..
Sun May :: - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun May :: - [info] Reading application default configuration from /etc/masterha/app1.conf..
Sun May :: - [info] Reading server configuration from /etc/masterha/app1.conf..
Sun May :: - [debug] Skipping connecting to dead master server1(10.24.220.232:).
Sun May :: - [debug] Connecting to servers..
Sun May :: - [debug] Connected to: slave1(10.24.220.70:), user=root
Sun May :: - [debug] Number of slave worker threads on host slave1(10.24.220.70:):
Sun May :: - [debug] Connected to: slave2(10.169.214.33:), user=root
Sun May :: - [debug] Number of slave worker threads on host slave2(10.169.214.33:):
Sun May :: - [debug] Comparing MySQL versions..
Sun May :: - [debug] Comparing MySQL versions done.
Sun May :: - [debug] Connecting to servers done.
Sun May :: - [info] GTID failover mode =
Sun May :: - [info] Dead Servers:
Sun May :: - [info] server1(10.24.220.232:)
Sun May :: - [info] Alive Servers:
Sun May :: - [info] slave1(10.24.220.70:)
Sun May :: - [info] slave2(10.169.214.33:)
Sun May :: - [info] Alive Slaves:
Sun May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Primary candidate for the new Master (candidate_master is set)
Sun May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Not candidate for the new Master (no_master is set)
Sun May :: - [info] Checking slave configurations..
Sun May :: - [info] Checking replication filtering settings..
Sun May :: - [info] Replication filtering check ok.
Sun May :: - [info] Master is down!
Sun May :: - [info] Terminating monitoring script.
Sun May :: - [info] Got exit code (Master dead).
Sun May :: - [info] MHA::MasterFailover version 0.56.
Sun May :: - [info] Starting master failover.
Sun May :: - [info]
Sun May :: - [info] * Phase : Configuration Check Phase..
Sun May :: - [info]
Sun May :: - [debug] Skipping connecting to dead master server1.
Sun May :: - [debug] Connecting to servers..
Sun May :: - [debug] Connected to: slave1(10.24.220.70:), user=root
Sun May :: - [debug] Number of slave worker threads on host slave1(10.24.220.70:):
Sun May :: - [debug] Connected to: slave2(10.169.214.33:), user=root
Sun May :: - [debug] Number of slave worker threads on host slave2(10.169.214.33:):
Sun May :: - [debug] Comparing MySQL versions..
Sun May :: - [debug] Comparing MySQL versions done.
Sun May :: - [debug] Connecting to servers done.
Sun May :: - [info] GTID failover mode =
Sun May :: - [info] Dead Servers:
Sun May :: - [info] server1(10.24.220.232:)
Sun May :: - [info] Checking master reachability via MySQL(double check)...
Sun May :: - [info] ok.
Sun May :: - [info] Alive Servers:
Sun May :: - [info] slave1(10.24.220.70:)
Sun May :: - [info] slave2(10.169.214.33:)
Sun May :: - [info] Alive Slaves:
Sun May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Primary candidate for the new Master (candidate_master is set)
Sun May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Not candidate for the new Master (no_master is set)
Sun May :: - [info] Starting GTID based failover.
Sun May :: - [info]
Sun May :: - [info] ** Phase : Configuration Check Phase completed.
Sun May :: - [info]
Sun May :: - [info] * Phase : Dead Master Shutdown Phase..
Sun May :: - [info]
Sun May :: - [info] Forcing shutdown so that applications never connect to the current master..
Sun May :: - [info] Executing master IP deactivation script:
Sun May :: - [info] /usr/local/bin/master_ip_failover --orig_master_host=server1 --orig_master_ip=10.24.220.232 --orig_master_port= --command=stopssh --ssh_user=root
Sun May :: - [debug] Stopping IO thread on slave2(10.169.214.33:)..
Sun May :: - [debug] Stopping IO thread on slave1(10.24.220.70:).. IN SCRIPT TEST====/sbin/ifconfig eth0: down==/sbin/ifconfig eth0: 10.24.220.100/=== Disabling the VIP on old master: server1
Sun May :: - [debug] Stop IO thread on slave2(10.169.214.33:) done.
Sun May :: - [debug] Stop IO thread on slave1(10.24.220.70:) done.
SIOCSIFFLAGS: Cannot assign requested address
Sun May :: - [info] done.
Sun May :: - [warning] shutdown_script is not set. Skipping explicit shutting down of the dead master.
Sun May :: - [info] * Phase : Dead Master Shutdown Phase completed.
Sun May :: - [info]
Sun May :: - [info] * Phase : Master Recovery Phase..
Sun May :: - [info]
Sun May :: - [info] * Phase 3.1: Getting Latest Slaves Phase..
Sun May :: - [info]
Sun May :: - [debug] Fetching current slave status..
Sun May :: - [debug] Fetching current slave status done.
Sun May :: - [info] The latest binary log file/position on all slaves is log.:
Sun May :: - [info] Retrieved Gtid Set: 191f7a9f-ffa2-11e5-a825-00163e00242a:-
Sun May :: - [info] Latest slaves (Slaves that received relay log files to the latest):
Sun May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Primary candidate for the new Master (candidate_master is set)
Sun May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Not candidate for the new Master (no_master is set)
Sun May :: - [info] The oldest binary log file/position on all slaves is log.:
Sun May :: - [info] Retrieved Gtid Set: 191f7a9f-ffa2-11e5-a825-00163e00242a:-
Sun May :: - [info] Oldest slaves:
Sun May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Primary candidate for the new Master (candidate_master is set)
Sun May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Not candidate for the new Master (no_master is set)
Sun May :: - [info]
Sun May :: - [info] * Phase 3.3: Determining New Master Phase..
Sun May :: - [info]
Sun May :: - [info] Searching new master from slaves..
Sun May :: - [info] Candidate masters from the configuration file:
Sun May :: - [info] slave1(10.24.220.70:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Primary candidate for the new Master (candidate_master is set)
Sun May :: - [info] Non-candidate masters:
Sun May :: - [info] slave2(10.169.214.33:) Version=5.7.-log (oldest major version between slaves) log-bin:enabled
Sun May :: - [info] GTID ON
Sun May :: - [debug] Relay log info repository: FILE
Sun May :: - [info] Replicating from 10.24.220.232(10.24.220.232:)
Sun May :: - [info] Not candidate for the new Master (no_master is set)
Sun May :: - [info] Searching from candidate_master slaves which have received the latest relay log events..
Sun May :: - [info] New master is slave1(10.24.220.70:)
Sun May :: - [info] Starting master failover..
Sun 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:)
Sun May :: - [info]
Sun May :: - [info] * Phase 3.3: New Master Recovery Phase..
Sun May :: - [info]
Sun May :: - [info] Waiting all logs to be applied..
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [debug] Sql Thread Done: , Worker Thread done: , Ended workers:
Sun May :: - [info] done.
Sun May :: - [debug] Stopping slave IO/SQL thread on slave1(10.24.220.70:)..
Sun May :: - [debug] done.
Sun May :: - [info] Getting new master's binlog name and position..
Sun May :: - [info] log.:
Sun 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';
Sun May :: - [info] Master Recovery succeeded. File:Pos:Exec_Gtid_Set: log., , 191f7a9f-ffa2-11e5-a825-00163e00242a:-
Sun May :: - [info] Executing master IP activate script:
Sun May :: - [info] /usr/local/bin/master_ip_failover --command=start --ssh_user=root --orig_master_host=server1 --orig_master_ip=10.24.220.232 --orig_master_port= --new_master_host=slave1 --new_master_ip=10.24.220.70 --new_master_port= --new_master_user='root' --new_master_password=''
Unknown option: new_master_user
Unknown option: new_master_password IN SCRIPT TEST====/sbin/ifconfig eth0: down==/sbin/ifconfig eth0: 10.24.220.100/=== Enabling the VIP - 10.24.220.100/ on the new master - slave1
Sun May :: - [info] OK.
Sun May :: - [info] Setting read_only= on slave1(10.24.220.70:)..
Sun May :: - [info] ok.
Sun May :: - [info] ** Finished master recovery successfully.
Sun May :: - [info] * Phase : Master Recovery Phase completed.
Sun May :: - [info]
Sun May :: - [info] * Phase : Slaves Recovery Phase..
Sun May :: - [info]
Sun May :: - [info]
Sun May :: - [info] * Phase 4.1: Starting Slaves in parallel..
Sun May :: - [info]
Sun May :: - [info] -- Slave recovery on host slave2(10.169.214.33:) started, pid: . Check tmp log /var/log/masterha/app1/slave2_3306_20160515204944.log if it takes time..
Sun May :: - [info]
Sun May :: - [info] Log messages from slave2 ...
Sun May :: - [info]
Sun May :: - [info] Resetting slave slave2(10.169.214.33:) and starting replication from the new master slave1(10.24.220.70:)..
Sun May :: - [debug] Stopping slave IO/SQL thread on slave2(10.169.214.33:)..
Sun May :: - [debug] done.
Sun May :: - [info] Executed CHANGE MASTER.
Sun May :: - [debug] Starting slave IO/SQL thread on slave2(10.169.214.33:)..
Sun May :: - [debug] done.
Sun May :: - [info] Slave started.
Sun May :: - [info] gtid_wait(191f7a9f-ffa2-11e5-a825-00163e00242a:-) completed on slave2(10.169.214.33:). Executed events.
Sun May :: - [info] End of log messages from slave2.
Sun May :: - [info] -- Slave on host slave2(10.169.214.33:) started.
Sun May :: - [info] All new slave servers recovered successfully.
Sun May :: - [info]
Sun May :: - [info] * Phase : New master cleanup phase..
Sun May :: - [info]
Sun May :: - [info] Resetting slave info on the new master..
Sun May :: - [debug] Clearing slave info..
Sun May :: - [debug] Stopping slave IO/SQL thread on slave1(10.24.220.70:)..
Sun May :: - [debug] done.
Sun May :: - [debug] SHOW SLAVE STATUS shows new master does not replicate from anywhere. OK.
Sun May :: - [info] slave1: Resetting slave info succeeded.
Sun May :: - [info] Master failover to slave1(10.24.220.70:) completed successfully.
Sun May :: - [info] Deleted server1 entry from /etc/masterha/app1.conf .
Sun May :: - [debug] Disconnected from slave1(10.24.220.70:)
Sun May :: - [debug] Disconnected from slave2(10.169.214.33:)
Sun May :: - [info] ----- Failover Report ----- app1: MySQL Master failover server1(10.24.220.232:) to slave1(10.24.220.70:) succeeded Master server1(10.24.220.232:) is down! Check MHA Manager logs at monitor:/var/log/masterha/app1/manager.log for details. Started automated(non-interactive) failover.
Invalidated master IP address on server1(10.24.220.232:)
Selected slave1(10.24.220.70:) as a new master.
slave1(10.24.220.70:): OK: Applying all logs succeeded.
slave1(10.24.220.70:): OK: Activated master IP address.
slave2(10.169.214.33:): OK: Slave started, replicating from slave1(10.24.220.70:)
slave1(10.24.220.70:): Resetting slave info succeeded.
Master failover to slave1(10.24.220.70:) completed successfully.

mha 自动failover 原创的更多相关文章

  1. MHA自动Failover过程解析(updated) 转

    允许转载, 转载时请以超链接形式标明文章原始出处和网站信息 http://www.mysqlsystems.com/2012/03/figure-out-process-of-autofailover ...

  2. MySQL高可用方案MHA自动Failover与手动Failover的实践及原理

    集群信息 角色                             IP地址                 ServerID      类型 Master                     ...

  3. 【MySql】——MHA+GTID+failover+binlog-server+Atlas

    一.环境准备 1.mysql-db01 #系统版本 [root@mysql-db01 ~]# cat /etc/redhat-release CentOS release 6.7 (Final) #内 ...

  4. MHA 安装过程 原创

    root@monitor yum.repos.d]# cat CentOS-Base.repo [base]name=CentOS-$releasever - Basefailovermethod=p ...

  5. MHA手动切换 原创1(主故障)

    MHA提供了3种方式用于实现故障转移,分别自动故障转移,需要启用MHA监控: 在无监控的情况下的手动故障转移以及基于在线手动切换. 三种方式可以应对MySQL主从故障的任意场景.本文主要描述在无监控的 ...

  6. 利用XAG在RAC环境下实现GoldenGate自动Failover

    概述 在RAC环境下配置OGG,要想实现RAC节点故障时,OGG能自动的failover到正常节点,要保证两点: 1. OGG的checkpoint,trail,BR文件放置在共享的集群文件系统上,R ...

  7. Redis主从自动failover

    Redis主从架构持久化存在一个问题,即前次测试的结论,持久化需要配置在主实例上才能跨越实例保证数据不丢失,这样以来主实例在持久化数据到硬 盘的过程中,势必会造成磁盘的I/O等待,经过实际测试,这个持 ...

  8. MHA自动切换流程

    MHA的全名叫做mysql-master-ha,配置后可以在10-30秒内完成master自动切换,切换过程如下: 1. 检测master的状态,方法是一秒一次“ SELECT 1 As Value” ...

  9. MHA手动切换 原创4 (非交互式切换)

    非交互式切换:不输 YES 或者 NO [root@monitor app1]# masterha_master_switch --conf=/etc/masterha/app1.conf --mas ...

随机推荐

  1. JDBC获取表的主键

    JDBC获取表的主键 案例,创建订单,并根据订单号向订单明细表插入数据 sql语句: 创建两表 create table orders(  id number(4) primary key,  cus ...

  2. bzoj 1009 [HNOI2008]GT考试(DP+KMP+矩阵乘法)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1009 [题意] 给定一个字符串T,问长度为n且不包含串T的字符串有多少种. [思路] ...

  3. Bias/variance tradeoff

    线性回归中有欠拟合与过拟合,例如下图: 则会形成欠拟合, 则会形成过拟合. 尽管五次多项式会精确的预测训练集中的样本点,但在预测训练集中没有的数据,则不能很好的预测,也就是说有较大的泛化误差,上面的右 ...

  4. JAVA与数据库开发(JDBC-ODBC、SQL Server、MySQL)

    1)配置数据库环境和驱动 2)设计数据库结构并创建数据库 3)对数据库进行增删改查操作...

  5. 一个谷粉和3年的Google Reader重度使用者的碎碎念

    2013-03-14 上午看到Andy Rubin辞去Android业务主管职务.由Chrome及应用高级副总裁继任的新闻,还在想这会给Android带来什么,中午刷微博的时候就挨了当头一棒:Goog ...

  6. memcache和memcahced区别

    在写这篇文章之前一直对memcache .memcahced模糊,相差一个字母,特此总结下: Memcache是什么? Memcache是一个自由和开放源代码.高性能.分配的内存对象缓存系统.用于加速 ...

  7. 关于scrollTop的那些事

    大家在实际项目中,应该是要经常用到scrollTop的,它表示的是可视窗口距离页面顶部的距离,这个scrollTop是可读写的,所以可以用来做页面滚动. 但是大家或多或少遇到一些浏览器兼容问题,为什么 ...

  8. codeforces 630J Divisibility

    J. Divisibility time limit per test 0.5 seconds memory limit per test 64 megabytes input standard in ...

  9. HDU 4489 The King’s Ups and Downs (DP+数学计数)

    题意:给你n个身高高低不同的士兵.问你把他们按照波浪状排列(高低高或低高低)有多少方法数. 析:这是一个DP题是很明显的,因为你暴力的话,一定会超时,应该在第15个时,就过不去了,所以这是一个DP计数 ...

  10. php把时间格式化

    如题,把如 2013-6-12 12:00 格式化为 2013-6--12 可以先将时间转换下,然后重新将时间格式化显示: echo date("Y-m-d", strtotime ...