hadoop初始化(hdfs格式化)+简单测试(转载+自己整理)
?
| 操作 | 具體操作內(nèi)容 |
| 初始化hdfs文件系統(tǒng) | hdfs namenode -format |
| 啟動集群 | ~/bigdata/hadoop-3.1.2/sbin/start-dfs.sh&&~/bigdata/hadoop-3.1.2/sbin/start-yarn.sh |
| hdfs界面 | http://desktop:9870/ |
| yarn界面 | http://desktop:8088/ |
words.txt內(nèi)容如下:
hello tom hello jerry hello kitty hello world hello tom?
然后測試下自帶的小例子:
hdfs dfs -put words.txt /
hadoop jar hadoop-mapreduce-examples-3.1.2.jar wordcount hdfs://Desktop:9000/words.txt hdfs://Desktop:9000/wcout
hdfs dfs -ls /wcout
hdfs dfs -cat /wcout/part-r-00000
#############################附錄#######################################
如果發(fā)現(xiàn)jps中datanode起不來,
可以把下面的兩處的clusterid改為一致(推薦修改data/current/VERSION)
然后重新啟動hdfs集群即可:
~/bigdata/hadoop-3.1.2/sbin/start-dfs.sh&&~/bigdata/hadoop-3.1.2/sbin/start-yarn.sh
?
(Python3.6) appleyuchi@Laptop:dfs$ grep -ri clusterid
data/current/VERSION:clusterID=CID-3ef50261-5a59-4b70-9f7f-ce29908c7818
Binary file data/current/BP-619379440-192.168.0.102-1593400448542/current/finalized/subdir0/subdir1/blk_1073742287 matches
Binary file data/current/BP-619379440-192.168.0.102-1593400448542/current/finalized/subdir0/subdir1/blk_1073742237 matches
Binary file data/current/BP-619379440-192.168.0.102-1593400448542/current/finalized/subdir0/subdir2/blk_1073742437 matches
Binary file data/current/BP-619379440-192.168.0.102-1593400448542/current/finalized/subdir0/subdir2/blk_1073742337 matches
Binary file data/current/BP-619379440-192.168.0.102-1593400448542/current/finalized/subdir0/subdir2/blk_1073742338 matches
Binary file data/current/BP-619379440-192.168.0.102-1593400448542/current/finalized/subdir0/subdir2/blk_1073742487 matches
name/current/VERSION:clusterID=CID-a84621b5-31b1-4a75-b94a-65eda4855e05
(Python3.6) appleyuchi@Laptop:dfs$ subl data/current/VERSION
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的hadoop初始化(hdfs格式化)+简单测试(转载+自己整理)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何玩转手机银行 手机银行怎么玩)
- 下一篇: secure使用vi编辑远程机器文件出现