Hadoop高可用配置檔案hdfs-site.xml之dfs.ha.fencing.methods說明
阿新 • • 發佈:2018-11-26
dfs.ha.fencing.methods配置有sshfence和shell兩種方法:
sshfence:防止namenode腦裂,當腦裂時,會自動通過ssh到old-active將其殺掉,將standby切換為active。
但是隻能在網路通暢時有效,一旦ipdown後fencing方法返回false,standby不會自動切換active,
只能手動執行 hdfs haadmin failover namenode1 namenode2 進行切;所以需要加配shell(/bin/true)。
想要kill掉namenode active後standby自動切換為active,需要安裝psmisc(fuser);因為sshfence方式
是使用fuser通過ssh登入old-active進行診斷從而切換active/standby的。
shell(/bin/true):如果出現故障並且fencing方法返回false,則會繼續執行shell(true),從而active/standby自動切換。
fencing方法返回true,則不會執行shell。
具體配置如下
<property>
<name>dfs.ha.fencing.methods</name>
<value>
sshfence
shell(/bin/true)
</value>
</property>