hadoop-env.sh 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 2011 The Apache Software Foundation
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. # Set Hadoop-specific environment variables here.
  19. # The only required environment variable is JAVA_HOME. All others are
  20. # optional. When running a distributed configuration it is best to
  21. # set JAVA_HOME in this file, so that it is correctly defined on
  22. # remote nodes.
  23. # The java implementation to use.
  24. export JAVA_HOME=${JAVA_HOME}
  25. # The jsvc implementation to use. Jsvc is required to run secure datanodes.
  26. #export JSVC_HOME=${JSVC_HOME}
  27. export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"}
  28. # Extra Java CLASSPATH elements. Automatically insert capacity-scheduler.
  29. for f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do
  30. if [ "$HADOOP_CLASSPATH" ]; then
  31. export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f
  32. else
  33. export HADOOP_CLASSPATH=$f
  34. fi
  35. done
  36. # The maximum amount of heap to use, in MB. Default is 1000.
  37. #export HADOOP_HEAPSIZE=
  38. #export HADOOP_NAMENODE_INIT_HEAPSIZE=""
  39. # Extra Java runtime options. Empty by default.
  40. export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true $HADOOP_CLIENT_OPTS"
  41. MAC_OSX=false
  42. case "`uname`" in
  43. Darwin*) MAC_OSX=true;;
  44. esac
  45. if $MAC_OSX; then
  46. export HADOOP_OPTS="$HADOOP_OPTS -Djava.security.krb5.realm= -Djava.security.krb5.kdc="
  47. fi
  48. # Command specific options appended to HADOOP_OPTS when specified
  49. export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS"
  50. export HADOOP_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS $HADOOP_DATANODE_OPTS"
  51. export HADOOP_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_SECONDARYNAMENODE_OPTS"
  52. # The following applies to multiple commands (fs, dfs, fsck, distcp etc)
  53. export HADOOP_CLIENT_OPTS="-Xmx128m $HADOOP_CLIENT_OPTS"
  54. #HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData $HADOOP_JAVA_PLATFORM_OPTS"
  55. # On secure datanodes, user to run the datanode as after dropping privileges
  56. export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER}
  57. # Where log files are stored. $HADOOP_HOME/logs by default.
  58. #export HADOOP_LOG_DIR=${HADOOP_LOG_DIR}/$USER
  59. # Where log files are stored in the secure data environment.
  60. export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_LOG_DIR}/${HADOOP_HDFS_USER}
  61. # The directory where pid files are stored. /tmp by default.
  62. # NOTE: this should be set to a directory that can only be written to by
  63. # the user that will run the hadoop daemons. Otherwise there is the
  64. # potential for a symlink attack.
  65. export HADOOP_PID_DIR=${HADOOP_PID_DIR}
  66. export HADOOP_SECURE_DN_PID_DIR=${HADOOP_PID_DIR}
  67. # A string representing this instance of hadoop. $USER by default.
  68. export HADOOP_IDENT_STRING=$USER