<PRoperty> <name>dfs.hosts.exclude</name> <value>file_path</value> </property> 2、file_path文件中存储要离线的几点名称3、执行命令 hdfs dfsadmin -refreshNodes 问题:执行到最发现50070界面数据块不发生变化,查看namenode发现问题:2017-02-08 15:19:10,145 WARN org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicy: Failed to place enough replicas, still in need of 1 to reach 2 (unavailableStorages=[DISK, ARCHIVE], storagePolicy=BlockStoragePolicy{HOT:7, storageTypes=[DISK], creationFallbacks=[], replicationFallbacks=[ARCHIVE]}, newBlock=false) All required storage types are unavailable: unavailableStorages=[DISK, ARCHIVE], storagePolicy=BlockStoragePolicy{HOT:7, storageTypes=[DISK], creationFallbacks=[], replicationFallbacks=[ARCHIVE]} 原因:namenode中记录的文件副本数和实际存储的副本数不一致,可以使用 hadoop fsck / >test.log命令检查解决方法: hdfs hadoop dfs -setrep -w 2 -R / 将机器中文件的副本数统一 然后再执行hadoop fsck / >test1.log检查,看是否有Missing4、然后重新执行hdfs dfsadmin -refreshNodes5、退役完成(block 转移结束),后续hadoop会自动删除datanode上的数据,也可以直接停掉datanode,手动删除数据下线tasktracker or nodemanager(过程与下线datanode类似,一下列举不同点)
如下配置项到mapred-site.xml
[html] view plain copy<property> <name>mapred.hosts.exclude</name> <value>mrhosts.exclude</value> </property> yarn rmadmin -refreshNodes 若没启用yarn,即下线tasktracker时执行:hadoop mradmin -refreshNodes
新闻热点
疑难解答