useradd –m hadoop –s /bin/bash

passwd hadoop
 
增加sudo权限
chmod u+w /etc/sudoers
vi /etc/sudoers
root    ALL=(ALL)       ALL

hadoop ALL=(ALL) ALL

chmod u-w /etc/sudoers

 
 
su hadoop && cd ~
 
wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.7.7/hadoop-2.7.7.tar.gz
 
tar -zxf hadoop-2.7.7.tar.gz
sudo mkdir /usr/local/hadoop
sudo mv hadoop-2.7.7 /usr/local/hadoop
mkdir dfs
mkdir dfs/name
mkdir dfs/data
mkdir tmp
 
cd /usr/local/hadoop/hadoop-2.7.7/etc/hadoop
 
涉及到的配置文件有7个:

安装路径/hadoop-2.7.7/etc/hadoop/hadoop-env.sh

安装路径/hadoop-2.7.7/etc/hadoop/yarn-env.sh

安装路径/hadoop-2.7.7/etc/hadoop/slaves

安装路径/hadoop-2.7.7/etc/hadoop/core-site.xml

安装路径/hadoop-2.7.7/etc/hadoop/hdfs-site.xml

安装路径/hadoop-2.7.7/etc/hadoop/mapred-site.xml

安装路径/hadoop-2.7.7/etc/hadoop/yarn-site.xml

 
hadoop-env.sh和yarn-env.sh 里修改JAVA_HOME
===
cat core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
      <property>
               <name>fs.defaultFS</name>
               <value>hdfs://localhost:8020</value>
      </property>
      <property>
               <name>io.file.buffer.size</name>
               <value>131072</value>
       </property>
      <property>
              <name>hadoop.tmp.dir</name>
               <value>file:/home/hadoop/tmp</value>
              <description>Abase for other temporary   directories.</description>
      </property>
       <property>
               <name>hadoop.proxyuser.hadoop.hosts</name>
              <value>*</value>
      </property>
      <property>
               <name>hadoop.proxyuser.hadoop.groups</name>
              <value>*</value>
      </property>
      <property>
       <name>hadoop.proxyuser.root.groups</name>
       <value>*</value>
       <description>Allow the superuser oozie to impersonate any members of the group group1 and group2</description>
     </property>
     <property>
       <name>hadoop.proxyuser.root.hosts</name>
       <value>*</value>
       <description>The superuser can connect only from host1 and host2 to impersonate a user</description>
     </property>

</configuration>

===
cat hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
       <property>
               <name>dfs.namenode.secondary.http-address</name>
              <value>localhost:9001</value>
       </property>
     <property>
            <name>dfs.namenode.name.dir</name>
             <value>file:/home/hadoop/dfs/name</value>
       </property>
      <property>
              <name>dfs.datanode.data.dir</name>
              <value>file:/home/hadoop/dfs/data</value>
       </property>
       <property>
              <name>dfs.replication</name>
              <value>3</value>
        </property>
        <property>
                 <name>dfs.webhdfs.enabled</name>
                 <value>true</value>
         </property>
</configuration>
===

cp mapred-site.xml.template mapred-site.xml
 
cat mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
       <property>
               <name>mapreduce.framework.name</name>
               <value>yarn</value>
          </property>
         <property>
                 <name>mapreduce.jobhistory.address</name>
                 <value>localhost:10020</value>
         </property>
         <property>
                <name>mapreduce.jobhistory.webapp.address</name>
               <value>localhost:19888</value>
      </property>
</configuration>
=======

 cat yarn-site.xml
<?xml version="1.0"?>
<configuration>
<property>
              <name>yarn.nodemanager.aux-services</name>
              <value>mapreduce_shuffle</value>
       </property>
       <property>                                                               
              <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
              <value>org.apache.hadoop.mapred.ShuffleHandler</value>
       </property>
       <property>
              <name>yarn.resourcemanager.address</name>
              <value>localhost:8032</value>
      </property>
      <property>
              <name>yarn.resourcemanager.scheduler.address</name>
              <value>localhost:8030</value>
      </property>
      <property>
           <name>yarn.resourcemanager.resource-tracker.address</name>
            <value>localhost:8031</value>
     </property>
     <property>
              <name>yarn.resourcemanager.admin.address</name>
              <value>localhost:8033</value>
      </property>
      <property>
              <name>yarn.resourcemanager.webapp.address</name>
              <value>localhost:8088</value>
      </property>
</configuration>
====
设置环境变量
HADOOP_HOME=/usr/local/hadoop/hadoop-2.7.7
并将其中的bin和sbin加入path中
 
格式化namenode:hdfs namenode –format或使用hadoop namenode format
 
$ start-dfs.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /usr/local/hadoop/hadoop-2.7.7/logs/hadoop-hadoop-namenode-mhc-linux.out
localhost: starting datanode, logging to /usr/local/hadoop/hadoop-2.7.7/logs/hadoop-hadoop-datanode-mhc-linux.out
Starting secondary namenodes [localhost]
localhost: starting secondarynamenode, logging to /usr/local/hadoop/hadoop-2.7.7/logs/hadoop-hadoop-secondarynamenode-mhc-linux.out
 
 启动namenode报错

