1. 在namenode机器上格式化
Hdfs namenode –format
作用:创建了/opt/hadoop-2.5/dfs/name/current目录
并且初始化fsimage文件
-rw-r--r--. 1root root 351 Dec 23 05:44 fsimage_0000000000000000000
-rw-r--r--. 1root root 62 Dec 23 05:44fsimage_0000000000000000000.md5
-rw-r--r--. 1root root 2 Dec 23 05:44 seen_txid
-rw-r--r--. 1root root 206 Dec 23 05:44 VERSION
2. 启动
Cd /opt/hadoop-2.5/dfs/name/current
Start-dfs.sh
结果如下:
Startingnamenodes on [node1]
node1:starting namenode, logging to/home/hadoop-2.5.1/logs/hadoop-root-namenode-node1.out
node3:starting datanode, logging to/home/hadoop-2.5.1/logs/hadoop-root-datanode-node3.out
node2:starting datanode, logging to/home/hadoop-2.5.1/logs/hadoop-root-datanode-node2.out
node4:starting datanode, logging to/home/hadoop-2.5.1/logs/hadoop-root-datanode-node4.out
Startingsecondary namenodes [node2]
node2: starting secondarynamenode, loggingto /home/hadoop-2.5.1/logs/hadoop-root-secondarynamenode-node2.out
作用:通过namenode启动namenode和datenode(如未配置免密码登录,此处要手动输入密码),然后启动snn
3. 通过浏览器监控页面查看
结果如下图