【MHA】--命令係列介紹--[masterha_manager]
masterha_manager: 啟動 mha master manager 控製的腳本開關
eg: masterha_manager --conf=/home/server/mha/cnf/mysql_node_account_3306.cnf
常用參數如下:
--conf=(config file path) 應用或本地範圍的配置參數文件,必須指定
--global-conf=(global config file path): 全局範圍的配置參數,默認 /etc/masterha_default.cnf
--manager_workdir,--workdir: manager 工作的目錄,存放 mha manager 產生關聯的狀態文件
--masterha_log,--log_output:存放 mha manager 產生的日誌文件,如果沒有設置,將會使用標準輸出,當執行failover,mha manager 忽略 此配置,使用標準的輸出
monitor 特殊參數:
--wait_on_monitor_error=(seconds):在監控的過程,當發出錯誤了,masterha_manager 等待 wait_no_monitor_error 的時間後,退出。如果設置為了0,直接退出。這個好處,是當後台運行master monitor 和 failover scripts的時候,masterha_manager 可以在 wait_no_monitor_error 時間到達之前重啟監控
--ignore_fail_on_start: 默認的情況下,當一個或多個從庫宕機後,主庫監控(不是 failover)進程會停掉,除非ignore_fail_on_start 參數開啟。
NOTE: 我們可以監控這個參數,如果從庫宕機後,masterha_manager 會停掉,我們做從庫高可用,切讀域名。
*Failover指定參數:***
--last_failover_minute=(minutes):
當最近的一個failover 切換發生在last_failover_minute(默認為8小時) 之內,MHA manager 將不會在切換。因為它會認為有些問題沒有得到解決。如果設置了 --ignore_last_failover 參數,參數(--last_failover_minute) 將會失效
--ignore_last_failover:
如果最近failover 失敗,MHA 將不會再次開始failover機製,因為這個問題可能再次發生。常規步驟:手動清理failover 錯誤文件,此文件一般在manager_workdir/app_name.failover.error文件,然後在啟動failover機製。如果設置此參數,MHA 將會繼續failover 不管上次的failover狀態
--wait_on_failover_error=(seconds):
在failover的過程,當發出錯誤了,masterha_manager 等待 wait_no_failover_error 的時間後,退出。如果設置為了0,直接退出。這個好處,是當後台運行master monitor 和 failover scripts的時候,masterha_manager 可以在 wait_no_failover_error 時間到達之前重啟監控
--remove_dead_master_conf:
如果設置此參數,當成功failover後,MHA manager將會自動刪除配置文件中關於dead master的配置選項。
eg: For example, if the dead master's hostname is host1 and it belongs to the section of server1, the entire part of the server1 will be removed from the configuration file. By default, the configuration file is not modified at all. After MHA finishes failover, the section of the dead master still exists. If you start masterha_manager immediately (this includes automatic restart from any daemon program), masterha_manager stops with an error that "there is a dead slave" (previous dead master). You might want to change this behavior especially if you want to continuously monitor and failover MySQL master automatically. In such cases, --remove_dead_master_conf argument is helpful.
最後更新:2017-09-12 14:03:53