CommandsManual.apt.vm 12 KB

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