Ambari 2.7.5+HDP 3.1.5.0部署

本文档详细介绍了在HDP 3.1.5和Ambari 2.7.5环境下进行大数据平台部署的步骤,包括环境准备,如配置主机名、hosts文件,禁用selinux firewalld,设置umask,主机互信,配置ulimit,时间同步,设置swap,安装jdk1.8,以及Ambari的安装,涉及httpd配置和repo设置。

HDP(Hortonworks Data Platform)3.1.5和Ambari(Apache Ambari)2.7.5是开源的大数据平台软件。它们本身没有特别限制使用的限制,可以在符合其运行要求的计算机上自由安装和使用。

但是需要注意的是,使用这些软件可能涉及到一些许可证和法律条款方面的问题。例如,如果您在商业环境中使用HDP和Ambari,则需要了解相关的商业许可证费用和条件。此外,在某些国家或地区,可能有禁止或限制使用此类软件的法规。

因此,建议在使用HDP和Ambari之前,仔细阅读相应的许可证和法律条款,并遵守相关规定。

环境准备

yum update

配置主机名和/etc/hosts文件

cat >> /etc/hosts << EOF
192.168.110.134 hdp0.itcast.cn hdp0
192.168.110.135 hdp1.itcast.cn hdp1
192.168.110.136 hdp2.itcast.cn hdp2
EOF

使用 hostname -f 检查是否能够映射FQDN主机名

禁用selinux firewalld

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
systemctl disable --now firewalld

设置umask

为当前登录session设置umask:
umask 0022
检查设置:
umask
为每个用户设置:
echo umask 0022 >> /etc/profile

UMASK(用户掩码或用户文件创建MASK)设置在Linux计算机上创建新文件或文件夹时授予的默认权限或基本权限。
大多数Linux发行版(发行版)都将022设置为默认的umask值。
umask值为022,为新文件或文件夹授予755的读取,写入和执行权限。
umask值027为新文件或文件夹授予750读取,写入和执行权限。
Ambari,HDP和HDF支持umask值022(0022在功能上等效),027(0027在功能上等效)。
必须在所有主机上设置这些值。

主机互信(可选)

yum install -y sshpass
ssh-keygen -f /root/.ssh/id_rsa -P ''
export IP="192.168.110.134 192.168.110.135 192.168.110.136"
export SSHPASS=Unique#2022
for HOST in $IP;do
     sshpass -e ssh-copy-id -o StrictHostKeyChecking=no $HOST
done

cat ssh_key.sh

#!/bin/bash

COLOR="echo -e \\033[01;31m"
END='\033[0m'

NET_NAME=`ip addr |awk -F"[: ]" '/^2: e.*/{print $3}'`
IP=`ip addr show ${NET_NAME}| awk -F" +|/" '/global/{print $3}'`
export SSHPASS=Unique#2022
HOSTS="
192.168.10.134
192.168.10.135
192.168.10.136"

os(){
    OS_ID=`sed -rn '/^NAME=/s@.*="([[:alpha:]]+).*"$@\1@p' /etc/os-release`
}

ssh_key_push(){
    rm -f ~/.ssh/id_rsa*
    ssh-keygen -f /root/.ssh/id_rsa -P '' &> /dev/null
    if [ ${OS_ID} == "CentOS" -o ${OS_ID} == "Rocky" ] &> /dev/null;then
        rpm -q sshpass &> /dev/null || { ${COLOR}"安装sshpass软件包"${END};yum -y install sshpass &> /dev/null; }
    else
        dpkg -S sshpass &> /dev/null || { ${COLOR}"安装sshpass软件包"${END};apt -y install sshpass &> /dev/null; }
    fi
    sshpass -e ssh-copy-id -o StrictHostKeyChecking=no ${IP} &> /dev/null
    [ $? -eq 0 ] && echo ${IP} is finished || echo ${IP} is false

    for i in ${HOSTS};do
        sshpass -e scp -o StrictHostKeyChecking=no -r /root/.ssh root@${i}: &> /dev/null
        [ $? -eq 0 ] && echo ${i} is finished || echo ${i} is false
    done

    for i in ${HOSTS};do
        scp /root/.ssh/known_hosts ${i}:.ssh/ &> /dev/null
        [ $? -eq 0 ] && echo ${i} is finished || echo ${i} is false
    done
}

main(){
    os
    ssh_key_push
}

main

配置ulimt

ulimit -SHn 65535

时间同步

yum -y install chrony tree
systemctl enable --now chronyd
chronyc sources

设置swap

echo vm.swappiness = 1 >> /etc/sysctl.conf
sysctl vm.swappiness=1
sysctl -p

安装jdk1.8

tar xf jdk-8u341-linux-x64.tar.gz -C /opt/
cat >> /etc/profile.d/java.sh << EOF
JAVA_HOME=/opt/jdk1.8.0_341
PATH=\$PATH:\$JAVA_HOME/bin:\$JAVA_HOME/sbin
EOF
source /etc/profile
java -version

