CentOS6.5中怎么通过Hadoop用户实现HDFS伪分布式部署
更新:HHH   时间:2023-1-7


这篇文章给大家介绍CentOS6.5中怎么通过Hadoop用户实现HDFS伪分布式部署,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。


1、检查hadoop用户是否存在

  • [root@hadoop001 hadoop]# pwd

  • /opt/software/hadoop-2.8.1/etc/hadoop


  • [root@hadoop001 hadoop]# vim core-site.xml

  • --添加<property>,localhost修改为IP

  • <configuration>

  •     <property>

  •         <name>fs.defaultFS</name>

  •         <value>hdfs://localhost:9000</value>    

  •     </property>

  • </configuration>


#修改DataNode数据节点访问IP

  1. [root@hadoop001 hadoop]# pwd

  2. /opt/software/hadoop-2.8.1/etc/hadoop


  3. [root@hadoop001 hadoop]# vim slaves

  4. localhost --localhost修改为IP,多DN逗号分隔ip  


#修改SecondayNameNode数据节点访问IP

  1. [root@hadoop001 hadoop]# vim hdfs-site.xml

  2. -- 添加<property>

  3.     <configuration>

  4.         <property>

  5.                 <name>dfs.namenode.secondary.http-address</name>

  6.                 <value>192.168.0.129:50090</value>

  7.         </property>


  8.         <property>

  9.                 <name>dfs.namenode.secondary.https-address</name>

  10.                  <value>192.168.0.129:50091</value>

  11.         </property>

  12.         <property>

  13.                  <name>dfs.replication</name>

  14.                   <value>1</value>

  15.         </property>

  16.     </configuration>



6、删除root用户的DFS文件及DFS磁盘格式化

  1. [root@hadoop001 tmp]# rm -rf /tmp/hadoop-* /tmp/hsperfdata-*

  2. [root@hadoop001 tmp]# su - hadoop

  3. [hadoop@hadoop001 hadoop-2.8.1]$ hdfs namenode -format



7、hadoop用户启动

  1. [hadoop@hadoop001 sbin]$ pwd

  2. /opt/software/hadoop-2.8.1/sbin

  3. [hadoop@hadoop001 sbin]$ ./start-dfs.sh       -- 第一次启动输入密码

  4. Starting namenodes on [hadoop001]

  5. hadoop001: starting namenode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-hadoop-namenode-hadoop001.out

  6. 192.168.0.129: starting datanode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-hadoop-datanode-hadoop001.out

  7. Starting secondary namenodes [hadoop001]

  8. hadoop001: starting secondarynamenode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-hadoop-secondarynamenode-hadoop001.out

关于CentOS6.5中怎么通过Hadoop用户实现HDFS伪分布式部署就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

返回开发技术教程...