lidonghe 发表于 2018-9-28 11:27:31

MySQL主从复制: MHA

# masterha_check_status --conf /etc/mha.cnf   #当前主节点为node1  mha (pid:2573) is running(0:PING_OK), master:172.16.1.2
  # service mysqld stop#手动停止主节点
  # mysql
  mysql> SHOW SLAVE STATUS\G;
  Slave_IO_State: Waiting for master to send event
  Master_Host: 172.16.1.3#已经转换为node2
  Master_User: rpuser
  Master_Port: 3306
  Connect_Retry: 60
  Master_Log_File: master-log.000006
  Read_Master_Log_Pos: 106

  Relay_Log_File:>  Relay_Log_Pos: 252
  Relay_Master_Log_File: master-log.000006
  # mysql
  mysql> SHOW GLOBAL VARIABLES LIKE '%read_only%';    #查看, read_only被MHA关闭了
  +---------------+-------+
  | Variable_name | Value |
  +---------------+-------+
  | read_only   | OFF   |
  +---------------+-------+
  1 row in set (0.00 sec)

页: [1]
查看完整版本: MySQL主从复制: MHA