CommandsManual.apt.vm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. ~~ Licensed to the Apache Software Foundation (ASF) under one or more
  2. ~~ contributor license agreements. See the NOTICE file distributed with
  3. ~~ this work for additional information regarding copyright ownership.
  4. ~~ The ASF licenses this file to You under the Apache License, Version 2.0
  5. ~~ (the "License"); you may not use this file except in compliance with
  6. ~~ the License. You may obtain a copy of the License at
  7. ~~
  8. ~~ http://www.apache.org/licenses/LICENSE-2.0
  9. ~~
  10. ~~ Unless required by applicable law or agreed to in writing, software
  11. ~~ distributed under the License is distributed on an "AS IS" BASIS,
  12. ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. ~~ See the License for the specific language governing permissions and
  14. ~~ limitations under the License.
  15. ---
  16. Hadoop Commands Guide
  17. ---
  18. ---
  19. ${maven.build.timestamp}
  20. %{toc}
  21. Overview
  22. All hadoop commands are invoked by the <<<bin/hadoop>>> script. Running the
  23. hadoop script without any arguments prints the description for all
  24. commands.
  25. Usage: <<<hadoop [--config confdir] [COMMAND] [GENERIC_OPTIONS] [COMMAND_OPTIONS]>>>
  26. Hadoop has an option parsing framework that employs parsing generic
  27. options as well as running classes.
  28. *-----------------------+---------------+
  29. || COMMAND_OPTION || Description
  30. *-----------------------+---------------+
  31. | <<<--config confdir>>>| Overwrites the default Configuration directory. Default is <<<${HADOOP_HOME}/conf>>>.
  32. *-----------------------+---------------+
  33. | GENERIC_OPTIONS | The common set of options supported by multiple commands.
  34. | COMMAND_OPTIONS | Various commands with their options are described in the following sections. The commands have been grouped into User Commands and Administration Commands.
  35. *-----------------------+---------------+
  36. Generic Options
  37. The following options are supported by {{dfsadmin}}, {{fs}}, {{fsck}},
  38. {{job}} and {{fetchdt}}. Applications should implement
  39. {{{../../api/org/apache/hadoop/util/Tool.html}Tool}} to support
  40. GenericOptions.
  41. *------------------------------------------------+-----------------------------+
  42. || GENERIC_OPTION || Description
  43. *------------------------------------------------+-----------------------------+
  44. |<<<-conf \<configuration file\> >>> | Specify an application
  45. | configuration file.
  46. *------------------------------------------------+-----------------------------+
  47. |<<<-D \<property\>=\<value\> >>> | Use value for given property.
  48. *------------------------------------------------+-----------------------------+
  49. |<<<-jt \<local\> or \<resourcemanager:port\>>>> | Specify a ResourceManager.
  50. | Applies only to job.
  51. *------------------------------------------------+-----------------------------+
  52. |<<<-files \<comma separated list of files\> >>> | Specify comma separated files
  53. | to be copied to the map
  54. | reduce cluster. Applies only
  55. | to job.
  56. *------------------------------------------------+-----------------------------+
  57. |<<<-libjars \<comma seperated list of jars\> >>>| Specify comma separated jar
  58. | files to include in the
  59. | classpath. Applies only to
  60. | job.
  61. *------------------------------------------------+-----------------------------+
  62. |<<<-archives \<comma separated list of archives\> >>> | Specify comma separated
  63. | archives to be unarchived on
  64. | the compute machines. Applies
  65. | only to job.
  66. *------------------------------------------------+-----------------------------+
  67. User Commands
  68. Commands useful for users of a hadoop cluster.
  69. * <<<archive>>>
  70. Creates a hadoop archive. More information can be found at
  71. {{{../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/HadoopArchives.html}
  72. Hadoop Archives Guide}}.
  73. * <<<credential>>>
  74. Command to manage credentials, passwords and secrets within credential providers.
  75. The CredentialProvider API in Hadoop allows for the separation of applications
  76. and how they store their required passwords/secrets. In order to indicate
  77. a particular provider type and location, the user must provide the
  78. <hadoop.security.credential.provider.path> configuration element in core-site.xml
  79. or use the command line option <<<-provider>>> on each of the following commands.
  80. This provider path is a comma-separated list of URLs that indicates the type and
  81. location of a list of providers that should be consulted.
  82. For example, the following path:
  83. <<<user:///,jceks://file/tmp/test.jceks,jceks://hdfs@nn1.example.com/my/path/test.jceks>>>
  84. indicates that the current user's credentials file should be consulted through
  85. the User Provider, that the local file located at <<</tmp/test.jceks>>> is a Java Keystore
  86. Provider and that the file located within HDFS at <<<nn1.example.com/my/path/test.jceks>>>
  87. is also a store for a Java Keystore Provider.
  88. When utilizing the credential command it will often be for provisioning a password
  89. or secret to a particular credential store provider. In order to explicitly
  90. indicate which provider store to use the <<<-provider>>> option should be used. Otherwise,
  91. given a path of multiple providers, the first non-transient provider will be used.
  92. This may or may not be the one that you intended.
  93. Example: <<<-provider jceks://file/tmp/test.jceks>>>
  94. Usage: <<<hadoop credential <subcommand> [options]>>>
  95. *-------------------+-------------------------------------------------------+
  96. ||COMMAND_OPTION || Description
  97. *-------------------+-------------------------------------------------------+
  98. | create <alias> [-v <value>][-provider <provider-path>]| Prompts the user for
  99. | a credential to be stored as the given alias when a value
  100. | is not provided via <<<-v>>>. The
  101. | <hadoop.security.credential.provider.path> within the
  102. | core-site.xml file will be used unless a <<<-provider>>> is
  103. | indicated.
  104. *-------------------+-------------------------------------------------------+
  105. | delete <alias> [-i][-provider <provider-path>] | Deletes the credential with
  106. | the provided alias and optionally warns the user when
  107. | <<<--interactive>>> is used.
  108. | The <hadoop.security.credential.provider.path> within the
  109. | core-site.xml file will be used unless a <<<-provider>>> is
  110. | indicated.
  111. *-------------------+-------------------------------------------------------+
  112. | list [-provider <provider-path>] | Lists all of the credential aliases
  113. | The <hadoop.security.credential.provider.path> within the
  114. | core-site.xml file will be used unless a <<<-provider>>> is
  115. | indicated.
  116. *-------------------+-------------------------------------------------------+
  117. * <<<distcp>>>
  118. Copy file or directories recursively. More information can be found at
  119. {{{../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistCp.html}
  120. Hadoop DistCp Guide}}.
  121. * <<<fs>>>
  122. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#dfs}<<<hdfs dfs>>>}}
  123. instead.
  124. * <<<fsck>>>
  125. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#fsck}<<<hdfs fsck>>>}}
  126. instead.
  127. * <<<fetchdt>>>
  128. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#fetchdt}
  129. <<<hdfs fetchdt>>>}} instead.
  130. * <<<jar>>>
  131. Runs a jar file. Users can bundle their Map Reduce code in a jar file and
  132. execute it using this command.
  133. Usage: <<<hadoop jar <jar> [mainClass] args...>>>
  134. The streaming jobs are run via this command. Examples can be referred from
  135. Streaming examples
  136. Word count example is also run using jar command. It can be referred from
  137. Wordcount example
  138. * <<<job>>>
  139. Deprecated. Use
  140. {{{../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html#job}
  141. <<<mapred job>>>}} instead.
  142. * <<<pipes>>>
  143. Deprecated. Use
  144. {{{../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html#pipes}
  145. <<<mapred pipes>>>}} instead.
  146. * <<<queue>>>
  147. Deprecated. Use
  148. {{{../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html#queue}
  149. <<<mapred queue>>>}} instead.
  150. * <<<version>>>
  151. Prints the version.
  152. Usage: <<<hadoop version>>>
  153. * <<<CLASSNAME>>>
  154. hadoop script can be used to invoke any class.
  155. Usage: <<<hadoop CLASSNAME>>>
  156. Runs the class named <<<CLASSNAME>>>.
  157. * <<<classpath>>>
  158. Prints the class path needed to get the Hadoop jar and the required
  159. libraries. If called without arguments, then prints the classpath set up by
  160. the command scripts, which is likely to contain wildcards in the classpath
  161. entries. Additional options print the classpath after wildcard expansion or
  162. write the classpath into the manifest of a jar file. The latter is useful in
  163. environments where wildcards cannot be used and the expanded classpath exceeds
  164. the maximum supported command line length.
  165. Usage: <<<hadoop classpath [--glob|--jar <path>|-h|--help]>>>
  166. *-----------------+-----------------------------------------------------------+
  167. || COMMAND_OPTION || Description
  168. *-----------------+-----------------------------------------------------------+
  169. | --glob | expand wildcards
  170. *-----------------+-----------------------------------------------------------+
  171. | --jar <path> | write classpath as manifest in jar named <path>
  172. *-----------------+-----------------------------------------------------------+
  173. | -h, --help | print help
  174. *-----------------+-----------------------------------------------------------+
  175. Administration Commands
  176. Commands useful for administrators of a hadoop cluster.
  177. * <<<balancer>>>
  178. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#balancer}
  179. <<<hdfs balancer>>>}} instead.
  180. * <<<daemonlog>>>
  181. Get/Set the log level for each daemon.
  182. Usage: <<<hadoop daemonlog -getlevel <host:port> <name> >>>
  183. Usage: <<<hadoop daemonlog -setlevel <host:port> <name> <level> >>>
  184. *------------------------------+-----------------------------------------------------------+
  185. || COMMAND_OPTION || Description
  186. *------------------------------+-----------------------------------------------------------+
  187. | -getlevel <host:port> <name> | Prints the log level of the daemon running at
  188. | <host:port>. This command internally connects
  189. | to http://<host:port>/logLevel?log=<name>
  190. *------------------------------+-----------------------------------------------------------+
  191. | -setlevel <host:port> <name> <level> | Sets the log level of the daemon
  192. | running at <host:port>. This command internally
  193. | connects to http://<host:port>/logLevel?log=<name>
  194. *------------------------------+-----------------------------------------------------------+
  195. * <<<datanode>>>
  196. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#datanode}
  197. <<<hdfs datanode>>>}} instead.
  198. * <<<dfsadmin>>>
  199. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#dfsadmin}
  200. <<<hdfs dfsadmin>>>}} instead.
  201. * <<<namenode>>>
  202. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#namenode}
  203. <<<hdfs namenode>>>}} instead.
  204. * <<<secondarynamenode>>>
  205. Deprecated, use {{{../hadoop-hdfs/HDFSCommands.html#secondarynamenode}
  206. <<<hdfs secondarynamenode>>>}} instead.