安装ambari

配置httpd

yum -y install httpd
tar xf ambari-2.7.5.0-centos7.tar.gz -C /var/www/html/
tar xf HDP-3.1.5.0-centos7-rpm.tar.gz -C /var/www/html/
tar xf HDP-GPL-3.1.5.0-centos7-gpl.tar.gz -C /var/www/html/
tar xf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/

mkdir /var/www/html/libtirpc
mv libtirpc-0.2.4-0.16.el7.x86_64.rpm libtirpc-devel-0.2.4-0.16.el7.x86_64.rpm /var/www/html/libtirpc/
yum -y install createrepo
createrepo /var/www/html/libtirpc/

systemctl enable --now httpd

http://192.168.10.134/ambari/
http://192.168.10.134/HDP/
http://192.168.10.134/HDP-GPL/
http://192.168.10.134/HDP-UTILS/
http://192.168.10.134/libtirpc/

配置repo

rm -f /etc/yum.repos.d/{ambari.repo,HDP.repo,libtirpc.repo}

cat >> /etc/yum.repos.d/ambari.repo << EOF
[Ambari-2.7.5.0]
name=Ambari-2.7.5.0
baseurl=http://192.168.10.134/ambari/centos7/2.7.5.0-72/
gpgcheck=0
enabled=1
priority=1
EOF

cat >> /etc/yum.repos.d/HDP.repo << EOF
[HDP-3.1.5.0]
name=HDP Version - HDP-3.1.5.0
baseurl=http://192.168.10.134/HDP/centos7/3.1.5.0-152/
gpgcheck=0
enabled=1
priority=1

[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://192.168.10.134/HDP-UTILS/centos7/1.1.0.22/
gpgcheck=0
enabled=1
priority=1

[HDP-GPL-3.1.5.0]
name=HDP-GPL Version - HDP-GPL-3.1.5.0
baseurl=http://192.168.10.134/HDP-GPL/centos7/3.1.5.0-152
gpgcheck=0
enabled=1
priority=1
EOF

cat >> /etc/yum.repos.d/libtirpc.repo << EOF
[libtirpc_repo]
name=libtirpc-0.2.4-0.16
baseurl=http://192.168.10.134/libtirpc/
gpgcheck=0
enabled=1
priority=1
EOF
yum makecache
yum repolist

安装ambari-server

yum -y install ambari-server
ambari-server setup
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):ambari
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Custom JDK
==============================================================================
Enter choice (1): 2                  
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME: /opt/jdk1.8.0_341
Validating JDK on Ambari Server...done.
Check JDK version for Ambari Server...
JDK version found: 8
Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
Checking GPL software agreement...
GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? y
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? 
Configuring database...
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take up to a minute.
Initializing database ... OK


About to start PostgreSQL
Configuring local database...
Configuring PostgreSQL...
Restarting PostgreSQL
Creating schema and user...
done.
Creating tables...
done.
Extracting system views...
ambari-admin-2.7.5.0.72.jar
....
Ambari repo file doesn't contain latest json url, skipping repoinfos modification
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

ambari-server start
工作过程中撰写的部署文档,注释,文字说明详尽。 1.关于注册失败错误,查看log: ============= INFO 201709‐21 10:52:33,435 security.py:178 ‐ Server certificate not exists, downloading INFO 201709‐21 10:52:33,435 security.py:191 ‐ Downloading server cert from https://ambari‐test1.com:9440/cert/ca/ ERROR 201709‐21 10:52:33,510 ServerAPI.py:137 ‐ POST https://ambari‐ test1.com:9441/api/v1/register failed. (SSLError(1, u&#39;[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)&#39;),) ============ 1 2 3 4 5 6 这个错误是因为python‐2.7.5‐e58版本默认是使用ssl验证,为了解决这个问题需要关闭此验证 或者降级python版本 vi /etc/python/cert‐verification.cfg #修改的内容如下 verify=disable 第二种办法是更新openssl的版本(经测试,更新到1.1版本无效) 具体做法是 1.可以直接通过来在线更新来解决 yum upgrade openssl 2.编译源码 yum install gcc gcc‐c++ autoconf automake zlib zlib‐devel pcre‐devel #下载编译 源码需要的工具 cd /usr/local/src wget https://www.openssl.org/source/openssl‐1.0.2‐latest.tar.gz #下载源码包 tar ‐xzvf openssl‐1.0.2‐latest.tar.gz #解压 cd openssl‐1.0.2* ./config #检查配置 make && make install #编译并安装 mv /usr/bin/openssl /tmp/ #移除原有的openssl ln ‐s /usr/local/bin/openssl /usr/bin/openssl #建立软连接 注意,openssl所在目录请自行判断 注意,openssl: error while loading shared libraries: libssl.so.1.1 解决方法: 在root用户下执行: ln ‐s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1  ln ‐s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1  openssl version #查看openssl版本
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值