云计算课程实验
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
4.7 KiB

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