1.修改主机名需要修改的参数
/etc/hosts 中的映射
/etc/sysconfig/network 中的主机名
2.修改hadoop配置文件
1.conf/core-site.xml
//配置NameNode的信息
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
2.conf/hdfs-site.xml
//配置有多少个DataNode
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
3.conf/mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
3.无密码远程登录
$ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$cat ~/.ssh/id_dsa.pub >> ~/.ssh/authoriezd_keys
4.格式化
bin/hadoop namenode -format
4.测试:
NameNode: http://localhost:50070/
JobTracker:http://localhost:50030/
IP:
192.168.136.129 node1
192.168.136.131 node3
192.168.136.132 node2
192.168.136.130 node4
关闭防火墙:
service iptables stop
查看是否处于安全模式:
bin/hadoop dfsadmin -safemode get/leave/enter