使用ambari离线安装Hadoop集群

本文详细介绍了如何在CentOS 6环境下搭建HDP集群并配置Ambari,包括多节点主机名配置、SSH免密登录设置、Ambari及HDP组件的下载与同步等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

准备工作:(系统centos6) (推荐java1.7以上版本)

 1.准备至少3台机器依次配置每台机器的主机名,第一台机器同时作为yum本地源

配置主机名3

1.#hostname hdp1

2.# vim /etc/sysconfig/network

  HOSTNAME=hdp1

3.# vim /etc/hosts

192.168.144.63 hdp1

192.168.144.64 hdp2

192.168.144.70 hdp3

2.设置hdp1免密码登陆hdp2,hdp3

  hdp1上执行:

  #ssh-keygen -t rsa 3次回车)

  # scp ~/.ssh/id_rsa.pub root@hdp1:~/

  # scp ~/.ssh/id_rsa.pub root@hdp2:~/

  # scp ~/.ssh/id_rsa.pub root@hdp3:~/

  每台机器上执行:

  #vim /etc/ssh/sshd_config  (打开下面3行的注释)

       RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile      .ssh/authorized_keys

  # cat ~/id_rsa.pub >> ~/.ssh/authorized_keys  

下载 HDP   HDP-UTILS  

#wget -nv http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.2.0/hdp.repo -O /etc/yum.repos.d/hdp.repo

#同步

#Yum repolist

#reposync -r HDP-2.3.2.0

#reposync -r HDP-UTILS-1.1.0.20

下载 Amabri 

# wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.1.2.1/ambari.repo -O /etc/yum.repos.d/ambari.repo

#同步

#yum repolist

  # reposync -r Updates-ambari-2.1.2.1

 

每台机器安装:

#yum install -y mesa-libGL.i686

#yum install openssl

     [安装时遇到openssl问题# rpm -qa|grep openssl

     # rpm -e openssl-1.0.1e-15.el6.x86_64

     # rpm -Uvh openssl-devel-1.0.0-27.z.2.ec1.gf.el6.x86_64.rpm]

#yum install nc

#yum install redhat-lsb

#yum install gcc

#yum install python-devel

#yum install python-libs

  关闭 Linux  THP 服务(#centos6)

  # echo transparent_hugepage=never >> /etc/grub.conf

  #echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled

  #yum install ntp

  # chkconfig ntpd on && service ntpd start

  (失败vim /etc/ntp.conf  添加ntpd_enable="YES")

关闭 SELinux 服务,关闭防火墙,

#chkconfig iptables off && service iptables stop && setenforce 0

修改/etc/selinux/config文件中的SELINUX="" disabled

  # mkdir -p /var/lib/ambari-agent/data

  #date -s "2015-12-05 15:02:00"校准时间

  #/etc/init.d/sshd restart

 

 

第一台机器安装:

  #yum install createrepo (安装  createrepo ,用于制作本地源)

  /etc/yum.repo.d文件夹中添加一个 ambari.repo文件,内容如下:

[Updates-ambari-2.1.2.1]

name=ambari-2.1.2.1 - Updates

baseurl=http://192.168.116.129/ambari/Updates-ambari-2.1.2.1/

gpgcheck=0

enabled=1

[HDP-2.3.2.0]

name=HDP Version - HDP-2.3.2.0

baseurl=http://192.168.116.129/ambari/HDP-2.3.2.0/

gpgcheck=0

enabled=1

[HDP-UTILS-1.1.0.20]

name=HDP Utils Version - HDP-UTILS-1.1.0.20

baseurl=http://192.168.116.129/ambari/HDP-UTILS-1.1.0.20/

gpgcheck=0

enabled=1

# mkdir /var/www/html/ambari

把上面下载的文件夹移动到abmari

#createrepo /var/www/html/ambari

#createrepo HDP-2.3.2.0/

#createrepo HDP-UTILS-1.1.0.20/

 

#createrepo Updates-ambari-2.1.2.1/

  配置环境:httpd 服务

  #vi /etc/httpd/conf/httpd.conf

    #ServerName  www.example.com :80  修改为 ServerName hostname:80

修改访问权限:

<Directory />

  Options FollowSymLinks

  AllowOverride None

</Directory>

启动 httpd 服务

#chkconfig httpd on && service httpd start

 

#yum clean all && yum makecache

# yum install ambari-server

#ambari-server setup

# ambari-server start

 

3.访问hdp1:8080安装

注意:

Select Stack> Advanced Repository Options指定本地源

  安装ambari-agent选择的sshkeyid_rsa

  #mkdir /var/lib/ambari-agent/data

  安装agent报错

  vi /etc/ambari-agent/conf/ambari-agent.ini

[server]

hostname=<your.ambari.server.hostname>

url_port=8440

secured_url_port=8441

  使用hiveview报错

修改hdfs》df.permision =false

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值