快速搭建Hadoop

1.配置jdk环境变量
2.配置Hadoop环境变量
3.文件配置
​1.配置完全分布式(/etc/hadoop/)
core-site.xml

​​<?xml version="1.0" encoding="UTF-8"?>
​​<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
​​<configuration>
​​​​<property>
​​​​​​<name>fs.defaultFS</name>
<value>hdfs://master/</value>
​​​​</property>
​​</configuration>

​​hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
​​<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
​​<configuration>
​​​​<property>
​​​​​​<name>dfs.replication</name>
​​​​​​<value>3</value>
​​​​</property>
​​</configuration>

​​
​​mapred-site.xml
​​​注意:cp mapred-site.xml.template mapred-site.xml

​​​<?xml version="1.0"?>
<configuration>
​​​​<property>
<name>mapreduce.framework.name</name>
​​​​​<value>yarn</value>
</property>
​​​</configuration>

​​yarn-site.xml

​​<?xml version="1.0"?>
<configuration>
<property>
​​​​​​<name>yarn.resourcemanager.hostname</name>
​​​​​​<value>master</value>
​​​​</property>
​​​​<property>
​​​​​​<name>yarn.nodemanager.aux-services</name>
​​​​​​<value>mapreduce_shuffle</value>
</property>
​​</configuration>

​​slaves

s2
​​s3
​​s4

hadoop-env.sh

export JAVA_HOME=/root/hd/jdk1.8

​2.分发配置

$>cd /soft/hadoop/etc/
​​$>scp -r hadoop centos@s2:/soft/hadoop/etc/
​​$>scp -r hadoop centos@s3:/soft/hadoop/etc/
​​$>scp -r hadoop centos@s4:/soft/hadoop/etc/

​3.格式化文件系统

​​$>hadoop namenode -format


​4.启动hadoop进程

​​$>start-all.sh

猜你喜欢

转载自blog.csdn.net/weixin_34023863/article/details/87137436