您好,登錄后才能下訂單哦!
分布式安裝(至少三臺主機):
環境所需軟件:
CentOS7
hadoop-2.7.3.tar.gz
jdk-8u102-linux-x64.tar.gz
安裝前準備工作:
配置免密鑰登陸
cd
ssh-keygen -t rsa
一直回車,直到結束
ssh-copy-id .ssh/id_rsa.pub bigdata1
ssh-copy-id .ssh/id_rsa.pub bigdata2
ssh-copy-id .ssh/id_rsa.pub bigdata3
同步時間
通過設置計劃任務實現各主機間的時間同步
vim /etc/crontab
0 0 1 root ntpdate -s time.windows.com
或者部署一個時間服務器實現同步,這里就不詳細講解了
(*)hdfs-site.xml
<!--數據塊的冗余度,默認是3-->
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<!--是否開啟HDFS的權限檢查,默認:true-->
<!--
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
-->
core-site.xml
<!--NameNode的地址-->
<property>
<name>fs.defaultFS</name>
<value>hdfs://bigdata1:9000</value>
</property>
<!--HDFS數據保存的目錄,默認是Linux的tmp目錄-->
<property>
<name>hadoop.tmp.dir</name>
<value>/root/training/hadoop-2.7.3/tmp</value>
</property>
mapred-site.xml
<!--MR程序運行的容器是Yarn-->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
yarn-site.xml
<!--ResourceManager的地址-->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>bigdata1</value>
</property>
<!--NodeManager運行MR任務的方式-->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
對NameNode進行格式化: hdfs namenode -format
日志:Storage directory /root/training/hadoop-2.7.3/tmp/dfs/name has been successfully formatted.
scp -r /root/training/hadoop-2.7.3 bigdata2:/root/training/hadoop-2.7.3
scp -r /root/training/hadoop-2.7.3 bigdata3:/root/training/hadoop-2.7.3
啟動:start-all.sh = start-dfs.sh + start-yarn.sh
驗證
(*)命令行:hdfs dfsadmin -report
(*)網頁:HDFS:http://192.168.157.12:50070/
Yarn:http://192.168.157.12:8088
(*)Demo:測試MapReduce程序
example: /root/training/hadoop-2.7.3/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar
hadoop jar hadoop-mapreduce-examples-2.7.3.jar wordcount /input/data.txt /output/wc1204
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。