ulimit -a for user root

stop-dfs.sh

这里我们直接重新格式化namenode,然后启动namenode就可以了

 hadoop namenode -format  

$ start-dfs.sh
ps -ef|grep node 有三个进程
proc_namenode proc_datanode proc_secondarynamenode start-yarn.sh 访问http://localhost:8088
 

hadoop2.7.7 测试安装 centos7的更多相关文章

  1. 虚拟机安装CentOS7 Minimal、jdk和hadoop

    虚拟机安装CentOS7 Minimal.jdk和hadoop Table of Contents 1. 安装版本 2. PD安装 3. vim安装和配置 4. 主机名变为bogon的解决办法 5. ...

  2. hadoop2.7.1 HA安装部署(转)

    hadoop集群规划 目标:创建2个NameNode,做高可用,一个NameNode挂掉,另一个能够启动:一个运行Yarn,3台DataNode,3台Zookeeper集群,做高可用. 在 hadoo ...

  3. VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装

    VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装在阿里云开源镜像地址下载镜像Index of /centos/7.2.1511/isos/x86_64/http://mirro ...

  4. hadoop2.1.0编译安装教程

    由于现在hadoop2.0还处于beta版本,在apache官方网站上发布的beta版本中只有编译好的32bit可用,如果你直接下载安装在64bit的linux系统的机器上,运行会报一个INFO ut ...

  5. hadoop2.1.0和hadoop2.2.0编译安装教程

    由于现在hadoop2.0还处于beta版本,在apache官方网站上发布的beta版本中只有编译好的32bit可用,如果你直接下载安装在64bit的linux系统的机器上,运行会报一个INFO ut ...

  6. centOS7 mini配置linux服务器(一)安装centOs7

    1. 准备centos-7 (minni镜像) 官网地址http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minim ...

  7. Vmware安装CentOs7+gitlab(一)

    本篇文章主要介绍了VMware安装Centos7超详细过程(图文),具有一定的参考价值,感兴趣的小伙伴们可以参考一下 1.软硬件准备 软件:推荐使用VMwear,我用的是VMwear 12 镜像:Ce ...

  8. Linux环境搭建 | 手把手教你如何安装CentOS7虚拟机

    centos 下载地址: 可以去官网下载最新版本:https://www.centos.org/download/ 以下针对各个版本的ISO镜像文件,进行一一说明: CentOS-7.0-x86_64 ...

  9. VM安装centos7

    镜像:笔者采用的是CentOS-7-x86_64-Minimal-1810.iso版本 1.创建新的虚拟机 2.典型安装与自定义安装 典型安装:VMwear会将主流的配置应用在虚拟机的操作系统上,对于 ...

随机推荐

  1. linux安装python3 ,安装IPython ,安装jupyter notebook

    安装python3    下载到 /opt/中 1.下载python3源码,选择3.6.7因为ipython依赖于>3.6的python环境wget https://www.python.org ...

  2. phpmyadmin无登录表单无法登陆

    发现我的博客的phpmyadmin登录过一次成功之后,后面在登录没有登录表单了,查了很多原因,下面的方法亲测可以解决 打开 phpMyAdmin\libraries\plugins\auth\Auth ...

  3. 【Jmeter自学】常见错误类型(九)

    ==================================================================================================== ...

  4. 【Selenium-WebDriver自学】Selenium-IDE测试创建(三)

    ==================================================================================================== ...

  5. ORA-01461的解决过程~~

    转自:http://blog.itpub.net/7607759/viewspace-521189 近日生产库中的一个过程报出了ora-1461的错误,虽然错误实际处理起来非常简单,但解决过程中与ya ...

  6. 流程图工具Visual Paradigm for UML

  7. 《GPU高性能编程CUDA实战》第五章 线程并行

    ▶ 本章介绍了线程并行,并给出四个例子.长向量加法.波纹效果.点积和显示位图. ● 长向量加法(线程块并行 + 线程并行) #include <stdio.h> #include &quo ...

  8. python中的count

    count(self, sub, start=None, end = None)用于计算字符串中子序列的个数,sub, start=None, end = None定义查找范围,不写默认查找全部 举个 ...

  9. mysql decode encode 乱码问题

    帮网友解决了一个问题,感觉还是挺好的. 问题是这样的:  问个问题:为什么我mysql中加密和解密出来的字段值不一样?AES_ENCRYPT和  AES_DECRYPT  但是解密出来就不对了 有时候 ...

  10. WebForm(内置函数)

    Response - 响应对象1.定义:Response对象用于动态响应客户端请示,控制发送给用户的信息,并将动态生成响应.若指定的cookie不存在,则创建它.若存在,则将自动进行更新.结果返回给客 ...