hadoop简介和环境

来源:互联网 发布:家具软件管理 编辑:程序博客网 时间:2024/05/17 12:48
        Hadoop是一个由Apache基金会所开发的分布式系统基础架构。
用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力进行高速运算和存储。
Hadoop实现了一个分布式文件系统(Hadoop Distributed File System),简称HDFS。HDFS有高容错性的特点,并且设计用来部署在低廉的(low-cost)硬件上;而且它提供高吞吐量(high throughput)来访问应用程序的数据,适合那些有着超大数据集(large data set)的应用程序。HDFS放宽了(relax)POSIX的要求,可以以流的形式访问(streaming access)文件系统中的数据。
        Hadoop的框架最核心的设计就是:HDFSMapReduce。HDFS为海量的数据提供了存储,则MapReduce为海量的数据提供了计算。


环境准备(建议使用centos7):
1.关闭ipv6
# vi /etc/sysctl.conf 
插入下列并保存退出
net.ipv6.conf.all.disable_ipv6=1
        net.ipv6.conf.default.disable_ipv6=1
# sysctl -p


2.修改主机名
# hostnamectl set-hostname master.hadoop

3.关闭firewall 或者 iptables
# systemctl stop iptables
or
# systemctl stop firewalld

4.关闭selinux
修改配置文件为以下(重启生效)
#vi/etc/selinuc/config
 SELINUX=disabled

5.安装jdk
yum install java-1.8.0-openjdk.x86_64 

6.增加用户,配置权限

#useradd hadoop
增加sudo权限
       hadoop    ALL=(ALL)       ALL

7.配置ssh信任
    1.生成公钥私钥
                 $ ssh-keygen -t rsa -f ~/.ssh/id_rsa                    指定秘钥类型 目录 名字
Generating public/private rsa key pair.
Created directory '/home/hadoop/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/hadoop/.ssh/id_rsa.      私钥
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.   公钥
The key fingerprint is:
38:95:cf:a6:78:37:ea:77:3a:20:a1:13:db:3f:2a:72 hadoop@master.hadoop
The key's randomart image is:
2.将公钥拷贝到/home/hadoop/.ssh/authorized_key   中
      #cat /home/hadoop/.ssh/id_rsa.pub>>/home/hadoop/.ssh/authorized_key
    设定权限
      #chmod 600 ~/.ssh/authorized_key 


3.修改stricthostkeychecking  参数
     StrictHostKeyChecking"如果设为"yes",ssh将不会自动把计算机的密匙加入"$HOME/.ssh/known_hosts"文件,且一旦计算机的密匙发生了变化,就拒绝连接。
       可以修改全局变量  vi /etc/ssh/ssh_config
       在这里设置   StrictHostKeyChecking no
       也可以只修改用户的ssh环境
       新建  ~/.ssh/config  
      Host 0.0.0.0
      StrictHostKeyChecking no
最后改下权限  
    chmod 600 ~/.ssh/config