我一共有4台机器,都是在虚拟机下面,都能ssh互通,hadoop0为主节点,hadoop1,2,3分别为从节点。
hadoop版本为2.4.1
配置好了之后执行
bin/hdfs namenode -format 成功
sbin/start-dfs.sh
执行完后
就出现如下提示:
hadoop@hadoop0:~/hadoop-2.4.1$ sbin/start-dfs.sh
14/08/17 13:28:17 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [hadoop0]
hadoop@hadoop0's password:
hadoop0: starting namenode, logging to /home/hadoop/hadoop-2.4.1/logs/hadoop-hadoop-namenode-hadoop0.out
hadoop@localhost's password: hadoop2: starting datanode, logging to /home/hadoop/hadoop-2.4.1/logs/hadoop-hadoop-datanode-hadoop2.out
hadoop3: starting datanode, logging to /home/hadoop/hadoop-2.4.1/logs/hadoop-hadoop-datanode-hadoop3.out
hadoop1: starting datanode, logging to /home/hadoop/hadoop-2.4.1/logs/hadoop-hadoop-datanode-hadoop1.out
然后经过漫长的等待也没有退出命令行。
查看log日志发现
日志不断的出现,时间不定
2014-08-17 13:30:04,777 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Rescanning after 30002 milliseconds
2014-08-17 13:30:04,783 INFO org.apache.hadoop.hdfs.server.blockmanagement.CacheReplicationMonitor: Scanned 0 directive(s) and 0 block(s) in 6 millisecond(s).
用jps查看进程
主节点上hadoop0:
17160 NameNode
17278 Jps
11618 ResourceManager
三个从节点上:
刚开始都只有jps,过了好久才出现datanode线程
hadoop namenode format 重新格式化一下dfs
应该是从节点之间没有ssh互信的原因