hadoop-env.sh 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Set Hadoop-specific environment variables here.
  17. # The only required environment variable is JAVA_HOME. All others are
  18. # optional. When running a distributed configuration it is best to
  19. # set JAVA_HOME in this file, so that it is correctly defined on
  20. # remote nodes.
  21. # The java implementation to use.
  22. export JAVA_HOME=/share/lib/jdk
  23. # The jsvc implementation to use. Jsvc is required to run secure datanodes
  24. # that bind to privileged ports to provide authentication of data transfer
  25. # protocol. Jsvc is not required if SASL is configured for authentication of
  26. # data transfer protocol using non-privileged ports.
  27. #export JSVC_HOME=${JSVC_HOME}
  28. #export HADOOP_HOME_WARN_SUPPRESS=1
  29. #export HADOOP_ROOT_LOGGER="WARN,DRFA"
  30. export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"}
  31. #export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
  32. # Extra Java CLASSPATH elements. Automatically insert capacity-scheduler.
  33. for f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do
  34. if [ "$HADOOP_CLASSPATH" ]; then
  35. export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f
  36. else
  37. export HADOOP_CLASSPATH=$f
  38. fi
  39. done
  40. # The maximum amount of heap to use, in MB. Default is 1000.
  41. #export HADOOP_HEAPSIZE=
  42. #export HADOOP_NAMENODE_INIT_HEAPSIZE=""
  43. # Extra Java runtime options. Empty by default.
  44. export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"
  45. #export HADOOP_OPTS="-Djava.library.path=$HADOOP_PREFIX/lib"
  46. # Command specific options appended to HADOOP_OPTS when specified
  47. export HADOOP_NAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS"
  48. export HADOOP_DATANODE_OPTS="-Dhadoop.security.logger=ERROR,RFAS $HADOOP_DATANODE_OPTS"
  49. export HADOOP_SECONDARYNAMENODE_OPTS="-Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,RFAS} -Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_SECONDARYNAMENODE_OPTS"
  50. export HADOOP_NFS3_OPTS="$HADOOP_NFS3_OPTS"
  51. export HADOOP_PORTMAP_OPTS="-Xmx512m $HADOOP_PORTMAP_OPTS"
  52. # The following applies to multiple commands (fs, dfs, fsck, distcp etc)
  53. export HADOOP_CLIENT_OPTS="-Xmx512m $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. # This **MUST** be uncommented to enable secure HDFS if using privileged ports
  57. # to provide authentication of data transfer protocol. This **MUST NOT** be
  58. # defined if SASL is configured for authentication of data transfer protocol
  59. # using non-privileged ports.
  60. export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER}
  61. # Where log files are stored. $HADOOP_HOME/logs by default.
  62. #export HADOOP_LOG_DIR=${HADOOP_LOG_DIR}/$USER
  63. export HADOOP_LOG_DIR=${HADOOP_LOG_DIR}
  64. # Where log files are stored in the secure data environment.
  65. export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_LOG_DIR}/${HADOOP_HDFS_USER}
  66. ###
  67. # HDFS Mover specific parameters
  68. ###
  69. # Specify the JVM options to be used when starting the HDFS Mover.
  70. # These options will be appended to the options specified as HADOOP_OPTS
  71. # and therefore may override any similar flags set in HADOOP_OPTS
  72. #
  73. # export HADOOP_MOVER_OPTS=""
  74. ###
  75. # Advanced Users Only!
  76. ###
  77. # The directory where pid files are stored. /tmp by default.
  78. # NOTE: this should be set to a directory that can only be written to by
  79. # the user that will run the hadoop daemons. Otherwise there is the
  80. # potential for a symlink attack.
  81. export HADOOP_PID_DIR=${HADOOP_PID_DIR}
  82. export HADOOP_SECURE_DN_PID_DIR=${HADOOP_PID_DIR}
  83. # A string representing this instance of hadoop. $USER by default.
  84. export HADOOP_IDENT_STRING=$USER