yarn-config.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. # included in all the hadoop scripts with source command
  16. # should not be executable directly
  17. bin=`which "$0"`
  18. bin=`dirname "${bin}"`
  19. bin=`cd "$bin"; pwd`
  20. export HADOOP_PREFIX="${HADOOP_PREFIX:-$bin/..}"
  21. DEFAULT_LIBEXEC_DIR="$bin"/../libexec
  22. HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
  23. if [ -e "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]; then
  24. . ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh
  25. elif [ -e "${HADOOP_COMMON_HOME}/libexec/hadoop-config.sh" ]; then
  26. . "$HADOOP_COMMON_HOME"/libexec/hadoop-config.sh
  27. elif [ -e "${HADOOP_HOME}/libexec/hadoop-config.sh" ]; then
  28. . "$HADOOP_HOME"/libexec/hadoop-config.sh
  29. else
  30. echo "Hadoop common not found."
  31. exit
  32. fi
  33. # Same glibc bug that discovered in Hadoop.
  34. # Without this you can see very large vmem settings on containers.
  35. export MALLOC_ARENA_MAX=${MALLOC_ARENA_MAX:-4}
  36. #check to see if the conf dir is given as an optional argument
  37. if [ $# -gt 1 ]
  38. then
  39. if [ "--config" = "$1" ]
  40. then
  41. shift
  42. confdir=$1
  43. shift
  44. YARN_CONF_DIR=$confdir
  45. fi
  46. fi
  47. # Allow alternate conf dir location.
  48. YARN_CONF_DIR="${HADOOP_CONF_DIR:-$YARN_HOME/conf}"
  49. #check to see it is specified whether to use the slaves or the
  50. # masters file
  51. if [ $# -gt 1 ]
  52. then
  53. if [ "--hosts" = "$1" ]
  54. then
  55. shift
  56. slavesfile=$1
  57. shift
  58. export YARN_SLAVES="${YARN_CONF_DIR}/$slavesfile"
  59. fi
  60. fi