hadoop安装 伪分布

Posted 阿旭代码之路

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hadoop安装 伪分布相关的知识,希望对你有一定的参考价值。

伪分布hadoop 安装总结

准备,在配置中hadoop用的9000端口,如果有其它软件用着这个端口,建议更换后再进行下面配置,以避免出现错误。比如php-fpm经常使用9000端口。

一、下载jdk
下载linux 64 8u73-64位版本
tar zxvf jdk-8u74-linux-x64.tar.gz -C /usr/local/

二、下载hadoop
tar zxvf hadoop-2.6.4.tar.gz -C /usr/local/

配置项:

vim /etc/profile.d/hadoop.sh
export JAVA_HOME=/usr/local/jdk1.8.0_74
export JRE_HOME=/usr/local/jdk1.8.0_74/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export HADOOP_HOME=/usr/local/hadoop-2.6.4
export HADOOP_PREPATH=/usr/local/hadoop-2.6.4
export HADOOP_PID_DIR=/usr/local/hadoop-2.6.4/pid
export YARN_PID_DIR=/usr/local/hadoop-2.6.4/pid
export HADOOP_MAPRED_PID_DIR=/usr/local/hadoop-2.6.4/pid
export PATH=$HADOOP_HOME/bin:$PATH

source /etc/profile.d/hadoop.sh

vim etc/hadoop/core-site.xml

<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/hadoop-2.6.4/tmp</value>
<description>Abase for other temporary directories.</description>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

vim etc/hadoop/yarn-site.xml

<property>
<name>yarn.resourcemanager.hostname</name>
<value>master</value>
</property>
<property>
<description>The address of the applications manager interface in the RM.</description>
<name>yarn.resourcemanager.address</name>
<value>${yarn.resourcemanager.hostname}:8032</value>
</property>
<property>
<description>The address of the scheduler interface.</description>
<name>yarn.resourcemanager.scheduler.address</name>
<value>${yarn.resourcemanager.hostname}:8030</value>
</property>
<property>
<description>The http address of the RM web application.</description>
<name>yarn.resourcemanager.webapp.address</name>
<value>${yarn.resourcemanager.hostname}:8088</value>
</property>
<property>
<description>The https adddress of the RM web application.</description>
<name>yarn.resourcemanager.webapp.https.address</name>
<value>${yarn.resourcemanager.hostname}:8090</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>${yarn.resourcemanager.hostname}:8031</value>
</property>
<property>
<description>The address of the RM admin interface.</description>
<name>yarn.resourcemanager.admin.address</name>
<value>${yarn.resourcemanager.hostname}:8033</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>

 

vim etc/hadoop/hdfs-site.xml

<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/usr/local/hadoop-2.6.4/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/local/hadoop-2.6.4/dfs/data</value>
</property>
  <property>
            <name>dfs.permissions</name>
            <value>false</value>
     </property>
 </configuration>


vim etc/hadoop/masters
localhost

vim etc/hadoop/slaves
localhost


mkdir tmp dfs dfs/name dfs/data

bin/hdfs namenode -format

sbin/start-dfs.sh
sbin/start-yarn.sh

配置OK.

 

以上是关于hadoop安装 伪分布的主要内容,如果未能解决你的问题,请参考以下文章

Hadoop安装最后一步~Hadoop伪分布式配置

Hadoop伪分布安装详解+MapReduce运行原理+基于MapReduce的KNN算法实现

0.1_hadoop安装(伪分布式)

ubuntu 下安装伪分布式 hadoop

Hadoop 伪分布模式安装

Hadoop 伪分布模式安装