mikewalch closed pull request #200: Updates for Hadoop 3 URL: https://github.com/apache/fluo-uno/pull/200
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/bin/impl/setup-hadoop.sh b/bin/impl/setup-hadoop.sh index 8945ca9..5614fc2 100755 --- a/bin/impl/setup-hadoop.sh +++ b/bin/impl/setup-hadoop.sh @@ -36,23 +36,36 @@ print_to_console " * ResourceManager status: http://localhost:8088/" print_to_console " * view logs at $HADOOP_LOG_DIR" rm -rf "$INSTALL"/hadoop-* -rm -f "$HADOOP_LOG_DIR"/* -rm -rf "$HADOOP_LOG_DIR"/application_* +rm -rf "$HADOOP_LOG_DIR"/* rm -rf "$DATA_DIR"/hadoop mkdir -p "$HADOOP_LOG_DIR" tar xzf "$DOWNLOADS/$HADOOP_TARBALL" -C "$INSTALL" hadoop_conf="$HADOOP_HOME"/etc/hadoop -cp "$UNO_HOME"/conf/hadoop/* "$hadoop_conf/" +cp "$UNO_HOME"/conf/hadoop/core-site.xml "$hadoop_conf/" +cp "$UNO_HOME"/conf/hadoop/hdfs-site.xml "$hadoop_conf/" +cp "$UNO_HOME"/conf/hadoop/yarn-site.xml "$hadoop_conf/" +cp "$UNO_HOME"/conf/hadoop/capacity-scheduler.xml "$hadoop_conf/" +cp "$UNO_HOME"/conf/hadoop/masters "$hadoop_conf/" +if [[ $HADOOP_VERSION =~ ^2\..*$ ]]; then + cp "$UNO_HOME"/conf/hadoop/workers "$hadoop_conf/slaves" + cp "$UNO_HOME"/conf/hadoop/mapred-site-2.xml "$hadoop_conf/mapred-site.xml" +else + cp "$UNO_HOME"/conf/hadoop/workers "$hadoop_conf/" + cp "$UNO_HOME"/conf/hadoop/mapred-site.xml "$hadoop_conf/" +fi + $SED "s#UNO_HOST#$UNO_HOST#g" "$hadoop_conf/core-site.xml" "$hadoop_conf/hdfs-site.xml" "$hadoop_conf/yarn-site.xml" $SED "s#DATA_DIR#$DATA_DIR#g" "$hadoop_conf/hdfs-site.xml" "$hadoop_conf/yarn-site.xml" "$hadoop_conf/mapred-site.xml" +$SED "s#HADOOP_HOME#$HADOOP_HOME#g" "$hadoop_conf/mapred-site.xml" $SED "s#HADOOP_LOG_DIR#$HADOOP_LOG_DIR#g" "$hadoop_conf/yarn-site.xml" $SED "s#YARN_NM_MEM_MB#$YARN_NM_MEM_MB#g" "$hadoop_conf/yarn-site.xml" $SED "s#YARN_NM_CPU_VCORES#$YARN_NM_CPU_VCORES#g" "$hadoop_conf/yarn-site.xml" echo "export JAVA_HOME=$JAVA_HOME" >> "$hadoop_conf/hadoop-env.sh" echo "export HADOOP_LOG_DIR=$HADOOP_LOG_DIR" >> "$hadoop_conf/hadoop-env.sh" +echo "export HADOOP_MAPRED_HOME=$HADOOP_HOME" >> "$hadoop_conf/hadoop-env.sh" if [[ $HADOOP_VERSION =~ ^2\..*$ ]]; then echo "export YARN_LOG_DIR=$HADOOP_LOG_DIR" >> "$hadoop_conf/yarn-env.sh" fi diff --git a/conf/hadoop/mapred-site-2.xml b/conf/hadoop/mapred-site-2.xml new file mode 100644 index 0000000..f951767 --- /dev/null +++ b/conf/hadoop/mapred-site-2.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<!-- Put site-specific property overrides in this file. --> + +<configuration> + <property> + <name>mapreduce.framework.name</name> + <value>yarn</value> + </property> + <property> + <name>mapreduce.cluster.temp.dir</name> + <value>file://DATA_DIR/hadoop/mapred/temp</value> + </property> + <property> + <name>mapreduce.cluster.local.dir</name> + <value>file://DATA_DIR/hadoop/mapred/local</value> + </property> +</configuration> diff --git a/conf/hadoop/mapred-site.xml b/conf/hadoop/mapred-site.xml index f951767..c8d793f 100644 --- a/conf/hadoop/mapred-site.xml +++ b/conf/hadoop/mapred-site.xml @@ -29,4 +29,12 @@ <name>mapreduce.cluster.local.dir</name> <value>file://DATA_DIR/hadoop/mapred/local</value> </property> + <property> + <name>yarn.app.mapreduce.am.env</name> + <value>HADOOP_MAPRED_HOME=HADOOP_HOME</value> + </property> + <property> + <name>mapreduce.application.classpath</name> + <value>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*</value> + </property> </configuration> diff --git a/conf/hadoop/slaves b/conf/hadoop/workers similarity index 100% rename from conf/hadoop/slaves rename to conf/hadoop/workers ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
