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