hadoop伪分布式安装(单机版) HDFS +Yarn
一.安装环境与版本
Linux,虚拟机IP192.168.21.150:
hadoop-3.2.0
jdk1.8
二. 伪分布式安装HDFS
2.1hosts与profile配置
cd /etc cd /etc |
2.2解压
cd /usr/local/software |
2.3配置修改
hadoop-env.sh
cd
/usr/local/hadoop-3.2.0/etc/hadoop |
core-site.xml
cd /usr/local/hadoop-3.2.0/etc/hadoop <property> <name>fs.defaultFS</name> <value>hdfs://ha:9000</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/var/sxt/hadoop/local</value> </property> |
hdfs-site.xml
cd
/usr/local/hadoop-3.2.0/etc/hadoop <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.namenode.secondary.http-address</name> <value>ha:50090</value> </property> |
workers
cd /usr/local/hadoop-3.2.0/etc/hadoop vim workers 里面内容只有"node1" |
2.4编译与启动
cd
/usr/local/hadoop-3.2.0/bin cd
/usr/local/hadoop-3.2.0/sbin |
2.5验证
IP输入http://192.168.21.152:9870/出现
active说明已能成功运行hdfs
三. 伪分布式安装Yarn
3.1配置修改
hadoop-env.sh
cd /usr/local/hadoop-3.2.0/etc/hadoop export HDFS_NAMENODE_USER=root export HDFS_DATANODE_USER=root export HDFS_SECONDARYNAMENODE_USER=root export HDFS_JOURNALNODE_USER=root export YARN_RESOURCEMANAGER_USER=root export YARN_NODEMANAGER_USER=root |
mapred-site.xml
cd /usr/local/hadoop-3.2.0/etc/hadoop/ vim mapred-site.xml configuration中录入 <property><name>mapreduce.framework.name</name><value>yarn</value></property><property><name>yarn.app.mapreduce.am.env</name><value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value></property><property><name>mapreduce.map.env</name><value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value></property><property><name>mapreduce.reduce.env</name><value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value></property> |
yarn-site.xml
cd /usr/local/hadoop-3.2.0-ha/etc/hadoop/ vim yarn-site.xml configuration中录入 <property><name>yarn.nodemanager.aux-services</name><value>mapreduce_shuffle</value></property><property><name>yarn.resourcemanager.hostname</name><value>ha</value></property><property><name>yarn.log-aggregation-enable</name><value>true</value></property><property><name>yarn.log-aggregation.retain-seconds</name><value>640800</value></property> |
3.2启动
cd /usr/local/hadoop-3.2.0/sbin ./start-yarn.sh |
3.3登录验证
http://192.168.21.152:8088/
工具下载