hadoop2.7.1中yarn-site.xml怎么配置

2024-12-25 17:44:28
推荐回答(2个)
回答1:

从http://mirror.metrocast.net/apache/hadoop/common/stable2/下载。百度云盘下载。
解压到/home/hduser/yarn目录,假设hadoop是用户名。
$ tar -xvzf hadoop-2.2.0.tar.gz
$ mv hadoop-2.2.0 /home/hadoop/yarn/hadoop-2.2.0
$ cd /home/hadoop/yarn
$ sudo chown -R hadoop:hadoop hadoop-2.2.0
$ sudo chmod -R 755 hadoop-2.2.0
在~/.bashrc设置环境,将下面加入:
export HADOOP_HOME=$HOME/Programs/Hadoop/hadoop-2.2.0
export HADOOP_MAPRED_HOME=$HOME/Programs/Hadoop/hadoop-2.2.0
export HADOOP_COMMON_HOME=$HOME/Programs/Hadoop/hadoop-2.2.0
export HADOOP_HDFS_HOME=$HOME/Programs/Hadoop/hadoop-2.2.0
export YARN_HOME=$HOME/Programs/Hadoop/hadoop-2.2.0
export HADOOP_CONF_DIR=$HOME/Programs/Hadoop/hadoop-2.2.0/etc/hadoop
$ source ~/.bashrc
创建Hadoop数据目录:
$ mkdir -p $HOME/yarn/yarn_data/hdfs/namenode
$ mkdir -p $HOME/yarn/yarn_data/hdfs/datanode
配置:
$ cd $YARN_HOME
$ vi etc/hadoop/yarn-site.xml
编辑 yarn-site.xml
加入下面喊在yarn-site.xml:
#etc/hadoop/yarn-site.xml .

yarn.nodemanager.aux-services
mapreduce_shuffle


yarn.nodemanager.aux-services.mapreduce.shuffle.class
org.apache.hadoop.mapred.ShuffleHandler

回答2:

里面可以自己设,不设的话用的是默认端口