软件的安装目录:
/opt/modules/
安装:
0)说明
1、系统:CentOS 6.4 64位
2、关闭防火墙和SELinux
service iptables status
service iptables stop
chkconfig iptables off
vi /etc/sysconfig/selinux
设置 SELINUX=disabled
3、设置静态IP地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
4、修改HostName
hostname hadoop-yarn.dragon.org
vi /etc/sysconfig/network
5、IP与HostName绑定
vi /etc/hosts
内容:
192.168.48.128 hadoop-yarn.dragon.org hadoop-yarn
6、安装JDK
安装目录:/opt/modules/jdk1.6.0_45
版本:jdk-6u45-linux-x64.bin
命令:
chmod u+x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
设置环境变量:
vi /etc/profile
添加内容:
export JAVA_HOME=/opt/modules/jdk1.6.0_45
export PATH=$PATH:$JAVA_HOME/bin
# source /etc/profile
1)解压tar包
tar -zxvf hadoop-2.2.0.tar.gz -C /opt/modules/
2)安装目录
HADOOP_HOME=/opt/modules/hadoop-2.2.0
环境变量的配置:
export HADOOP_HOME=/opt/modules/hadoop-2.2.0
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
1、hadoop-env.sh
export JAVA_HOME=/opt/modules/jdk1.6.0_45
2、yarn-env.sh
export JAVA_HOME=/opt/modules/jdk1.6.0_45
3、mapred-env.sh
export JAVA_HOME=/opt/modules/jdk1.6.0_45
4、core-site.xml
<property>
<name>fs.default.name</name> 过时了应该使用 <name>fs.defaultFS</name>
<value>hdfs://hadoop-yarn.dragon.org:8020</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/modules/hadoop-2.2.0/data/tmp</value>
</property>
5、hdfs-site.xml
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
6、yarn-site.xml
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
7、mapred-site.xml
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
4)启动
1、启动HDFS
NameNode、DataNode、SecondaryNameNode
* NameNode 格式化
bin/hdfs namenode -format
* 启动NameNode
sbin/hadoop-daemon.sh start namenode
* 启动DataNode
sbin/hadoop-daemon.sh start datanode
* 启动SecondaryNameNode
sbin/hadoop-daemon.sh start secondarynamenode
以上来自视频的笔记