hadoop-env.sh 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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 probably living. Many sites will also set this in the
  54. # same location where JAVA_HOME is defined. If this is not defined
  55. # Hadoop will attempt to locate it based upon its execution
  56. # path.
  57. # export HADOOP_CONF_DIR=${HADOOP_HOME}/etc/hadoop
  58. # The maximum amount of heap to use (Java -Xmx). If no unit
  59. # is provided, it will be converted to MB. Daemons will
  60. # prefer any Xmx setting in their respective _OPT variable.
  61. # There is no default; the JVM will autoscale based upon machine
  62. # memory size.
  63. # export HADOOP_HEAPSIZE_MAX=
  64. # The minimum amount of heap to use (Java -Xms). If no unit
  65. # is provided, it will be converted to MB. Daemons will
  66. # prefer any Xms setting in their respective _OPT variable.
  67. # There is no default; the JVM will autoscale based upon machine
  68. # memory size.
  69. # export HADOOP_HEAPSIZE_MIN=
  70. # Enable extra debugging of Hadoop's JAAS binding, used to set up
  71. # Kerberos security.
  72. # export HADOOP_JAAS_DEBUG=true
  73. # Extra Java runtime options for all Hadoop commands. We don't support
  74. # IPv6 yet/still, so by default the preference is set to IPv4.
  75. # export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true"
  76. # For Kerberos debugging, an extended option set logs more invormation
  77. # export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true -Dsun.security.krb5.debug=true -Dsun.security.spnego.debug"
  78. # Some parts of the shell code may do special things dependent upon
  79. # the operating system. We have to set this here. See the next
  80. # section as to why....
  81. export HADOOP_OS_TYPE=${HADOOP_OS_TYPE:-$(uname -s)}
  82. # Under certain conditions, Java on OS X will throw SCDynamicStore errors
  83. # in the system logs.
  84. # See HADOOP-8719 for more information. If one needs Kerberos
  85. # support on OS X, one will want to change/remove this extra bit.
  86. case ${HADOOP_OS_TYPE} in
  87. Darwin*)
  88. export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.realm= "
  89. export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.kdc= "
  90. export HADOOP_OPTS="${HADOOP_OPTS} -Djava.security.krb5.conf= "
  91. ;;
  92. esac
  93. # Extra Java runtime options for some Hadoop commands
  94. # and clients (i.e., hdfs dfs -blah). These get appended to HADOOP_OPTS for
  95. # such commands. In most cases, # this should be left empty and
  96. # let users supply it on the command line.
  97. # export HADOOP_CLIENT_OPTS=""
  98. #
  99. # A note about classpaths.
  100. #
  101. # By default, Apache Hadoop overrides Java's CLASSPATH
  102. # environment variable. It is configured such
  103. # that it sarts out blank with new entries added after passing
  104. # a series of checks (file/dir exists, not already listed aka
  105. # de-deduplication). During de-depulication, wildcards and/or
  106. # directories are *NOT* expanded to keep it simple. Therefore,
  107. # if the computed classpath has two specific mentions of
  108. # awesome-methods-1.0.jar, only the first one added will be seen.
  109. # If two directories are in the classpath that both contain
  110. # awesome-methods-1.0.jar, then Java will pick up both versions.
  111. # An additional, custom CLASSPATH. Site-wide configs should be
  112. # handled via the shellprofile functionality, utilizing the
  113. # hadoop_add_classpath function for greater control and much
  114. # harder for apps/end-users to accidentally override.
  115. # Similarly, end users should utilize ${HOME}/.hadooprc .
  116. # This variable should ideally only be used as a short-cut,
  117. # interactive way for temporary additions on the command line.
  118. # export HADOOP_CLASSPATH="/some/cool/path/on/your/machine"
  119. # Should HADOOP_CLASSPATH be first in the official CLASSPATH?
  120. # export HADOOP_USER_CLASSPATH_FIRST="yes"
  121. # If HADOOP_USE_CLIENT_CLASSLOADER is set, the classpath along
  122. # with the main jar are handled by a separate isolated
  123. # client classloader when 'hadoop jar', 'yarn jar', or 'mapred job'
  124. # is utilized. If it is set, HADOOP_CLASSPATH and
  125. # HADOOP_USER_CLASSPATH_FIRST are ignored.
  126. # export HADOOP_USE_CLIENT_CLASSLOADER=true
  127. # HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES overrides the default definition of
  128. # system classes for the client classloader when HADOOP_USE_CLIENT_CLASSLOADER
  129. # is enabled. Names ending in '.' (period) are treated as package names, and
  130. # names starting with a '-' are treated as negative matches. For example,
  131. # export HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES="-org.apache.hadoop.UserClass,java.,javax.,org.apache.hadoop."
  132. # Enable optional, bundled Hadoop features
  133. # This is a comma delimited list. It may NOT be overridden via .hadooprc
  134. # Entries may be added/removed as needed.
  135. # export HADOOP_OPTIONAL_TOOLS="@@@HADOOP_OPTIONAL_TOOLS@@@"
  136. ###
  137. # Options for remote shell connectivity
  138. ###
  139. # There are some optional components of hadoop that allow for
  140. # command and control of remote hosts. For example,
  141. # start-dfs.sh will attempt to bring up all NNs, DNS, etc.
  142. # Options to pass to SSH when one of the "log into a host and
  143. # start/stop daemons" scripts is executed
  144. # export HADOOP_SSH_OPTS="-o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=10s"
  145. # The built-in ssh handler will limit itself to 10 simultaneous connections.
  146. # For pdsh users, this sets the fanout size ( -f )
  147. # Change this to increase/decrease as necessary.
  148. # export HADOOP_SSH_PARALLEL=10
  149. # Filename which contains all of the hosts for any remote execution
  150. # helper scripts # such as workers.sh, start-dfs.sh, etc.
  151. # export HADOOP_WORKERS="${HADOOP_CONF_DIR}/workers"
  152. ###
  153. # Options for all daemons
  154. ###
  155. #
  156. #
  157. # Many options may also be specified as Java properties. It is
  158. # very common, and in many cases, desirable, to hard-set these
  159. # in daemon _OPTS variables. Where applicable, the appropriate
  160. # Java property is also identified. Note that many are re-used
  161. # or set differently in certain contexts (e.g., secure vs
  162. # non-secure)
  163. #
  164. # Where (primarily) daemon log files are stored.
  165. # ${HADOOP_HOME}/logs by default.
  166. # Java property: hadoop.log.dir
  167. # export HADOOP_LOG_DIR=${HADOOP_HOME}/logs
  168. # A string representing this instance of hadoop. $USER by default.
  169. # This is used in writing log and pid files, so keep that in mind!
  170. # Java property: hadoop.id.str
  171. # export HADOOP_IDENT_STRING=$USER
  172. # How many seconds to pause after stopping a daemon
  173. # export HADOOP_STOP_TIMEOUT=5
  174. # Where pid files are stored. /tmp by default.
  175. # export HADOOP_PID_DIR=/tmp
  176. # Default log4j setting for interactive commands
  177. # Java property: hadoop.root.logger
  178. # export HADOOP_ROOT_LOGGER=INFO,console
  179. # Default log4j setting for daemons spawned explicitly by
  180. # --daemon option of hadoop, hdfs, mapred and yarn command.
  181. # Java property: hadoop.root.logger
  182. # export HADOOP_DAEMON_ROOT_LOGGER=INFO,RFA
  183. # Default log level and output location for security-related messages.
  184. # You will almost certainly want to change this on a per-daemon basis via
  185. # the Java property (i.e., -Dhadoop.security.logger=foo). (Note that the
  186. # defaults for the NN and 2NN override this by default.)
  187. # Java property: hadoop.security.logger
  188. # export HADOOP_SECURITY_LOGGER=INFO,NullAppender
  189. # Default log level for file system audit messages.
  190. # Generally, this is specifically set in the namenode-specific
  191. # options line.
  192. # Java property: hdfs.audit.logger
  193. # export HADOOP_AUDIT_LOGGER=INFO,NullAppender
  194. # Default process priority level
  195. # Note that sub-processes will also run at this level!
  196. # export HADOOP_NICENESS=0
  197. # Default name for the service level authorization file
  198. # Java property: hadoop.policy.file
  199. # export HADOOP_POLICYFILE="hadoop-policy.xml"
  200. #
  201. # NOTE: this is not used by default! <-----
  202. # You can define variables right here and then re-use them later on.
  203. # For example, it is common to use the same garbage collection settings
  204. # for all the daemons. So one could define:
  205. #
  206. # export HADOOP_GC_SETTINGS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
  207. #
  208. # .. and then use it as per the b option under the namenode.
  209. ###
  210. # Secure/privileged execution
  211. ###
  212. #
  213. # Out of the box, Hadoop uses jsvc from Apache Commons to launch daemons
  214. # on privileged ports. This functionality can be replaced by providing
  215. # custom functions. See hadoop-functions.sh for more information.
  216. #
  217. # The jsvc implementation to use. Jsvc is required to run secure datanodes
  218. # that bind to privileged ports to provide authentication of data transfer
  219. # protocol. Jsvc is not required if SASL is configured for authentication of
  220. # data transfer protocol using non-privileged ports.
  221. # export JSVC_HOME=/usr/bin
  222. #
  223. # This directory contains pids for secure and privileged processes.
  224. #export HADOOP_SECURE_PID_DIR=${HADOOP_PID_DIR}
  225. #
  226. # This directory contains the logs for secure and privileged processes.
  227. # Java property: hadoop.log.dir
  228. # export HADOOP_SECURE_LOG=${HADOOP_LOG_DIR}
  229. #
  230. # When running a secure daemon, the default value of HADOOP_IDENT_STRING
  231. # ends up being a bit bogus. Therefore, by default, the code will
  232. # replace HADOOP_IDENT_STRING with HADOOP_SECURE_xx_USER. If one wants
  233. # to keep HADOOP_IDENT_STRING untouched, then uncomment this line.
  234. # export HADOOP_SECURE_IDENT_PRESERVE="true"
  235. ###
  236. # NameNode specific parameters
  237. ###
  238. # Default log level and output location for file system related change
  239. # messages. For non-namenode daemons, the Java property must be set in
  240. # the appropriate _OPTS if one wants something other than INFO,NullAppender
  241. # Java property: hdfs.audit.logger
  242. # export HDFS_AUDIT_LOGGER=INFO,NullAppender
  243. # Specify the JVM options to be used when starting the NameNode.
  244. # These options will be appended to the options specified as HADOOP_OPTS
  245. # and therefore may override any similar flags set in HADOOP_OPTS
  246. #
  247. # a) Set JMX options
  248. # export HADOOP_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"
  249. #
  250. # b) Set garbage collection logs
  251. # export HADOOP_NAMENODE_OPTS="${HADOOP_GC_SETTINGS} -Xloggc:${HADOOP_LOG_DIR}/gc-rm.log-$(date +'%Y%m%d%H%M')"
  252. #
  253. # c) ... or set them directly
  254. # export HADOOP_NAMENODE_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:${HADOOP_LOG_DIR}/gc-rm.log-$(date +'%Y%m%d%H%M')"
  255. # this is the default:
  256. # export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=INFO,RFAS"
  257. ###
  258. # SecondaryNameNode specific parameters
  259. ###
  260. # Specify the JVM options to be used when starting the SecondaryNameNode.
  261. # These options will be appended to the options specified as HADOOP_OPTS
  262. # and therefore may override any similar flags set in HADOOP_OPTS
  263. #
  264. # This is the default:
  265. # export HADOOP_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=INFO,RFAS"
  266. ###
  267. # DataNode specific parameters
  268. ###
  269. # Specify the JVM options to be used when starting the DataNode.
  270. # These options will be appended to the options specified as HADOOP_OPTS
  271. # and therefore may override any similar flags set in HADOOP_OPTS
  272. #
  273. # This is the default:
  274. # export HADOOP_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS"
  275. # On secure datanodes, user to run the datanode as after dropping privileges.
  276. # This **MUST** be uncommented to enable secure HDFS if using privileged ports
  277. # to provide authentication of data transfer protocol. This **MUST NOT** be
  278. # defined if SASL is configured for authentication of data transfer protocol
  279. # using non-privileged ports.
  280. # This will replace the hadoop.id.str Java property in secure mode.
  281. # export HADOOP_SECURE_DN_USER=hdfs
  282. # Supplemental options for secure datanodes
  283. # By default, Hadoop uses jsvc which needs to know to launch a
  284. # server jvm.
  285. # export HADOOP_DN_SECURE_EXTRA_OPTS="-jvm server"
  286. # Where datanode log files are stored in the secure data environment.
  287. # This will replace the hadoop.log.dir Java property in secure mode.
  288. # export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_SECURE_LOG_DIR}
  289. # Where datanode pid files are stored in the secure data environment.
  290. # export HADOOP_SECURE_DN_PID_DIR=${HADOOP_SECURE_PID_DIR}
  291. ###
  292. # NFS3 Gateway specific parameters
  293. ###
  294. # Specify the JVM options to be used when starting the NFS3 Gateway.
  295. # These options will be appended to the options specified as HADOOP_OPTS
  296. # and therefore may override any similar flags set in HADOOP_OPTS
  297. #
  298. # export HADOOP_NFS3_OPTS=""
  299. # Specify the JVM options to be used when starting the Hadoop portmapper.
  300. # These options will be appended to the options specified as HADOOP_OPTS
  301. # and therefore may override any similar flags set in HADOOP_OPTS
  302. #
  303. # export HADOOP_PORTMAP_OPTS="-Xmx512m"
  304. # Supplemental options for priviliged gateways
  305. # By default, Hadoop uses jsvc which needs to know to launch a
  306. # server jvm.
  307. # export HADOOP_NFS3_SECURE_EXTRA_OPTS="-jvm server"
  308. # On privileged gateways, user to run the gateway as after dropping privileges
  309. # This will replace the hadoop.id.str Java property in secure mode.
  310. # export HADOOP_PRIVILEGED_NFS_USER=nfsserver
  311. ###
  312. # ZKFailoverController specific parameters
  313. ###
  314. # Specify the JVM options to be used when starting the ZKFailoverController.
  315. # These options will be appended to the options specified as HADOOP_OPTS
  316. # and therefore may override any similar flags set in HADOOP_OPTS
  317. #
  318. # export HADOOP_ZKFC_OPTS=""
  319. ###
  320. # QuorumJournalNode specific parameters
  321. ###
  322. # Specify the JVM options to be used when starting the QuorumJournalNode.
  323. # These options will be appended to the options specified as HADOOP_OPTS
  324. # and therefore may override any similar flags set in HADOOP_OPTS
  325. #
  326. # export HADOOP_JOURNALNODE_OPTS=""
  327. ###
  328. # HDFS Balancer specific parameters
  329. ###
  330. # Specify the JVM options to be used when starting the HDFS Balancer.
  331. # These options will be appended to the options specified as HADOOP_OPTS
  332. # and therefore may override any similar flags set in HADOOP_OPTS
  333. #
  334. # export HADOOP_BALANCER_OPTS=""
  335. ###
  336. # HDFS Mover specific parameters
  337. ###
  338. # Specify the JVM options to be used when starting the HDFS Mover.
  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 HADOOP_MOVER_OPTS=""
  343. ###
  344. # Advanced Users Only!
  345. ###
  346. #
  347. # When building Hadoop, one can add the class paths to the commands
  348. # via this special env var:
  349. # export HADOOP_ENABLE_BUILD_PATHS="true"
  350. #
  351. # To prevent accidents, shell commands be (superficially) locked
  352. # to only allow certain users to execute certain subcommands.
  353. #
  354. # For example, to limit who can execute the namenode command,
  355. # export HADOOP_namenode_USER=hdfs