云计算课程实验
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.

125 lines
5.7 KiB

  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=${JAVA_HOME}
  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_CONF_DIR=${HADOOP_CONF_DIR:-"/home/hadoop/conf"}
  29. # Extra Java CLASSPATH elements. Automatically insert capacity-scheduler.
  30. for f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do
  31. if [ "$HADOOP_CLASSPATH" ]; then
  32. export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f
  33. else
  34. export HADOOP_CLASSPATH=$f
  35. fi
  36. done
  37. export hadoop_pid_dir_prefix=/var/run/hadoop-hdfs
  38. export hdfs_log_dir_prefix=/var/log/hadoop-hdfs
  39. # The maximum amount of heap to use, in MB. Default is 1000.
  40. #export HADOOP_HEAPSIZE=
  41. #export HADOOP_NAMENODE_INIT_HEAPSIZE=""
  42. export HADOOP_HEAPSIZE=1024
  43. export HADOOP_USER_CLASSPATH_FIRST=true
  44. export HADOOP_NAMENODE_HEAPSIZE=3072
  45. export HADOOP_DATANODE_HEAPSIZE=3413
  46. export namenode_opt_newsize=128m
  47. export namenode_opt_maxnewsize=128m
  48. export namenode_heapsize=${HADOOP_NAMENODE_HEAPSIZE}m
  49. export dtnode_heapsize=${HADOOP_DATANODE_HEAPSIZE}m
  50. # Enable extra debugging of Hadoop's JAAS binding, used to set up
  51. # Kerberos security.
  52. # export HADOOP_JAAS_DEBUG=true
  53. # Extra Java runtime options. Empty by default.
  54. # For Kerberos debugging, an extended option set logs more invormation
  55. # export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true -Dsun.security.krb5.debug=true -Dsun.security.spnego.debug"
  56. export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"
  57. SHARED_HADOOP_NAMENODE_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile=${hdfs_log_dir_prefix}/hs_err_pid%p.log -XX:NewSize=${namenode_opt_newsize} -XX:MaxNewSize=${namenode_opt_maxnewsize} -Xloggc:$hdfs_log_dir_prefix/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms${namenode_heapsize} -Xmx${namenode_heapsize} -Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,RFAAUDIT"
  58. export HADOOP_NAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} -XX:OnOutOfMemoryError=\"/usr/hdp/current/hadoop-hdfs-namenode/bin/kill-name-node\" -Dorg.mortbay.jetty.Request.maxFormContentSize=-1 ${HADOOP_NAMENODE_OPTS}"
  59. export HADOOP_DATANODE_OPTS="-server -XX:ParallelGCThreads=4 -XX:+UseConcMarkSweepGC -XX:ErrorFile=${hdfs_log_dir_prefix}/hs_err_pid%p.log -XX:NewSize=200m -XX:MaxNewSize=200m -Xloggc:${hdfs_log_dir_prefix}/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xms${dtnode_heapsize} -Xmx${dtnode_heapsize} -Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,RFAAUDIT ${HADOOP_DATANODE_OPTS} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"
  60. export HADOOP_NFS3_OPTS="$HADOOP_NFS3_OPTS"
  61. export HADOOP_PORTMAP_OPTS="-Xmx512m $HADOOP_PORTMAP_OPTS"
  62. # The following applies to multiple commands (fs, dfs, fsck, distcp etc)
  63. export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS"
  64. # set heap args when HADOOP_HEAPSIZE is empty
  65. if [ "$HADOOP_HEAPSIZE" = "" ]; then
  66. export HADOOP_CLIENT_OPTS="-Xmx512m $HADOOP_CLIENT_OPTS"
  67. fi
  68. #HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData $HADOOP_JAVA_PLATFORM_OPTS"
  69. # On secure datanodes, user to run the datanode as after dropping privileges.
  70. # This **MUST** be uncommented to enable secure HDFS if using privileged ports
  71. # to provide authentication of data transfer protocol. This **MUST NOT** be
  72. # defined if SASL is configured for authentication of data transfer protocol
  73. # using non-privileged ports.
  74. export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER}
  75. # Where log files are stored. $HADOOP_HOME/logs by default.
  76. export HADOOP_LOG_DIR=$hdfs_log_dir_prefix
  77. # Where log files are stored in the secure data environment.
  78. #export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_LOG_DIR}/${HADOOP_HDFS_USER}
  79. ###
  80. # HDFS Mover specific parameters
  81. ###
  82. # Specify the JVM options to be used when starting the HDFS Mover.
  83. # These options will be appended to the options specified as HADOOP_OPTS
  84. # and therefore may override any similar flags set in HADOOP_OPTS
  85. #
  86. # export HADOOP_MOVER_OPTS=""
  87. ###
  88. # Advanced Users Only!
  89. ###
  90. # The directory where pid files are stored. /tmp by default.
  91. # NOTE: this should be set to a directory that can only be written to by
  92. # the user that will run the hadoop daemons. Otherwise there is the
  93. # potential for a symlink attack.
  94. export HADOOP_PID_DIR=$hadoop_pid_dir_prefix
  95. export HADOOP_SECURE_DN_PID_DIR=${HADOOP_PID_DIR}
  96. # A string representing this instance of hadoop. $USER by default.
  97. export HADOOP_IDENT_STRING=$USER