• Ambari和大数据集群部署(精华)


    (个人经历,如有问题请于评论区提出宝贵意见)

    踩了无数的坑,终于将ambari和大数据集群部署成功了,请一定要按照步骤仔细操作,避免出现问题。

    英文官方文档链接:https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-installation/bk_ambari-installation.pdf

    基础环境
    操作系统:ubuntu16
    HDP: 2.6.2.14
    Hdp-utils:1.1.0.21
    Ambari:2.5.2.0
    Jdk:1.8.0_171
    Maven:apache-maven-3.5.2
    Tomcat:apache-tomcat-8.5.24

    重要的配置阶段:
    开启root ssh登录:
    sudo passwd root 设置密码
    sudo apt-get install ssh
    apt-get install vim
    vi /etc/ssh/sshd_config
    将PermitRootLogin without-password注释掉
    添加 PermitRootLogin yes
    sudo service ssh restart

    配置主机名和域名映射
    vim /etc/hostname
    修改主机名为master.hd
    在各个从机中也这样操作,修改主机名为 slave1.hd slave.hd 。。。(注意后缀要相同)
    Ifconfig复制本地ip
    Vim /etc/hosts
    不要删除任何内容,添加本地ip 和对应主机名,同时也要添加集群中其他机器的ip和主机名
    从机中操作亦如此

    Ssh免密登录
    sudo ssh-keygen
    cd ~/.ssh
    cat id_rsa.pub >> authorized_keys
    ssh-copy-id root@slave1.hd
    ssh-copy-id root@slave2.hd
    ssh-copy-id root@slave3.hd
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
    试试看能不能用ssh root@xxx.slave 登录到其他任意从机

    在集群和浏览器主机上启用NTP
    apt-get install ntp
    update-rc.d ntp defaults

    配置防火墙
    sudo ufw disable
    sudo iptables -X
    sudo iptables -t nat -F
    sudo iptables -t nat -X
    sudo iptables -t mangle -F
    sudo iptables -t mangle -X
    sudo iptables -P INPUT ACCEPT
    sudo iptables -P FORWARD ACCEPT
    sudo iptables -P OUTPUT ACCEPT

    禁用SELinux和PackageKit并检查umask
    setenforce 0
    vim /etc/selinux/config (如果有)
    设置SELINUX=disabled
    umask 0022
    echo umask 0022 >> /etc/profile

    配置反向代理
    apt-get install nginx
    vim /etc/nginx/sites-available/default (或者/etc/nginx/nginx.conf)
    在server{}中加上这句 autoindex on;

    配置本地源
    下载hdp hdp-utils ambari三个包并解压到/var/www/html 下的不同文件目录下
    删掉/var/www/html/ 下的html文件
    进入hdp目录 给与目录下所有文件 777权限,后面安装要用
    wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.
    hortonworks.com/ambari/ubuntu16/2.x/updates/2.5.1.0/ambari.list
    apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
    vim /etc/apt/sources.list.d/ambari.list
    修改ambari仓库的地址为本地仓库地址http://xxxx.master/ambari/ambari/ubuntu/(注意修改)
    apt-get update
    apt-cache showpkg ambari-server
    apt-cache showpkg ambari-agent
    apt-cache showpkg ambari-metrics-assembly
    apt-get install yum
    vim /etc/yum/repos.d/ambari.repo
    改下版本号即可

    安装部署阶段
    安装ambari
    apt-get install ambari-server
    ambari-server setup
    n
    选3 并且复制粘贴jdk路径
    一路回车即可
    ambari-server start
    http://<主机IP>:8080
    操作集群中所有机器 vim /etc/ambari-agent/conf/ambari-agent.ini
    修改hostname=<主机名>
    在[security]中加上force_https_protocol=PROTOCOL_TLSv1_2
    Ambari-agent restart(或重启服务器)
    傻瓜式操作,不在赘述
    遇到问题,点Failed,或进入/var/log/xxx 查看相应日志

  • 相关阅读:
    gnats配置文件
    在Mac中安装python,配置python环境
    利用git bash和git gui向git远程仓库提交文件
    os模块
    django中的locale()函数
    django配置静态文件
    sso单点登录
    django get_object_or_404
    关于token
    Django的CSRF机制
  • 原文地址:https://www.cnblogs.com/loveBolin/p/9732831.html
Copyright © 2020-2023  润新知