Hadoop伪分布式集群搭建

声明:作者原创,转载注明出处。

作者:帅气陈吃苹果

1、下载Hadoop压缩包

wget http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-2.6.5/hadoop-2.6.5.tar.gz

2、解压Hadoop压缩包

mkdir /bigdata
tar -zxvf hadoop-2.6.5.tar.gz -C /bigdata

3、配置Hadoop(伪分布式)

cd /bigdata/hadoop-2.6.5/etc/hadoop
1)vim hadoop-env.xml
export JAVA_HOME=/usr/lib/jvm/java
2)vim core-site.xml
 <configuration>
   
    <property>
        <name>fs.defaultFSname>
        <value>hdfs://mastervalue>
    <property>
    
    <property>
        <name>hadoop.tmp.dirname>
        <value>/home/hadoop/local/var/hadoop/tmp/hadoop~${user.name}value>
    property>
configuration>
3)vim hdfs-site.xml
 <configuration>
   
    <property>
        <name>dfs.replicationname>
        <value>1value>
    <property>
configuration>
4)vim mapred-site.xml
 <configuration>
   
    <property>
        <name>mapreduce.framework.namename>
        <value>yarnvalue>
    <property>
configuration>
5)vim yarn-site.xml
<configuration>
    
    <property>
        <name>yarn.resourcemanager.hostnamename>
        <value>mastervalue>
    <property>

    
    <property>
        <name>yarn.nodemanager.aux-servicesname>
        <value>mapreduce_shufflevalue>
    <property>
configuration>
6)vim /etc/hosts

添加主机ip与主机名的映射:

192.168.29.188 master

4、HDFS初始化

即格式化HDFS(的namenode),

cd hadoop/hadoop-2.6.5/bin

hadoop namenode -format

5、启动Hadoop集群

cd hadoop/hadoop-2.6.5/sbin

//在hadoop-2.x中,推荐使用start-dfs.sh和start-yarn.sh来分别启动
start-all.sh

6、使用jps命令查看进程是否存在

8707    DataNode
8580    NameNode
9013    ResourceManager
8873    SecondaryNameNode
18057   Application
9308    NodeManager
17644   Jps

7、查看WEB界面

访问HDFS的管理界面:ip:50070

访问YARN的管理界面:ip:8088

你可能感兴趣的:(Hadoop)