最近遇到一个用到HDFS的项目,于是在测试环境安装了一套HDFS。在测试HA的故障转移的功能时发现namenode无法故障转移,经过一番认证排查发现是由于修改了SSH默认端口导致的。
于是乎就去翻官方文档,翻啊翻,终于看到这么一段话,如下:
Optionally, one may configure a non-standard username or port to perform the SSH. One may also configure a timeout, in milliseconds, for the SSH, after which this fencing method will be considered to have failed. It may be configured like so:
大概意思呢就是:如果你配置了ssh默认端口和用户名,你可以使用下面的配置。你也可以指定一个超时时间。
<property>
<name>dfs.ha.fencing.methods</name>
<value>sshfence([[username][:port]])</value>
</property>
<property>
<name>dfs.ha.fencing.ssh.connect-timeout</name>
<value>30000</value>
</property>
于是就按照官方文档里的描述配置,经测试问题解决。
这虽不是什么大的成功,但是对于一个英文水平不好&&不喜欢看官方文档的人来说应该算是值得记录一件事。