zoukankan      html  css  js  c++  java
  • CentOS6非root用户下安装及配置CDH5.3.0

    #install lsb package
    sudo yum install -y redhat-lsb

    #install net-tools package

    sudo yum install -y net-tools
    #sudo时不需要密码(NOPASSWD前是 )
    sudo vim /etc/sudoers
    nanjing ALL =(ALL)  NOPASSWD: ALL
    #Set the hostname to a unique name (not localhost).
    modify HOSTNAME
    sudo vi /etc/sysconfig/network

    sudo vi /etc/hosts

    172.16.1.121 crawler1
    172.16.1.122 crawler2
    172.16.1.123 crawler3
    172.16.1.124 controller1
    172.16.1.125 master1
    172.16.1.126 slave1
    172.16.1.127 slave2
    172.16.1.128 zombie1


    #stop iptables and disable the service

    sudo service iptables stop
    sudo chkconfig --level 2345 iptables off


    #download and install jdk 1.8.0_11
    https://pan.baidu.com/s/1miHbW6k

    sudo setenforce 0
    sudo vi /etc/selinux/config 下的 SELINUX=disabled
    sudo /usr/sbin/sestatus -v

    #再controller1上从ftp服务器下载所有cdh5的包
    #install CDH Manager5
    Pre-requisites: multiple, Internet-connected Linux machines, with SSH access, and significant free space in /var and /opt.

    wget http://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin

    chmod u+x cloudera-manager-installer.bin

    #再controller1上
    #Creating and Using a Package Repository for Cloudera Manager
    #Installing Apache HTTPD。
    sudo yum install -y httpd
    sudo service httpd start
    sudo chkconfig --level 2345 httpd on





    cp cm5.3.0-centos6.tar /var/www/html/
    cd /var/www/html/
    sudo tar xzvf cm5.3.0-centos6.tar

    #在master1上
    sudo vi /etc/yum.repos.d/cm5.repo

    [cm5]    
    name=cm5
    baseurl=http://172.16.1.124/cm/5
    enabled=1
    gpgcheck=0

    #在controller1上
    sudo yum install yum-utils createrepo
    cd /var/www/html/cm/5.3.0
    sudo createrepo .
    #在master1上
    sudo vi /etc/yum.repos.d/cloudera-cm.repo
    [cloudera-cm]
    # Packages for Cloudera's Distribution for cm, Version 5, on RedHat     or CentOS 7 x86_64
    name=Cloudera's Distribution for cm, Version 5
    #baseurl=http://repos.jenkins.cloudera.com/cm5.10.0-release/redhat/7/x86_64/cm/5/
    #gpgkey = http://repos.jenkins.cloudera.com/cm5.10.0-release/redhat/7/x86_64/cm/RPM-GPG-KEY-cloudera
    #gpgcheck = 1
    baseurl=http://172.16.1.124/cm/5.3.0
    #gpgkey = http://repos.jenkins.cloudera.com/cm5.10.0-release/redhat/7/x86_64/cm/RPM-GPG-KEY-cloudera
    gpgcheck = 0

    sudo yum clean all


    sudo ./cloudera-manager-installer.bin --skip_repo_package=1

    #在controller1上
    sudo mkdir -p /home/nanjing/cdh5/parcels
    cd /home/nanjing/cdh5/parcels
    wget --no-check-certificate https://archive.cloudera.com/cdh5/parcels/5.3.0/CDH-5.3.0-1.cdh5.3.0.p0.30-el6.parcel.sha1

    chmod -R 777 /home/nanjing/cdh5/parcels/
    chmod -R o+x ~/

    sudo mkdir /var/www/html/cdh/

    sudo ln -s /home/nanjing/cdh5/parcels /var/www/html/cdh/5

    #设置master NTP,关闭Swap
    sudo rm -f /etc/localtime
    sudo cp  /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    sudo vim /etc/ntp.conf

    server      ntp1.aliyun.com
    server      time1.cloud.tencent.com

    #设置默认策略为允许任何主机进行时间同步

    restrict default ignore

    sudo hwclock -w


    sudo service ntpd start
    sudo chkconfig --level 2345 ntpd on

    #其他机器
    sudo vim /etc/ntp.conf
    server 172.16.1.125

    sudo chkconfig --level 2345 ntpd on
    sudo service ntpd start
    sudo ntpq -p

    #修改swappiness
    # 临时修改
    sudo sysctl -w vm.swappiness=0
    # 永久修改
    sudo echo "vm.swappiness=0" >> /etc/sysctl.conf

     #修改打开句柄数
    sudo vim /etc/security/limits.conf
    *       soft    nofile          32768
    *       hard    nofile          1048576
    *       soft    nproc           65536
    *       hard    nproc           unlimited
    *       soft    memlock         unlimited
    *       hard    memlock         unlimited

    #将当前用户添加到hdfs组:
    sudo usermod -a -G hdfs nanjing
    sudo usermod -a -G root nanjing
    #打开浏览器
    输入http://172.16.1.125:7180/  用户名密码都是admin,登录后继续操作。
    如果chrome登录不成功,尝试使用中文版Firefox。
    登录后选择安装express版本,搜索主机时填写172.16.1.[125-127]
    然后全选,在选择安装方式时选择“使用 Parcel (建议)”,然后点击后面的“更多选项”,
    配置“远程 Parcel 存储库 URL” 中的第一行为:http://172.16.1.124/cdh/5/,
    删除其他的“远程 Parcel 存储库 URL”,点击确定,弹出层关闭后,页面自动更新,
    显示“选择 CDH 的版本”为:“CDH-5.3.0-1.cdh5.3.0.p0.30 ”
    继续安装即可。

    安装的时候如果遇到下面的错误:
    Command failed to run because service Hive has invalid configuration. Review and correct its configuration. First error: 'Hive Metastore Database Host' is required when using database type 'postgresql'
    返回,选择只安装HDFS,OOzie,zookeeper,HBase,Yarn等基本组件即可,Spark、Hive等可以后续再安装。

    如果是后续往集群中添加机器,则可以在添加远程repo的时候,填写:http://192.168.88.35/cm/5.3.0/

         已启用“透明大页面”,它可能会导致重大的性能问题。版本为“CentOS release 6.4 (Final)”且发行版为“2.6.32-358.el6.x86_64”的 Kernel 已将 enabled 设置为“[always] never”,并将 defrag 设置为“[always] never”。请运行“echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag”以禁用此设置,然后将同一命令添加到一个 init 脚本中,如 /etc/rc.local,这样当系统重启时就会予以设置。或者,升级到 RHEL 6.5 或更新版本,它们不存在此错误。将会影响到以下主机:


  • 相关阅读:
    Design pattern
    ArcSDE 快速入门
    struts2中s:select标签的使用
    CreateProcess error=87
    在DOS下添加用户
    加载SpringContext文件的方式
    svnkit获取svn相关信息
    Bat命令(管道与组合)
    JBOSS中使用RMI不能连接服务器的原因
    HTML中滚动条的样式设置
  • 原文地址:https://www.cnblogs.com/sixiweb/p/11344049.html
Copyright © 2011-2022 走看看