Ver código fonte

HADOOP-18314. Add some description for PowerShellFencer. (#4505)

jianghuazhu 2 anos atrás
pai
commit
321a4844ad

+ 1 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/NodeFencer.java

@@ -48,6 +48,7 @@ import org.slf4j.LoggerFactory;
  * <ul>
  * <ul>
  * <li><code>shell(/path/to/some/script.sh args...)</code></li>
  * <li><code>shell(/path/to/some/script.sh args...)</code></li>
  * <li><code>sshfence(...)</code> (see {@link SshFenceByTcpPort})
  * <li><code>sshfence(...)</code> (see {@link SshFenceByTcpPort})
+ * <li><code>powershell(...)</code> (see {@link PowerShellFencer})
  * </ul>
  * </ul>
  */
  */
 @InterfaceAudience.Private
 @InterfaceAudience.Private

+ 4 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/PowerShellFencer.java

@@ -34,6 +34,10 @@ import org.slf4j.LoggerFactory;
  * Fencer method that uses PowerShell to remotely connect to a machine and kill
  * Fencer method that uses PowerShell to remotely connect to a machine and kill
  * the required process. This only works in Windows.
  * the required process. This only works in Windows.
  *
  *
+ * Fencing method uses PowerShell command. It should be specified
+ * in the fencing configuration like:<br>
+ * <code>powershell(NameNode)</code>
+ *
  * The argument passed to this fencer should be a unique string in the
  * The argument passed to this fencer should be a unique string in the
  * "CommandLine" attribute for the "java.exe" process. For example, the full
  * "CommandLine" attribute for the "java.exe" process. For example, the full
  * path for the Namenode: "org.apache.hadoop.hdfs.server.namenode.NameNode".
  * path for the Namenode: "org.apache.hadoop.hdfs.server.namenode.NameNode".

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/resources/core-default.xml

@@ -2930,7 +2930,7 @@ The switch to turn S3A auditing on or off.
   <value></value>
   <value></value>
   <description>
   <description>
     List of fencing methods to use for service fencing. May contain
     List of fencing methods to use for service fencing. May contain
-    builtin methods (eg shell and sshfence) or user-defined method.
+    builtin methods (eg shell, sshfence and powershell) or user-defined method.
   </description>
   </description>
 </property>
 </property>
 
 

+ 23 - 3
hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSHighAvailabilityWithNFS.md

@@ -192,8 +192,8 @@ The order in which you set these configurations is unimportant, but the values y
     terminated, before transitioning another NameNode to the Active state. In
     terminated, before transitioning another NameNode to the Active state. In
     order to do this, you must configure at least one **fencing method.** These are
     order to do this, you must configure at least one **fencing method.** These are
     configured as a carriage-return-separated list, which will be attempted in order
     configured as a carriage-return-separated list, which will be attempted in order
-    until one indicates that fencing has succeeded. There are two methods which
-    ship with Hadoop: *shell* and *sshfence*. For information on implementing
+    until one indicates that fencing has succeeded. There are three methods which
+    ship with Hadoop: *shell*, *sshfence* and *powershell*. For information on implementing
     your own custom fencing method, see the *org.apache.hadoop.ha.NodeFencer* class.
     your own custom fencing method, see the *org.apache.hadoop.ha.NodeFencer* class.
 
 
     - - -
     - - -
@@ -283,7 +283,27 @@ The order in which you set these configurations is unimportant, but the values y
     a subshell to kill its parent in some number of seconds).
     a subshell to kill its parent in some number of seconds).
 
 
     - - -
     - - -
-  
+
+    **powershell** - use PowerShell to remotely connect to a machine and kill
+    the required process
+
+    The *powershell* fencing method uses PowerShell command. It may be
+    configured like so:
+
+            <property>
+              <name>dfs.ha.fencing.methods</name>
+              <value>powershell(NameNode)</value>
+            </property>
+
+    The argument passed to this fencer should be a unique string in the "CommandLine"
+    attribute for the "java.exe" process. For example, the full path for the Namenode:
+    "org.apache.hadoop.hdfs.server.namenode.NameNode".
+    The administrator can also shorten the name to "Namenode" if it's unique.
+
+    **Note:** This only works in Windows.
+
+    - - -
+
 *   **fs.defaultFS** - the default path prefix used by the Hadoop FS client when none is given
 *   **fs.defaultFS** - the default path prefix used by the Hadoop FS client when none is given
 
 
     Optionally, you may now configure the default path for Hadoop clients to use
     Optionally, you may now configure the default path for Hadoop clients to use

+ 22 - 2
hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSHighAvailabilityWithQJM.md

@@ -239,8 +239,8 @@ The order in which you set these configurations is unimportant, but the values y
 
 
     The fencing methods used during a failover are configured as a
     The fencing methods used during a failover are configured as a
     carriage-return-separated list, which will be attempted in order until
     carriage-return-separated list, which will be attempted in order until
-    one indicates that fencing has succeeded. There are two methods which ship with
-    Hadoop: *shell* and *sshfence*. For information on implementing your own custom
+    one indicates that fencing has succeeded. There are three methods which ship with
+    Hadoop: *shell*, *sshfence* and *powershell*. For information on implementing your own custom
     fencing method, see the *org.apache.hadoop.ha.NodeFencer* class.
     fencing method, see the *org.apache.hadoop.ha.NodeFencer* class.
 
 
     - - -
     - - -
@@ -331,6 +331,26 @@ The order in which you set these configurations is unimportant, but the values y
 
 
     - - -
     - - -
 
 
+    **powershell** - use PowerShell to remotely connect to a machine and kill
+    the required process
+
+    The *powershell* fencing method uses PowerShell command. It may be
+    configured like so:
+
+            <property>
+              <name>dfs.ha.fencing.methods</name>
+              <value>powershell(NameNode)</value>
+            </property>
+
+    The argument passed to this fencer should be a unique string in the "CommandLine"
+    attribute for the "java.exe" process. For example, the full path for the Namenode:
+    "org.apache.hadoop.hdfs.server.namenode.NameNode".
+    The administrator can also shorten the name to "Namenode" if it's unique.
+
+    **Note:** This only works in Windows.
+
+    - - -
+
 *   **fs.defaultFS** - the default path prefix used by the Hadoop FS client when none is given
 *   **fs.defaultFS** - the default path prefix used by the Hadoop FS client when none is given
 
 
     Optionally, you may now configure the default path for Hadoop clients to use
     Optionally, you may now configure the default path for Hadoop clients to use