zkfc的日志信息:
2020-07-27 09:41:16,304 WARN org.apache.hadoop.ha.SshFenceByTcpPort: PATH=$PATH:/sbin:/usr/sbin fuser -v -k -n tcp 9000 via ssh: bash: fuser: command not found
2020-07-27 09:41:16,305 INFO org.apache.hadoop.ha.SshFenceByTcpPort: rc: 127
2020-07-27 09:41:16,305 INFO org.apache.hadoop.ha.SshFenceByTcpPort.jsch: Disconnecting from zy03-cap-21m3aser-074 port 22
2020-07-27 09:41:16,305 WARN org.apache.hadoop.ha.NodeFencer: Fencing method org.apache.hadoop.ha.SshFenceByTcpPort(null) was unsuccessful.
2020-07-27 09:41:16,305 ERROR org.apache.hadoop.ha.NodeFencer: Unable to fence service by any configured method.
2020-07-27 09:41:16,305 INFO org.apache.hadoop.ha.SshFenceByTcpPort.jsch: Caught an exception, leaving main loop due to Socket closed
2020-07-27 09:41:16,305 WARN org.apache.hadoop.ha.ActiveStandbyElector: Exception handling the winning of election
配置文件里面配置的fence方法
<property>
<name>dfs.ha.fencing.methods</name>
<value>
sshfence
shell(/bin/true)
</value>
</property>
从日志里面看出来,两种fence都失败了
方式一:使用fuser 命令
从日志里面看出来,fuser 命令没有找到,导致失败
解决办法
yum install -y psmisc
方式二: 使用shell的方式
Fencing method org.apache.hadoop.ha.SshFenceByTcpPort(null) was unsuccessful. 可以看出来,秘钥失效