准备linux环境【java、ip、hostname、hosts、iptables、chkconfig、ssh】
下载稳定版2.6.0
修改etc/hadoop目录下的配置文件core-site.xml、hdfs-site.xml、yarn-site.xml、mapred-site.xml
启动
验证
下面主要配置文件:
core-site.xml:
<property>
<name>fs.defaultFS</name>
<value>hdfs://192.168.1.97:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/hadoop-2.6.0/tmp</value>
</property>
<property>
<name>fs.trash.interval</name>
<value>1440</value>
</property>
hdfs-site.xml:
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
yarn-site.xml:
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
mapred-site.xml:
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
格式化namenode: bin/hdfs namenode -format
启动——hdfs
sbin/hadoop-daemon.sh start namenode
sbin/hadoop-daemon.sh start datanode
访问端口:192.168.1.97:50070
启动-----yarn
sbin/yarn-daemon.sh start resourcemanager
sbin/yarn-daemon.sh start nodemanager
浏览器访问8088端口:192.168.1.97:8088
启动——historyserver
sbin/mr-jobhistory-daemon.sh start historyserver
浏览器访问端口为19888
上面可以写一个启动脚本:start-hadoop.sh
#!/bin/sh
hadoop_home=/usr/local/hadoop-2.6.0
$hadoop_home/sbin/hadoop-daemon.sh start namenode
$hadoop_home/sbin/hadoop-daemon.sh start datanode
$hadoop_home/sbin/yarn-daemon.sh start resourcemanager
$hadoop_home/sbin/yarn-daemon.sh start nodemanager
$hadoop_home/sbin/yarn-daemon.sh start historyserver
$hadoop_home/sbin/mr-jobhistory-daemon.sh start historyserver
关闭也可以写一个脚本:stop-hadoop.sh
#!/bin/sh
hadoop_home=/usr/local/hadoop-2.6.0
$hadoop_home/sbin/hadoop-daemon.sh stop namenode
$hadoop_home/sbin/hadoop-daemon.sh stop datanode
$hadoop_home/sbin/yarn-daemon.sh stop resourcemanager
$hadoop_home/sbin/yarn-daemon.sh stop nodemanager
$hadoop_home/sbin/yarn-daemon.sh stop historyserver
$hadoop_home/sbin/mr-jobhistory-daemon.sh stop historyserver
搞定了!