操作hadoop的经验积累
Hadoop namenode –format
在执行格式化-format命令时,要避免namenode的namdespaceid与datanode的namespaceid的不一致。这是因为每格式化一次就会产生name,data,temp等临时文件记录信息,多次格式化会产生很多的name,data,temo,这样容易导致id的不同,使hadoop不能正常运行。每次执行格式化—format命令时,就需要将datanode和namenode上原来的data,temp文件删除。
查看群集状态,
$ ./hadoop dfsadmin-report
ConfiguredCapacity: 53895745536 (50.19 GB)
Present Capacity:8199200768 (7.64 GB)
DFS Remaining:8199159808 (7.64 GB)
DFS Used: 40960 (40KB)
DFS Used%: 0%
Under replicatedblocks: 0
Blocks with corruptreplicas: 0
Missing blocks: 0
-------------------------------------------------
Datanodesavailable: 1 (1 total, 0 dead)
Name:127.0.0.1:50010
Decommission Status: Normal
ConfiguredCapacity: 53895745536 (50.19 GB)
DFS Used: 40960 (40KB)
Non DFS Used:45696544768 (42.56 GB)
D