系統(tǒng):centos 6.10
jdk:jdk-8u281-linux-x64.tar.gz
hadoop: hadoop-2.10.1.tar.gz
http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-2.10.1/
1翅萤、jdk和hadoop安裝包復制解壓到服務器着倾,配置環(huán)境變量
cd /root
vim .bashrc
export JAVA_HOME=/root/hd/jdk1.8.0_281
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
export HADOOP_HOME=/root/hd/hadoop-2.10.1
export PATH=$HADOOP_HOME/bin:$PATH
修改完環(huán)境變量執(zhí)行:
source .bashrc
使用命令查看是否配置OK:
java -version
其爵,hadoop version
2姑子、修改Hadoop配置文件
cd /root/hd/hadoop-2.10.1/etc/hadoop
2.1、
vim core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://192.168.2.11:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/root/hd/hadoop-2.10.1/tmp</value>
</property>
<property>
<name>hadoop.native.lib</name>
<value>false</value>
<description>Should native hadoop libraries, if present, be used.</description>
</property>
</configuration>
2.2替劈、
vim hadoop-env.sh
2.3棒拂、
vim hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.secondary.http.address</name>
<value>192.168.2.11:50090</value>
</property>
</configuration>
2.4、
cp mapred-site.xml.template mapred-site.xml
蛛蒙,vim mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
2.5、
vim yarn-site.xml
<property>
<name>yarn.resourcemanager.hostname</name>
<value>192.168.2.11</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
3恨锚、啟動Hadoop
3.1宇驾、格式化hadoop文件
cd /root/hd/hadoop-2.10.1/sbin
倍靡,hadoop namenode -format
3.2猴伶、啟動服務
./start-all.sh
,中途會讓輸幾次密碼
3.3塌西、查看服務是否啟動
jps
訪問:
http://192.168.2.11:50070/