hadoop-env.sh 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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_PREFIX=
  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_PREFIX/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. # The classpath is configured such that entries are stripped prior
  102. # to handing to Java based either upon duplication or non-existence.
  103. # Wildcards and/or directories are *NOT* expanded as the
  104. # de-duplication is fairly simple. So if two directories are in
  105. # the classpath that both contain awesome-methods-1.0.jar,
  106. # awesome-methods-1.0.jar will still be seen by java. But if
  107. # the classpath specifically has awesome-methods-1.0.jar from the
  108. # same directory listed twice, the last one will be removed.
  109. #
  110. # An additional, custom CLASSPATH. This is really meant for
  111. # end users, but as an administrator, one might want to push
  112. # something extra in here too, such as the jar to the topology
  113. # method. Just be sure to append to the existing HADOOP_USER_CLASSPATH
  114. # so end users have a way to add stuff.
  115. # export HADOOP_USER_CLASSPATH="/some/cool/path/on/your/machine"
  116. # Should HADOOP_USER_CLASSPATH be first in the official CLASSPATH?
  117. # export HADOOP_USER_CLASSPATH_FIRST="yes"
  118. # If HADOOP_USE_CLIENT_CLASSLOADER is set, HADOOP_CLASSPATH along with the main
  119. # jar are handled by a separate isolated client classloader. If it is set,
  120. # HADOOP_USER_CLASSPATH_FIRST is ignored. Can be defined by doing
  121. # export HADOOP_USE_CLIENT_CLASSLOADER=true
  122. # HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES overrides the default definition of
  123. # system classes for the client classloader when HADOOP_USE_CLIENT_CLASSLOADER
  124. # is enabled. Names ending in '.' (period) are treated as package names, and
  125. # names starting with a '-' are treated as negative matches. For example,
  126. # export HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES="-org.apache.hadoop.UserClass,java.,javax.,org.apache.hadoop."
  127. ###
  128. # Options for remote shell connectivity
  129. ###
  130. # There are some optional components of hadoop that allow for
  131. # command and control of remote hosts. For example,
  132. # start-dfs.sh will attempt to bring up all NNs, DNS, etc.
  133. # Options to pass to SSH when one of the "log into a host and
  134. # start/stop daemons" scripts is executed
  135. # export HADOOP_SSH_OPTS="-o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=10s"
  136. # The built-in ssh handler will limit itself to 10 simultaneous connections.
  137. # For pdsh users, this sets the fanout size ( -f )
  138. # Change this to increase/decrease as necessary.
  139. # export HADOOP_SSH_PARALLEL=10
  140. # Filename which contains all of the hosts for any remote execution
  141. # helper scripts # such as slaves.sh, start-dfs.sh, etc.
  142. # export HADOOP_SLAVES="${HADOOP_CONF_DIR}/slaves"
  143. ###
  144. # Options for all daemons
  145. ###
  146. #
  147. #
  148. # Many options may also be specified as Java properties. It is
  149. # very common, and in many cases, desirable, to hard-set these
  150. # in daemon _OPTS variables. Where applicable, the appropriate
  151. # Java property is also identified. Note that many are re-used
  152. # or set differently in certain contexts (e.g., secure vs
  153. # non-secure)
  154. #
  155. # Where (primarily) daemon log files are stored. # $HADOOP_PREFIX/logs
  156. # by default.
  157. # Java property: hadoop.log.dir
  158. # export HADOOP_LOG_DIR=${HADOOP_PREFIX}/logs
  159. # A string representing this instance of hadoop. $USER by default.
  160. # This is used in writing log and pid files, so keep that in mind!
  161. # Java property: hadoop.id.str
  162. # export HADOOP_IDENT_STRING=$USER
  163. # How many seconds to pause after stopping a daemon
  164. # export HADOOP_STOP_TIMEOUT=5
  165. # Where pid files are stored. /tmp by default.
  166. # export HADOOP_PID_DIR=/tmp
  167. # Default log4j setting for interactive commands
  168. # Java property: hadoop.root.logger
  169. # export HADOOP_ROOT_LOGGER=INFO,console
  170. # Default log4j setting for daemons spawned explicitly by
  171. # --daemon option of hadoop, hdfs, mapred and yarn command.
  172. # Java property: hadoop.root.logger
  173. # export HADOOP_DAEMON_ROOT_LOGGER=INFO,RFA
  174. # Default log level and output location for security-related messages.
  175. # You will almost certainly want to change this on a per-daemon basis via
  176. # the Java property (i.e., -Dhadoop.security.logger=foo). (Note that the
  177. # defaults for the NN and 2NN override this by default.)
  178. # Java property: hadoop.security.logger
  179. # export HADOOP_SECURITY_LOGGER=INFO,NullAppender
  180. # Default log level for file system audit messages.
  181. # Generally, this is specifically set in the namenode-specific
  182. # options line.
  183. # Java property: hdfs.audit.logger
  184. # export HADOOP_AUDIT_LOGGER=INFO,NullAppender
  185. # Default process priority level
  186. # Note that sub-processes will also run at this level!
  187. # export HADOOP_NICENESS=0
  188. # Default name for the service level authorization file
  189. # Java property: hadoop.policy.file
  190. # export HADOOP_POLICYFILE="hadoop-policy.xml"
  191. #
  192. # NOTE: this is not used by default! <-----
  193. # You can define variables right here and then re-use them later on.
  194. # For example, it is common to use the same garbage collection settings
  195. # for all the daemons. So one could define:
  196. #
  197. # export HADOOP_GC_SETTINGS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
  198. #
  199. # .. and then use it as per the b option under the namenode.
  200. ###
  201. # Secure/privileged execution
  202. ###
  203. #
  204. # Out of the box, Hadoop uses jsvc from Apache Commons to launch daemons
  205. # on privileged ports. This functionality can be replaced by providing
  206. # custom functions. See hadoop-functions.sh for more information.
  207. #
  208. # The jsvc implementation to use. Jsvc is required to run secure datanodes
  209. # that bind to privileged ports to provide authentication of data transfer
  210. # protocol. Jsvc is not required if SASL is configured for authentication of
  211. # data transfer protocol using non-privileged ports.
  212. # export JSVC_HOME=/usr/bin
  213. #
  214. # This directory contains pids for secure and privileged processes.
  215. #export HADOOP_SECURE_PID_DIR=${HADOOP_PID_DIR}
  216. #
  217. # This directory contains the logs for secure and privileged processes.
  218. # Java property: hadoop.log.dir
  219. # export HADOOP_SECURE_LOG=${HADOOP_LOG_DIR}
  220. #
  221. # When running a secure daemon, the default value of HADOOP_IDENT_STRING
  222. # ends up being a bit bogus. Therefore, by default, the code will
  223. # replace HADOOP_IDENT_STRING with HADOOP_SECURE_xx_USER. If one wants
  224. # to keep HADOOP_IDENT_STRING untouched, then uncomment this line.
  225. # export HADOOP_SECURE_IDENT_PRESERVE="true"
  226. ###
  227. # NameNode specific parameters
  228. ###
  229. # Default log level and output location for file system related change
  230. # messages. For non-namenode daemons, the Java property must be set in
  231. # the appropriate _OPTS if one wants something other than INFO,NullAppender
  232. # Java property: hdfs.audit.logger
  233. # export HDFS_AUDIT_LOGGER=INFO,NullAppender
  234. # Specify the JVM options to be used when starting the NameNode.
  235. # These options will be appended to the options specified as HADOOP_OPTS
  236. # and therefore may override any similar flags set in HADOOP_OPTS
  237. #
  238. # a) Set JMX options
  239. # 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"
  240. #
  241. # b) Set garbage collection logs
  242. # export HADOOP_NAMENODE_OPTS="${HADOOP_GC_SETTINGS} -Xloggc:${HADOOP_LOG_DIR}/gc-rm.log-$(date +'%Y%m%d%H%M')"
  243. #
  244. # c) ... or set them directly
  245. # 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')"
  246. # this is the default:
  247. # export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=INFO,RFAS"
  248. ###
  249. # SecondaryNameNode specific parameters
  250. ###
  251. # Specify the JVM options to be used when starting the SecondaryNameNode.
  252. # These options will be appended to the options specified as HADOOP_OPTS
  253. # and therefore may override any similar flags set in HADOOP_OPTS
  254. #
  255. # This is the default:
  256. # export HADOOP_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=INFO,RFAS"
  257. ###
  258. # DataNode specific parameters
  259. ###
  260. # Specify the JVM options to be used when starting the DataNode.
  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_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS"
  266. # On secure datanodes, user to run the datanode as after dropping privileges.
  267. # This **MUST** be uncommented to enable secure HDFS if using privileged ports
  268. # to provide authentication of data transfer protocol. This **MUST NOT** be
  269. # defined if SASL is configured for authentication of data transfer protocol
  270. # using non-privileged ports.
  271. # This will replace the hadoop.id.str Java property in secure mode.
  272. # export HADOOP_SECURE_DN_USER=hdfs
  273. # Supplemental options for secure datanodes
  274. # By default, Hadoop uses jsvc which needs to know to launch a
  275. # server jvm.
  276. # export HADOOP_DN_SECURE_EXTRA_OPTS="-jvm server"
  277. # Where datanode log files are stored in the secure data environment.
  278. # This will replace the hadoop.log.dir Java property in secure mode.
  279. # export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_SECURE_LOG_DIR}
  280. # Where datanode pid files are stored in the secure data environment.
  281. # export HADOOP_SECURE_DN_PID_DIR=${HADOOP_SECURE_PID_DIR}
  282. ###
  283. # NFS3 Gateway specific parameters
  284. ###
  285. # Specify the JVM options to be used when starting the NFS3 Gateway.
  286. # These options will be appended to the options specified as HADOOP_OPTS
  287. # and therefore may override any similar flags set in HADOOP_OPTS
  288. #
  289. # export HADOOP_NFS3_OPTS=""
  290. # Specify the JVM options to be used when starting the Hadoop portmapper.
  291. # These options will be appended to the options specified as HADOOP_OPTS
  292. # and therefore may override any similar flags set in HADOOP_OPTS
  293. #
  294. # export HADOOP_PORTMAP_OPTS="-Xmx512m"
  295. # Supplemental options for priviliged gateways
  296. # By default, Hadoop uses jsvc which needs to know to launch a
  297. # server jvm.
  298. # export HADOOP_NFS3_SECURE_EXTRA_OPTS="-jvm server"
  299. # On privileged gateways, user to run the gateway as after dropping privileges
  300. # This will replace the hadoop.id.str Java property in secure mode.
  301. # export HADOOP_PRIVILEGED_NFS_USER=nfsserver
  302. ###
  303. # ZKFailoverController specific parameters
  304. ###
  305. # Specify the JVM options to be used when starting the ZKFailoverController.
  306. # These options will be appended to the options specified as HADOOP_OPTS
  307. # and therefore may override any similar flags set in HADOOP_OPTS
  308. #
  309. # export HADOOP_ZKFC_OPTS=""
  310. ###
  311. # QuorumJournalNode specific parameters
  312. ###
  313. # Specify the JVM options to be used when starting the QuorumJournalNode.
  314. # These options will be appended to the options specified as HADOOP_OPTS
  315. # and therefore may override any similar flags set in HADOOP_OPTS
  316. #
  317. # export HADOOP_JOURNALNODE_OPTS=""
  318. ###
  319. # HDFS Balancer specific parameters
  320. ###
  321. # Specify the JVM options to be used when starting the HDFS Balancer.
  322. # These options will be appended to the options specified as HADOOP_OPTS
  323. # and therefore may override any similar flags set in HADOOP_OPTS
  324. #
  325. # export HADOOP_BALANCER_OPTS=""
  326. ###
  327. # HDFS Mover specific parameters
  328. ###
  329. # Specify the JVM options to be used when starting the HDFS Mover.
  330. # These options will be appended to the options specified as HADOOP_OPTS
  331. # and therefore may override any similar flags set in HADOOP_OPTS
  332. #
  333. # export HADOOP_MOVER_OPTS=""
  334. ###
  335. # Advanced Users Only!
  336. ###
  337. #
  338. # When building Hadoop, one can add the class paths to the commands
  339. # via this special env var:
  340. # export HADOOP_ENABLE_BUILD_PATHS="true"
  341. #
  342. # To prevent accidents, shell commands be (superficially) locked
  343. # to only allow certain users to execute certain subcommands.
  344. #
  345. # For example, to limit who can execute the namenode command,
  346. # export HADOOP_namenode_USER=hdfs