scenario hadoop2.2
assume everything is ready excepte hadoop2.2.
1) install hadoop namenode
cmd>msiexec /qb /i "hdp-win-2.0.6.msi" /lv "hdp.log" HDP_LAYOUT="D:\config\clusterproperties.txt" HDP_DIR="D:\hdp\hadoop" HDP_USER_PASSWORD="Mar19@Updat" DESTROY_DATA="no"2) format namenode
cmd>hdfs namenode -format3) delete current foulder (all namenode edit files) in "D:\hdpdata\hdfs\nn" and copy checkpoint folder "current" from secondary namenode(maybe d:\hdpdata\hdfs\snn) to primary namenode(d:\hdpdata\hdfs\snn )
4) Restore from checkpoint dir
Run cmd.exe by user hadoop ( or some users have full permission )
Runas /user:hadoop cmd.exeYou must have user hadoop password.
Use this command to start hadoop service and import checkpoint from checkpoint dir
cmd>%hadoop_home%/bin/hdfs namenode -importcheckpointUse ctrl+C to stop service which is completed. and Delete your namenode's checkpoint dir (dfs.namenode.checkpoint.dir the same as secondary namenode)
Start service by this command:
cmd>start_local_hdp_services.cmdLevae safemode
cmd>%hadoop_home%/bin/hdfs dfsadmin -safemode leave
Balance you HDFS:
cmd>%hadoop_home%/bin/hdfs balancer -threshold 55. Confirm your Hadoop service is restored successfully.
Open URL http://namenode:50070/ to check if there are some missing block. If yes. Please kindly check where they are and what they are.
Because restore from secondary namenode isn't a real time restore solution. It may lost the last time what you do in the jobtracker. It doesn't matter. Just delete them.
本文详细介绍了如何在Hadoop2.2环境中安装并配置Namenode,包括格式化Namenode、从Secondary Namenode导入检查点文件、启动Hadoop服务、离开安全模式以及平衡HDFS等步骤。
2887

被折叠的 条评论
为什么被折叠?



