实验前提:
保证 ssh localhost 不需要输入密码
切换工作目录
[root@hadoop hadoop-2.7.4]# pwd
/usr/hadoop/hadoop-2.7.4
etc/hadoop/core-site.xml:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
etc/hadoop/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
格式化文件系统
[root@hadoop hadoop-2.7.4]# bin/hdfs namenode -format
Start NameNode daemon and DataNode daemon:
sbin/start-dfs.sh
验证结果
[root@hadoop hadoop-2.7.4]# /usr/jdk64/jdk1.8.0_144/bin/jps
11204 Jps
10902 DataNode
10776 NameNode
11064 SecondaryNameNode
访问namenode web接口
http://NAMENODE-IP:50070/