yarn-config.sh 2.1 KB

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