yarn-env.sh 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. # User for YARN daemons
  16. export HADOOP_YARN_USER=${HADOOP_YARN_USER:-yarn}
  17. # resolve links - $0 may be a softlink
  18. export YARN_CONF_DIR="${YARN_CONF_DIR:-$HADOOP_YARN_HOME/conf}"
  19. # some Java parameters
  20. # export JAVA_HOME=/home/y/libexec/jdk1.6.0/
  21. if [ "$JAVA_HOME" != "" ]; then
  22. #echo "run java in $JAVA_HOME"
  23. JAVA_HOME=$JAVA_HOME
  24. fi
  25. if [ "$JAVA_HOME" = "" ]; then
  26. echo "Error: JAVA_HOME is not set."
  27. exit 1
  28. fi
  29. #JAVA=$JAVA_HOME/bin/java
  30. #JAVA_HEAP_MAX=-Xmx2048m
  31. # For setting YARN specific HEAP sizes please use this
  32. # Parameter and set appropriately
  33. # YARN_HEAPSIZE=1000
  34. # check envvars which might override default args
  35. if [ "$YARN_HEAPSIZE" != "" ]; then
  36. JAVA_HEAP_MAX="-Xmx""$YARN_HEAPSIZE""m"
  37. fi
  38. # Resource Manager specific parameters
  39. # Specify the max Heapsize for the ResourceManager using a numerical value
  40. # in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
  41. # the value to 1000.
  42. # This value will be overridden by an Xmx setting specified in either YARN_OPTS
  43. # and/or YARN_RESOURCEMANAGER_OPTS.
  44. # If not specified, the default value will be picked from either YARN_HEAPMAX
  45. # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
  46. #export YARN_RESOURCEMANAGER_HEAPSIZE=1000
  47. # Specify the max Heapsize for the timeline server using a numerical value
  48. # in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
  49. # the value to 1000.
  50. # This value will be overridden by an Xmx setting specified in either YARN_OPTS
  51. # and/or YARN_TIMELINESERVER_OPTS.
  52. # If not specified, the default value will be picked from either YARN_HEAPMAX
  53. # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
  54. #export YARN_TIMELINESERVER_HEAPSIZE=1000
  55. # Specify the JVM options to be used when starting the ResourceManager.
  56. # These options will be appended to the options specified as YARN_OPTS
  57. # and therefore may override any similar flags set in YARN_OPTS
  58. #export YARN_RESOURCEMANAGER_OPTS=
  59. # Node Manager specific parameters
  60. # Specify the max Heapsize for the NodeManager using a numerical value
  61. # in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
  62. # the value to 1000.
  63. # This value will be overridden by an Xmx setting specified in either YARN_OPTS
  64. # and/or YARN_NODEMANAGER_OPTS.
  65. # If not specified, the default value will be picked from either YARN_HEAPMAX
  66. # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
  67. #export YARN_NODEMANAGER_HEAPSIZE=1000
  68. # Specify the JVM options to be used when starting the NodeManager.
  69. # These options will be appended to the options specified as YARN_OPTS
  70. # and therefore may override any similar flags set in YARN_OPTS
  71. #export YARN_NODEMANAGER_OPTS=
  72. # so that filenames w/ spaces are handled correctly in loops below
  73. IFS=
  74. # default log directory & file
  75. if [ "$YARN_LOG_DIR" = "" ]; then
  76. YARN_LOG_DIR="$HADOOP_YARN_HOME/logs"
  77. fi
  78. if [ "$YARN_LOGFILE" = "" ]; then
  79. YARN_LOGFILE='yarn.log'
  80. fi
  81. # default policy file for service-level authorization
  82. if [ "$YARN_POLICYFILE" = "" ]; then
  83. YARN_POLICYFILE="hadoop-policy.xml"
  84. fi
  85. # restore ordinary behaviour
  86. unset IFS
  87. YARN_OPTS="$YARN_OPTS -Dhadoop.log.dir=$YARN_LOG_DIR"
  88. YARN_OPTS="$YARN_OPTS -Dyarn.log.dir=$YARN_LOG_DIR"
  89. YARN_OPTS="$YARN_OPTS -Dhadoop.log.file=$YARN_LOGFILE"
  90. YARN_OPTS="$YARN_OPTS -Dyarn.log.file=$YARN_LOGFILE"
  91. YARN_OPTS="$YARN_OPTS -Dyarn.home.dir=$YARN_COMMON_HOME"
  92. YARN_OPTS="$YARN_OPTS -Dyarn.id.str=$YARN_IDENT_STRING"
  93. YARN_OPTS="$YARN_OPTS -Dhadoop.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
  94. YARN_OPTS="$YARN_OPTS -Dyarn.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
  95. if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
  96. YARN_OPTS="$YARN_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
  97. fi
  98. YARN_OPTS="$YARN_OPTS -Dyarn.policy.file=$YARN_POLICYFILE"