Database Reference
In-Depth Information
In the preceding configuration, we are using the sshfence option. The private keys of
username, admin, are being used to perform an SSH without passphrase.
Another way to configure sshfence would be to use a nonstandard username and port
to connect via SSH as shown in the following code:
<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>
A timeout property can be configured to time out the SSH session. If the SSH times out,
the fencing mechanism is considered to have failed.
The shell fencing option provides a way to run arbitrary shell commands to fence the
active namenode as shown in the following code:
<property>
<name>dfs.ha.fencing.methods</name>
<value>shell(/path/to/my/script.sh
-namenode=$target_host-nameservice=$target_nameserviceid)</value>
</property>
The following is the list of variables with reference to the node that needs to be fenced:
Variable
Description
The hostname of the node to be fenced
$target_host
$target_port
The IPC port of the node to be fenced
$target_address
The combination of the preceding two is configured as <host:port>
$target_nameserviceid The NameserviceID of the namenode to be fenced
Search WWH ::




Custom Search