Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to specify multiple fencing methods in dfs.ha.fencing.methods

avatar
Master Guru

This is new question based on answers provided at https://community.hortonworks.com/questions/23046/question-on-hdfs-automatic-failover.html

Question - If I need to define multiple fencing methods in dfs.ha.fencing.methods (hdfs-site.xml), how should I do that? Is that even possible? I tried putting comma separated values, semi colon separated, colon separated but nothing worked(I got parsing error in ZKFC logs)

Please suggest.

1 ACCEPTED SOLUTION

avatar
Master Guru

Nevermind! I have figured out the problem.

Many Thanks to @Hajime and @Sagar Shimpi for helping me here.

To add multiple fencing methods we need to run below command from Ambari Server

/var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin set <ambari-host> <cluster-name> hdfs-site dfs.ha.fencing.methods  "sshfence\\nshell(/bin/true)"

I think this is a bug with Ambari, I will make sure to file a Ambari BUG for this today.

View solution in original post

4 REPLIES 4

avatar
Master Guru

More info - according to this link, value of dfs.ha.fencing.methods shows 2 fencing methods, each one is on new line. I believe we cannot enter it using ambari UI. Not sure if that link has valid and verified information.

avatar

https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.ht...

According to above link, it seems it accepts carriage-return-separated list.

avatar
Master Guru

Thanks @Hajime - It was a real hint for solving this issue

avatar
Master Guru

Nevermind! I have figured out the problem.

Many Thanks to @Hajime and @Sagar Shimpi for helping me here.

To add multiple fencing methods we need to run below command from Ambari Server

/var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin set <ambari-host> <cluster-name> hdfs-site dfs.ha.fencing.methods  "sshfence\\nshell(/bin/true)"

I think this is a bug with Ambari, I will make sure to file a Ambari BUG for this today.