hadoop-env.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # Set Hadoop-specific environment variables here.
  18. ##
  19. ## THIS FILE ACTS AS THE MASTER FILE FOR ALL HADOOP PROJECTS.
  20. ## SETTINGS HERE WILL BE READ BY ALL HADOOP COMMANDS. THEREFORE,
  21. ## ONE CAN USE THIS FILE TO SET YARN, HDFS, AND MAPREDUCE
  22. ## CONFIGURATION OPTIONS INSTEAD OF xxx-env.sh.
  23. ##
  24. ## Precedence rules:
  25. ##
  26. ## {yarn-env.sh|hdfs-env.sh} > hadoop-env.sh > hard-coded defaults
  27. ##
  28. ## {YARN_xyz|HDFS_xyz} > HADOOP_xyz > hard-coded defaults
  29. ##
  30. # Many of the options here are built from the perspective that users
  31. # may want to provide OVERWRITING values on the command line.
  32. # For example:
  33. #
  34. # JAVA_HOME=/usr/java/testing hdfs dfs -ls
  35. #
  36. # Therefore, the vast majority (BUT NOT ALL!) of these defaults
  37. # are configured for substitution and not append. If append
  38. # is preferable, modify this file accordingly.
  39. ###
  40. # Generic settings for HADOOP
  41. ###
  42. # Technically, the only required environment variable is JAVA_HOME.
  43. # All others are optional. However, the defaults are probably not
  44. # preferred. Many sites configure these options outside of Hadoop,
  45. # such as in /etc/profile.d
  46. # The java implementation to use. By default, this environment
  47. # variable is REQUIRED on ALL platforms except OS X!
  48. # export JAVA_HOME=
  49. # Location of Hadoop. By default, Hadoop will attempt to determine
  50. # this location based upon its execution path.
  51. # export HADOOP_HOME=
  52. # Location of Hadoop's configuration information. i.e., where this
  53. # file is living. If this is not defined, Hadoop will attempt to
  54. # locate it based upon its execution path.
  55. #
  56. # NOTE: It is recommend that this variable not be set here but in
  57. # /etc/profile.d or equivalent. Some options (such as
  58. # --config) may react strangely otherwise.
  59. #
  60. # export HADOOP_CONF_DIR=${HADOOP_HOME}/etc/hadoop
  61. # The maximum amount of heap to use (Java -Xmx). If no unit
  62. # is provided, it will be converted to MB. Daemons will
  63. # prefer any Xmx setting in their respective _OPT variable.
  64. # There is no default; the JVM will autoscale based upon machine
  65. # memory size.
  66. # export HADOOP_HEAPSIZE_MAX=
  67. # The minimum amount of heap to use (Java -Xms). If no unit
  68. # is provided, it will be converted to MB. Daemons will
  69. # prefer any Xms setting in their respective _OPT variable.
  70. # There is no default; the JVM will autoscale based upon machine
  71. # memory size.
  72. # export HADOOP_HEAPSIZE_MIN=
  73. # Enable extra debugging of Hadoop's JAAS binding, used to set up
  74. # Kerberos security.
  75. # export HADOOP_JAAS_DEBUG=true
  76. # Extra Java runtime options for all Hadoop commands. We don't support
  77. # IPv6 yet/still, so by default the preference is set to IPv4.
  78. # export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true"
  79. # For Kerberos debugging, an extended option set logs more invormation
  80. # export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true -Dsun.security.krb5.debug=true -Dsun.security.spnego.debug"
  81. # Some parts of the shell code may do special things dependent upon
  82. # the operating system. We have to set this here. See the next
  83. # section as to why....
  84. export HADOOP_OS_TYPE=${HADOOP_OS_TYPE:-$(uname -s)}
  85. # Under certain conditions, Java on OS X will throw SCDynamicStore errors
  86. # in the system logs.
  87. # See HADOOP-8719 for more information. If one needs Kerberos
  88. # support on OS X, one will want to change/remove this extra bit.
  89. case ${HADOOP_OS_TYPE} in
  90. Darwin*)
  91. export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.realm= "
  92. export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.kdc= "
  93. export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.conf= "
  94. ;;
  95. esac
  96. # Extra Java runtime options for some Hadoop commands
  97. # and clients (i.e., hdfs dfs -blah). These get appended to HADOOP_OPTS for
  98. # such commands. In most cases, # this should be left empty and
  99. # let users supply it on the command line.
  100. # export HADOOP_CLIENT_OPTS=""
  101. #
  102. # A note about classpaths.
  103. #
  104. # By default, Apache Hadoop overrides Java's CLASSPATH
  105. # environment variable. It is configured such
  106. # that it sarts out blank with new entries added after passing
  107. # a series of checks (file/dir exists, not already listed aka
  108. # de-deduplication). During de-depulication, wildcards and/or
  109. # directories are *NOT* expanded to keep it simple. Therefore,
  110. # if the computed classpath has two specific mentions of
  111. # awesome-methods-1.0.jar, only the first one added will be seen.
  112. # If two directories are in the classpath that both contain
  113. # awesome-methods-1.0.jar, then Java will pick up both versions.
  114. # An additional, custom CLASSPATH. Site-wide configs should be
  115. # handled via the shellprofile functionality, utilizing the
  116. # hadoop_add_classpath function for greater control and much
  117. # harder for apps/end-users to accidentally override.
  118. # Similarly, end users should utilize ${HOME}/.hadooprc .
  119. # This variable should ideally only be used as a short-cut,
  120. # interactive way for temporary additions on the command line.
  121. # export HADOOP_CLASSPATH="/some/cool/path/on/your/machine"
  122. # Should HADOOP_CLASSPATH be first in the official CLASSPATH?
  123. # export HADOOP_USER_CLASSPATH_FIRST="yes"
  124. # If HADOOP_USE_CLIENT_CLASSLOADER is set, the classpath along
  125. # with the main jar are handled by a separate isolated
  126. # client classloader when 'hadoop jar', 'yarn jar', or 'mapred job'
  127. # is utilized. If it is set, HADOOP_CLASSPATH and
  128. # HADOOP_USER_CLASSPATH_FIRST are ignored.
  129. # export HADOOP_USE_CLIENT_CLASSLOADER=true
  130. # HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES overrides the default definition of
  131. # system classes for the client classloader when HADOOP_USE_CLIENT_CLASSLOADER
  132. # is enabled. Names ending in '.' (period) are treated as package names, and
  133. # names starting with a '-' are treated as negative matches. For example,
  134. # export HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES="-org.apache.hadoop.UserClass,java.,javax.,org.apache.hadoop."
  135. # Enable optional, bundled Hadoop features
  136. # This is a comma delimited list. It may NOT be overridden via .hadooprc
  137. # Entries may be added/removed as needed.
  138. # export HADOOP_OPTIONAL_TOOLS="@@@HADOOP_OPTIONAL_TOOLS@@@"
  139. ###
  140. # Options for remote shell connectivity
  141. ###
  142. # There are some optional components of hadoop that allow for
  143. # command and control of remote hosts. For example,
  144. # start-dfs.sh will attempt to bring up all NNs, DNS, etc.
  145. # Options to pass to SSH when one of the "log into a host and
  146. # start/stop daemons" scripts is executed
  147. # export HADOOP_SSH_OPTS="-o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=10s"
  148. # The built-in ssh handler will limit itself to 10 simultaneous connections.
  149. # For pdsh users, this sets the fanout size ( -f )
  150. # Change this to increase/decrease as necessary.
  151. # export HADOOP_SSH_PARALLEL=10
  152. # Filename which contains all of the hosts for any remote execution
  153. # helper scripts # such as workers.sh, start-dfs.sh, etc.
  154. # export HADOOP_WORKERS="${HADOOP_CONF_DIR}/workers"
  155. ###
  156. # Options for all daemons
  157. ###
  158. #
  159. #
  160. # Many options may also be specified as Java properties. It is
  161. # very common, and in many cases, desirable, to hard-set these
  162. # in daemon _OPTS variables. Where applicable, the appropriate
  163. # Java property is also identified. Note that many are re-used
  164. # or set differently in certain contexts (e.g., secure vs
  165. # non-secure)
  166. #
  167. # Where (primarily) daemon log files are stored.
  168. # ${HADOOP_HOME}/logs by default.
  169. # Java property: hadoop.log.dir
  170. # export HADOOP_LOG_DIR=${HADOOP_HOME}/logs
  171. # A string representing this instance of hadoop. $USER by default.
  172. # This is used in writing log and pid files, so keep that in mind!
  173. # Java property: hadoop.id.str
  174. # export HADOOP_IDENT_STRING=$USER
  175. # How many seconds to pause after stopping a daemon
  176. # export HADOOP_STOP_TIMEOUT=5
  177. # Where pid files are stored. /tmp by default.
  178. # export HADOOP_PID_DIR=/tmp
  179. # Default log4j setting for interactive commands
  180. # Java property: hadoop.root.logger
  181. # export HADOOP_ROOT_LOGGER=INFO,console
  182. # Default log4j setting for daemons spawned explicitly by
  183. # --daemon option of hadoop, hdfs, mapred and yarn command.
  184. # Java property: hadoop.root.logger
  185. # export HADOOP_DAEMON_ROOT_LOGGER=INFO,RFA
  186. # Default log level and output location for security-related messages.
  187. # You will almost certainly want to change this on a per-daemon basis via
  188. # the Java property (i.e., -Dhadoop.security.logger=foo). (Note that the
  189. # defaults for the NN and 2NN override this by default.)
  190. # Java property: hadoop.security.logger
  191. # export HADOOP_SECURITY_LOGGER=INFO,NullAppender
  192. # Default process priority level
  193. # Note that sub-processes will also run at this level!
  194. # export HADOOP_NICENESS=0
  195. # Default name for the service level authorization file
  196. # Java property: hadoop.policy.file
  197. # export HADOOP_POLICYFILE="hadoop-policy.xml"
  198. #
  199. # NOTE: this is not used by default! <-----
  200. # You can define variables right here and then re-use them later on.
  201. # For example, it is common to use the same garbage collection settings
  202. # for all the daemons. So one could define:
  203. #
  204. # export HADOOP_GC_SETTINGS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
  205. #
  206. # .. and then use it as per the b option under the namenode.
  207. ###
  208. # Secure/privileged execution
  209. ###
  210. #
  211. # Out of the box, Hadoop uses jsvc from Apache Commons to launch daemons
  212. # on privileged ports. This functionality can be replaced by providing
  213. # custom functions. See hadoop-functions.sh for more information.
  214. #
  215. # The jsvc implementation to use. Jsvc is required to run secure datanodes
  216. # that bind to privileged ports to provide authentication of data transfer
  217. # protocol. Jsvc is not required if SASL is configured for authentication of
  218. # data transfer protocol using non-privileged ports.
  219. # export JSVC_HOME=/usr/bin
  220. #
  221. # This directory contains pids for secure and privileged processes.
  222. #export HADOOP_SECURE_PID_DIR=${HADOOP_PID_DIR}
  223. #
  224. # This directory contains the logs for secure and privileged processes.
  225. # Java property: hadoop.log.dir
  226. # export HADOOP_SECURE_LOG=${HADOOP_LOG_DIR}
  227. #
  228. # When running a secure daemon, the default value of HADOOP_IDENT_STRING
  229. # ends up being a bit bogus. Therefore, by default, the code will
  230. # replace HADOOP_IDENT_STRING with HADOOP_xx_SECURE_USER. If one wants
  231. # to keep HADOOP_IDENT_STRING untouched, then uncomment this line.
  232. # export HADOOP_SECURE_IDENT_PRESERVE="true"
  233. ###
  234. # NameNode specific parameters
  235. ###
  236. # Default log level and output location for file system related change
  237. # messages. For non-namenode daemons, the Java property must be set in
  238. # the appropriate _OPTS if one wants something other than INFO,NullAppender
  239. # Java property: hdfs.audit.logger
  240. # export HDFS_AUDIT_LOGGER=INFO,NullAppender
  241. # Specify the JVM options to be used when starting the NameNode.
  242. # These options will be appended to the options specified as HADOOP_OPTS
  243. # and therefore may override any similar flags set in HADOOP_OPTS
  244. #
  245. # a) Set JMX options
  246. # export HDFS_NAMENODE_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1026"
  247. #
  248. # b) Set garbage collection logs
  249. # export HDFS_NAMENODE_OPTS="${HADOOP_GC_SETTINGS} -Xloggc:${HADOOP_LOG_DIR}/gc-rm.log-$(date +'%Y%m%d%H%M')"
  250. #
  251. # c) ... or set them directly
  252. # export HDFS_NAMENODE_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:${HADOOP_LOG_DIR}/gc-rm.log-$(date +'%Y%m%d%H%M')"
  253. # this is the default:
  254. # export HDFS_NAMENODE_OPTS="-Dhadoop.security.logger=INFO,RFAS"
  255. ###
  256. # SecondaryNameNode specific parameters
  257. ###
  258. # Specify the JVM options to be used when starting the SecondaryNameNode.
  259. # These options will be appended to the options specified as HADOOP_OPTS
  260. # and therefore may override any similar flags set in HADOOP_OPTS
  261. #
  262. # This is the default:
  263. # export HDFS_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=INFO,RFAS"
  264. ###
  265. # DataNode specific parameters
  266. ###
  267. # Specify the JVM options to be used when starting the DataNode.
  268. # These options will be appended to the options specified as HADOOP_OPTS
  269. # and therefore may override any similar flags set in HADOOP_OPTS
  270. #
  271. # This is the default:
  272. # export HDFS_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS"
  273. # On secure datanodes, user to run the datanode as after dropping privileges.
  274. # This **MUST** be uncommented to enable secure HDFS if using privileged ports
  275. # to provide authentication of data transfer protocol. This **MUST NOT** be
  276. # defined if SASL is configured for authentication of data transfer protocol
  277. # using non-privileged ports.
  278. # This will replace the hadoop.id.str Java property in secure mode.
  279. # export HDFS_DATANODE_SECURE_USER=hdfs
  280. # Supplemental options for secure datanodes
  281. # By default, Hadoop uses jsvc which needs to know to launch a
  282. # server jvm.
  283. # export HDFS_DATANODE_SECURE_EXTRA_OPTS="-jvm server"
  284. ###
  285. # NFS3 Gateway specific parameters
  286. ###
  287. # Specify the JVM options to be used when starting the NFS3 Gateway.
  288. # These options will be appended to the options specified as HADOOP_OPTS
  289. # and therefore may override any similar flags set in HADOOP_OPTS
  290. #
  291. # export HDFS_NFS3_OPTS=""
  292. # Specify the JVM options to be used when starting the Hadoop portmapper.
  293. # These options will be appended to the options specified as HADOOP_OPTS
  294. # and therefore may override any similar flags set in HADOOP_OPTS
  295. #
  296. # export HDFS_PORTMAP_OPTS="-Xmx512m"
  297. # Supplemental options for priviliged gateways
  298. # By default, Hadoop uses jsvc which needs to know to launch a
  299. # server jvm.
  300. # export HDFS_NFS3_SECURE_EXTRA_OPTS="-jvm server"
  301. # On privileged gateways, user to run the gateway as after dropping privileges
  302. # This will replace the hadoop.id.str Java property in secure mode.
  303. # export HDFS_NFS3_SECURE_USER=nfsserver
  304. ###
  305. # ZKFailoverController specific parameters
  306. ###
  307. # Specify the JVM options to be used when starting the ZKFailoverController.
  308. # These options will be appended to the options specified as HADOOP_OPTS
  309. # and therefore may override any similar flags set in HADOOP_OPTS
  310. #
  311. # export HDFS_ZKFC_OPTS=""
  312. ###
  313. # QuorumJournalNode specific parameters
  314. ###
  315. # Specify the JVM options to be used when starting the QuorumJournalNode.
  316. # These options will be appended to the options specified as HADOOP_OPTS
  317. # and therefore may override any similar flags set in HADOOP_OPTS
  318. #
  319. # export HDFS_JOURNALNODE_OPTS=""
  320. ###
  321. # HDFS Balancer specific parameters
  322. ###
  323. # Specify the JVM options to be used when starting the HDFS Balancer.
  324. # These options will be appended to the options specified as HADOOP_OPTS
  325. # and therefore may override any similar flags set in HADOOP_OPTS
  326. #
  327. # export HDFS_BALANCER_OPTS=""
  328. ###
  329. # HDFS Mover specific parameters
  330. ###
  331. # Specify the JVM options to be used when starting the HDFS Mover.
  332. # These options will be appended to the options specified as HADOOP_OPTS
  333. # and therefore may override any similar flags set in HADOOP_OPTS
  334. #
  335. # export HDFS_MOVER_OPTS=""
  336. ###
  337. # Router-based HDFS Federation specific parameters
  338. # Specify the JVM options to be used when starting the RBF Routers.
  339. # These options will be appended to the options specified as HADOOP_OPTS
  340. # and therefore may override any similar flags set in HADOOP_OPTS
  341. #
  342. # export HDFS_DFSROUTER_OPTS=""
  343. ###
  344. # HDFS Key Space Manager specific parameters
  345. ###
  346. # Specify the JVM options to be used when starting the HDFS Key Space Manager.
  347. # These options will be appended to the options specified as HADOOP_OPTS
  348. # and therefore may override any similar flags set in HADOOP_OPTS
  349. #
  350. # export HDFS_KSM_OPTS=""
  351. ###
  352. # HDFS StorageContainerManager specific parameters
  353. ###
  354. # Specify the JVM options to be used when starting the HDFS Storage Container Manager.
  355. # These options will be appended to the options specified as HADOOP_OPTS
  356. # and therefore may override any similar flags set in HADOOP_OPTS
  357. #
  358. # export HDFS_STORAGECONTAINERMANAGER_OPTS=""
  359. ###
  360. # Advanced Users Only!
  361. ###
  362. #
  363. # When building Hadoop, one can add the class paths to the commands
  364. # via this special env var:
  365. # export HADOOP_ENABLE_BUILD_PATHS="true"
  366. #
  367. # To prevent accidents, shell commands be (superficially) locked
  368. # to only allow certain users to execute certain subcommands.
  369. # It uses the format of (command)_(subcommand)_USER.
  370. #
  371. # For example, to limit who can execute the namenode command,
  372. # export HDFS_NAMENODE_USER=hdfs