添加映射
修改主机名
安装Jdk
配置环境变量
export JAVA_HOME=/usr/java/jdk1.7.0_67
export PATH=$PATH:$JAVA_HOME/bin
ssh免密钥(本机)
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
解压Hadoop
配置环境变量
export HADOOP_HOME=/opt/hadoop/hadoop-2.6.5
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
修改配置文件:
[root@node01 hadoop]# vi hadoop-env.sh
[root@node01 hadoop]# vi yarn-env.sh
[root@node01 hadoop]# vi mapred-env.sh
[root@node01 hadoop]# vi core-site.xml 决定namenode在那启动
<property>
<name>fs.defaultFS</name>
<value>hdfs://node01:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/var/hadoop/local</value>
</property>
[root@node01 hadoop]# vi hdfs-site.xml 决定secondarynamenode在那启动
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>node01:50090</value>
</property>
[root@node01 hadoop]# vi slaves 决定datanode在哪启动
node01
格式化
[root@node01 hadoop]# bin/hdfs namenode -format