当前位置:   article > 正文

Hadoop伪分布式集群搭建

hadoop伪分布式集群搭建

1.放入安装包

2.解压

tar -zxvf hadoop-2.7.3.tar.gz -C /usr/local/

 

3.导入JDK安装包

4.解压JDK安装包

tar -zxvf jdk-8u241-linux-x64.tar.gz -C /usr/local/

5.修改配置文件的路径

 cd /usr/local/hadoop-2.7.3/etc/hadoop

 4.修改hadoop-env.sh的文件

vi hadoop-env.sh

添加JAVA_HOME路径

 /usr/local/jdk1.8.0_241

5.修改core-site.xml

vi core-site.xml

  1. <property>
  2. <name>fs.defaultFS</name>
  3. <value>hdfs://hadoop01:9000</value>
  4. </property>
  5. <property>
  6. <name>hadoop.tmp.dir</name>
  7. <value>/usr/local/hadoop-2.7.3/tmp</value>
  8. </property>

 6.修改hdfs-site.xml

vi hdfs-site.xml

  1. <property>
  2. <name>dfs.namenode.name.dir</name>
  3. <value>/usr/local/hadoop-2.7.3/data/name</value>
  4. </property>
  5. <property>
  6. <name>dfs.datanode.data.dir</name>
  7. <value>/usr/local/hadoop-2.7.3/data/data</value>
  8. </property>
  9. <property>
  10. <name>dfs.replication</name>
  11. <value>3</value>
  12. </property>
  13. <property>
  14. <name>dfs.secondary.http.address</name>
  15. <value>hadoop01:50090</value>
  16. </property>

7. 修改mapred-site.xml

  1. mv mapred-site.xml.template mapred-site.xml
  2. vi mapred-site.xml

  1. <property>
  2. <name>mapreduce.framework.name</name>
  3. <value>yarn</value>
  4. </property>

8. 修改yarn-site.xml 

vi yarn-site.xml

  1. <property>
  2. <name>yarn.resourcemanager.hostname</name>
  3. <value>hadoop01</value>
  4. </property>
  5. <property>
  6. <name>yarn.nodemanager.aux-services</name>
  7. <value>mapreduce_shuffle</value>
  8. </property>

 9.修改slaves

vi slaves

hadoop01 

10. 修改环境变量

vi /etc/profile

  1. export JAVA_HOME=/usr/local/jdk1.8.0_241
  2. export HADOOP_HOME=/usr/local/hadoop-2.7.3
  3. export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

 

 11.环境生效

source /etc/profile

12.配置免密登录

ssh-keygen

 13.配置映射

vi /etc/hosts

 192.168.70.111 hadoop01

14. 将公钥复制到远程机器中

 ssh-copy-id hadoop01

 15.初始化 (就一次)

hadoop namenode -format

 16.启动hadoop

start-all.sh

 17.查看启动状态

jps

18.查看防火墙状态

systemctl status firewalld

关了以后

 19.关闭并禁用防火墙

  1. systemctl stop firewalld
  2. systemctl disable firewalld

 

 18.启动成功后,可通过以下方式访问管理页面

  1. HADOOP: 
  2. http://node1 的 IP:8088/cluster 
  3. HDFS: 
  4. http://node1 的 IP:50070/dfshealth.html

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/651119
推荐阅读
相关标签
  

闽ICP备14008679号