真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Hadoop用戶重新部署HDFS

前言:
在這篇文章中https://www.jianshu.com/p/eeae2f37a48c
我們使用的是root用戶來部署的,在生產(chǎn)環(huán)境中,一般某個組件是由某個用戶來啟動的,本篇文章介紹下怎樣用hadoop用戶來重新部署偽分布式(HDFS)

成都創(chuàng)新互聯(lián)公司是專業(yè)的涇源網(wǎng)站建設(shè)公司,涇源接單;提供網(wǎng)站建設(shè)、網(wǎng)站制作,網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進行涇源網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!

1.前期準備

創(chuàng)建hadoop用戶,及配置ssh免密登錄
參考:https://www.jianshu.com/p/589bb43e0282

2.停止root啟動的HDFS進程并刪除/tmp目錄下的存儲文件
[root@hadoop000 hadoop-2.8.1]# pwd
/opt/software/hadoop-2.8.1
[root@hadoop000 hadoop-2.8.1]# jps
32244 NameNode
32350 DataNode
32558 SecondaryNameNode
1791 Jps
[root@hadoop000 hadoop-2.8.1]# sbin/stop-dfs.sh 
Stopping namenodes on [hadoop000]
hadoop000: stopping namenode
localhost: stopping datanode
Stopping secondary namenodes [0.0.0.0]
0.0.0.0: stopping secondarynamenode
[root@hadoop000 hadoop-2.8.1]# jps
2288 Jps
[root@hadoop000  hadoop-2.8.1]# rm -rf /tmp/hadoop-* /tmp/hsperfdata_*
3.更改文件屬主
[root@hadoop000 software]# pwd
/opt/software
[root@hadoop000 software]# chown -R hadoop:hadoop hadoop-2.8.1
4.進入hadoop用戶 修改相關(guān)配置文件
#第一步:
[hadoop@hadoop000 hadoop]$ pwd
/opt/software/hadoop-2.8.1/etc/hadoop
[hadoop@hadoop000 hadoop]$ vi hdfs-site.xml 
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>192.168.6.217:50090</value>
</property>
<property>
<name>dfs.namenode.secondary.https-address</name>
<value>192.168.6.217:50091</value>
</property>
</configuration>
#第二步:
[hadoop@hadoop000 hadoop]$ vi core-site.xml 
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://192.168.6.217:9000</value>
</property>
</configuration>
#第三步:
[hadoop@hadoop000 hadoop]# vi slaves 
192.168.6.217
5.格式化和啟動
[hadoop@hadoop000 hadoop-2.8.1]$ pwd
/opt/software/hadoop-2.8.1
[hadoop@hadoop000 hadoop-2.8.1]$ bin/hdfs namenode -format
[hadoop@hadoop000 hadoop-2.8.1]$ sbin/start-dfs.sh
Starting namenodes on [hadoop000]
hadoop000: starting namenode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-hadoop-namenode-hadoop000.out
192.168.6.217: starting datanode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-hadoop-datanode-hadoop000.out
Starting secondary namenodes [hadoop000]
hadoop000: starting secondarynamenode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-hadoop-secondarynamenode-hadoop000.out
[hadoop@hadoop000 hadoop-2.8.1]$ jps
3141 Jps
2806 DataNode
2665 NameNode
2990 SecondaryNameNode
#至此發(fā)現(xiàn)HDFS三個進程都是以hadoop000啟動,

當前標題:Hadoop用戶重新部署HDFS
文章來源:http://weahome.cn/article/jjcghe.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部