hadoop安装包解压
tar -xvf hadoop-2.7.7.tar.gz
解压成功ll查看文件
配置环境变量
1.
vi /home/wj/hadoop-2.7.7/etc/hadoop/hadoop-env.sh
修改export JAVA_HOME={$JAVA_HOME}
为 export JAVA_HOME=/usr/java/jdk1.8.0.181/
2.
vi yarn-env.sh
找到#export JAVA_HOME=/home/y/libexec/jdk.1.6.0/
去掉#,改为
export JAVA_HOME=/usr/java/jdk1.8.0.181/
3.
vi core-site.xml
<configuration>
<propoerty>
<name>fs.defaultFS</name>
<value>hdfs://master:9000</value>
</property>
<propoerty>
<name>hadoop.tmp.dir</name>
<value>/home/wj/hadoopdata</value>
</property>
</configuration>
4.
vi hdfs-site.xml
<configuration>
<propery>
<name>dfs.replication</name>
<value>1</value>
</propery>
</configuration>
5.
vi yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties -->
<propery>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value> #洗牌,类似排序
</propery>
<propery>
<name>yarn.resourcemanager.address</name>
<value>master:18040</value>#主机端口
</propery>
<propery>
<name>yarn.resourcemanager.scheduler.address</name>
<value>master:18030</value>#调度端口
</propery>
<propery>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>master:18025</value>#跟踪端口
</propery>
<propery>
<name>yarn.resourcemanager.admin.address</name>
<value>master:18141</value>#管理操作端口
</propery>
<propery>
<name>yarn.resourcemanager.webapp.address</name>#监控页面
<value>master:18088</value>
</propery>
</configuration>
6.
复制 mapred-site-template.xml
cp etc/hadoop/mapred-site-template.xml etc/hadoop/mapred-site.xml
vi mapred-site.xml
<configuration>
<propery>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</propery>
</configuration>
7.
wj@master ~]$ pwd
/home/wj
[wj@master ~]$ vi ~/.bash_profile
#hadoop
export HADOOP_HOME=/home/wj/hadoop-2.7.7
export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
使配置生效
[wj@master ~]$ source .bash_profile