MHA官方文档翻译(十一)

2015-02-03 03:55:14 · 作者: · 浏览: 83
_FAILED

MHA Manager detects either a) ping to master failed three times, b) preparing for starting master failover. Master state is maybe down.

30

RETRYING_MONITOR

MHA Manager internal health check program detected that master was not reachable from manager, but after double check MHA Manager verified the master is alive, and currently waiting for retry. Master state is very likely alive.

31

CONFIG_ERROR

There are some configuration problems and MHA Manager can't monitor the target master. Check a logfile for detail. Master state is unknown.

32

TIMESTAMP_OLD

MHA Manager detects that ping to master is ok but status file is not updated for a long time. Check whether MHA Manager itself hangs or not. Master state is unknown.

50

FAILOVER_RUNNING

MHA Manager confirms that master is down and running failover. Master state is dead.

51

FAILOVER_ERROR

MHA Manager confirms that master is down and running failover, but failed during failover. Master state is dead.

?

masterha_check_repl:检查复制健康状态

manager_host$ masterha_check_repl --conf=/etc/app1.cnf
  ...
  MySQL Replication Health is OK.

?

masterha_stop:停止MHA manager运行

manager_host$ masterha_stop --conf=/etc/app1.cnf
  Stopped app1 successfully.

?

Masterha_conf_host:在配置文件中添加或移除host

# masterha_conf_host --command=add--conf=/etc/conf/masterha/app1.cnf --hostname=db101

Then the following lines will be added to theconf file.

[server_db101]

hostname=db101

You can add several parameters in the configfile by passing --param parameters, separated by semi-colon(;).

# masterha_conf_host --command=add--conf=/etc/conf/masterha/app1.cnf --hostname=db101 --block=server100--params="no_master=1;ignore_fail=1"

The following lines will be added to the conffile.

[server100]

hostname=db101

no_master=1

ignore_fail=1

You can also remove specified block. Thebelow command will remove the etire block server100.

# masterha_conf_host --command=delete--conf=/etc/conf/masterha/app1.cnf --block=server100

masterha_conf_host takes below arguments

master_check_ssh:ssh认证检查

# masterha_check_ssh --conf=/etc/app1.cnf
  
  Sat May 14 14:42:19 2011 - [warn] Global configuration file /etc/masterha_default.cnf not found. Skipping.
  Sat May 14 14:42:19 2011 - [info] Reading application default configurations from /etc/app1.cnf..
  Sat May 14 14:42:19 2011 - [info] Reading server configurations from /etc/app1.cnf..
  Sat May 14 14:42:19 2011 - [info] Starting SSH connection tests..
  Sat May 14 14:42:19 2011 - [debug]  Connecting via SSH from root@host1(192.168.0.1) to root@host2(192.168.0.2)..
  Sat May 14 14:42:20 2011 - [debug]   ok.
  Sat May 14 14:42:20 2011 - [debug]  Connecting via SSH from root@host1(192.168.0.1) to root@host3(192.168.0.3)..
  Sat May 14 14:42:20 2011 - [debug]   ok.
  Sat May 14 14:42:21 2011 - [debug]  Connecting via SSH from root@host2(192.168.0.2) to root@host1(192.168.0.1)..
  Sat May 14 14:42:21 2011 - [debug]   ok.
  Sat May 14 14:42:21 2011 - [debug]  Connecting via SSH from root@host2(192.168.0.2) to root@host3(192.168.0.3)..
  Sat May 14 14:42:21 2011 - [debug]   ok.
  Sat May 14 14:42:22 2011 - [debug]  Connecting via SSH from root@host3(192.168.0.3) to root@host1(192.168.0.1)..
  Sat May 14 14:42:22 2011 - [debug]   ok.
  Sat May 14 14:42:22 2011 - [debug]  Connecting via SSH from root@host3(192.168.0.3) to root@host2(192.168.0.2)..
  Sat May 14 14: