使用Ambari搭建HDP(流程python脚本化)

本文详细记录了在阿里云ECS上部署Ambari 2.2.2.0与HDP 2.4.2.0集群的过程,包括配置、常见问题及解决方案。分享了http服务器安装、SSL连接、Yum源更新、Hive权限设置等关键步骤。

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

版本

Ambari:2.2.2.0

HDP:2.4.2.0

服务器:

使用阿里云的ECS:(3tai)

配置:

参考官网吧!!!(因为穷,刚开始因为配置低了,踩了很多坑,浪费了很多时间啊啊啊,还是要多赚钱,买服务器哇)

步骤:

参靠官网和其他的博客(有点懒,不想写了)

 

 

遇到的问题1:

1.需要安装http服务器:

安装成功要要能在浏览器中显示出一个主叶,楼楼刚开始在浏览器上啥也没有,就是一个“连接被重置”,但是80端口是通的

这个可能是ECS有关,找了阿里云的小哥哥看下,在云盾管理台中设置了下白名单就解决了这个问题。。。。

 

2.ERROR 2019-06-13 18:49:04,610 NetUtil.py:85 - SSLError: Failed to connect. Please check openssl library versions.

解决方法:

By adding below config in [security] section of

  1. vi /etc/ambari-agent/conf/ambari-agent.ini
  2. force_https_protocol=PROTOCOL_TLSv1_2
  1. vi /etc/python/cert-verification.cfg
  2. [https]
  3. verify=disable

2.因为之前有重装过,会出现no more mirrors to try”

解决方法:

可能原因是不正当的删除造成的。

尝试

yum clean all
yum makecache
yum -y update

命令 ,然后重新安装

3.搭建好ambari后,进入hive时,执行命令hive,报错:user=root, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

解决方法:

# su - hdfs  
$ hdfs dfs -mkdir /user/root  
$ hdfs dfs -chown root:root /user/root 

 

 

import paramiko
HOSTNAME="root"
PORT=22
HOSTFILE="/etc/hosts"
PASSWD="Wyx@2019"
HOSTS={"47.99.151.38":"192.168.0.29",
       "47.99.79.221":"192.168.0.30",
       "47.98.222.97":"192.168.0.31"}
path_file_new="/etc/hosts_new"
def copyhosts():
    for key in HOSTS:
        transport=paramiko.Transport(HOSTS[key],PORT)
        transport.connect(username=HOSTNAME,password=PASSWD)
        sftp=paramiko.SFTPClient.from_transport(transport)
        sftp.put('/etc/hosts','/etc/hosts')
def change_host():
    name=3
    file = open(path_file_new, 'w')
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    for key in HOSTS:
        NM="sw0%s"%name

        ssh.connect(key,port=PORT,username=HOSTNAME,password=PASSWD
                    )
        ssh.exec_command('hostname %s ' % NM)
        file.write(HOSTS[key]+"  "+NM+"\n")
        name-=1

    file.close()
    ssh.exec_command('rm -rf /etc/hosts')
    ssh.exec_command('mv /etc/hosts_new  /etc/hosts')
def ssh_login():
    
change_host()
copyhosts()





 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值