这里作者使用的是离线安装,原因在于现阶段hdp被收购已经没有在线网络可以提供下载,但是有幸在之前下载了保存了,如有需要可以自行附件下载。以下安装操作皆使用ROOT用户
修改vi /etc/selinux/config 下的 SELINUX= disabled
systemctl disable firewalld
systemctl stop firewalld
ssh-keygen -t rsa
复制key到其他节点(这里的ssh除了互通外也可以只做ambari-server节点可以免密跳转agent节点)
ssh-copy-id –i [you hostname]
下载chrony服务
yum install -y chrony chronyc chronyd
修改/etc/chrony.conf配置文件
vi /etc/chrony.conf
注释所有server xxxxxxxxx iburst
在所有节点添加server [master host]
下载httd
#yum源下载httpd
yum install -y httpd
# 启动httpd
systemctl start httpd
systemctl enable httpd
解压文件到 /var/www/html
tar zxvf HDP-3.1.5.0-centos7-rpm.tar.gz -C /var/www/html
tar zxvf HDP-GPL-3.1.5.0-centos7-gpl.tar.gz –C /var/www/html
tar zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz –C /var/www/html
tar zxvf ambari-2.7.5.0-centos7.tar.gz –C /var/www/html
删除解压后文件中的HTML页面
在/etc/yum.repos.d/文件夹创建ambari.repo
vi /etc/yum.repo.d/ambari.repo
#添加内容
[ambari-2.7.5.0]
name=ambari Version - ambari-2.7.5.0
baseurl=http://[HostIP]/ambari/centos7/2.7.5.0-72/
gpgcheck=1
gpgkey=http://[HostIP]/ambari/centos7/2.7.5.0-72/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
所有节点安装jdk-8u191-linux-x64.rpm(也可为其他版本)
配置环境变量
YUM安装ambari-server
yum install –y ambari-server
启动配置ambari-server
ambari-server setup
设置ambari-server的守护进程用户,这里使用默认为root,也可以根据需求更改为其他用户
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)n
选择设置java环境这里我们使用自己的java环境
[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: /usr/java/default
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.
配置ambari-server的元数据库,可以根据自己需求设置,也可以使用默认PostgreSQL
Configuring database...
Enter advanced database configuration [y/n] (n)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL / MariaDB
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
[7] - BDB
==============================================================================
Enter choice (1):1 选择数据库类型
Database admin user (postgres): 数据库admin用户
Database name (ambari): 数据库名称
Postgres schema (ambari): schema名称
Username (ambari): 数据库用户
Enter Database Password (bigdata): 数据库密码
最终阶段安装完成
Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it...
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
启动ambari-server
用户名:admin 密码:admin 端口:8080
ambari-server start
PS: 安装集群图片为往期版本图片,但是步骤相同
登陆进入首页欢迎页
配置集群名称点击下一步
将集群hostname填入TargetHosts
Hostname支持简单的正则[01-03]等于01,02,03
Host Registration information是选择安装ambari-agent方式
选择使用SSH Private Key
将主节点id_rsa文件中内容复制文本框中(确保主节点可以SSH免密登陆其他节点)
HIVE元数据存储位置
需要在目标库创建用户名密码,确保用户有权限登陆