Ambari学习笔记-安装Ambari2.6 on PostgreSQL

本文介绍如何在四台RHEL7.4主机上利用Ambari Server部署HDP集群,包括安装前的主机配置、软件包安装、本地yum源配置及Ambari Server的详细安装步骤。

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

1 安装前准备

1.1 主机列表

本次实验选择4台主机,1台作为Ambari Server主机,3台作为Ambari Agent

节点ipOS版本jdk版本hostname -f安装软件
192.168.0.1RHEL7.4jdk1.8.0_172DEV000001Ambari Server
192.168.0.2RHEL7.4jdk1.8.0_172DEV000002Ambari Agent
192.168.0.3RHEL7.4jdk1.8.0_172DEV000003Ambari Agent
192.168.0.4RHEL7.4jdk1.8.0_172DEV000004Ambari Agent

注意

  • Ambari Server主机到Ambari Agent主机免密登录
  • Ambari Server/Agent主机需安装JDK
  • 确保主机的hostname -f 满足FQDN格式(在安装集群的第三步Confirm Host需要)
  • 关闭防火墙
  • 确认主机字符集编码为UTF-8(否则Ambari Server 配置数据库可能报错)
  • 开启NTP服务

1.2 安装基本软件包

在所有的主机上安装

yum install openssh wget vim openssh-clients openssl openssh-server -y
systemctl enable sshd
systemctl start sshd

1.3 配置本地yum源

1.3.1 下载安装介质

Ambari:http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.0/ambari-2.6.2.0-centos7.tar.gz 

HDP2.6.5:http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.5.0/HDP-2.6.5.0-centos7-rpm.tar.gz 

HDP-UTILS1.1.0.21:http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz

注意

  • 到hortonworks官网查看HDP对应的Hadoop和Spark版本,选择正确的版本进行下载
  • 安装介质较大

1.3.2 配置HTTP yum源

因Ambari安装集群界面不能识别ftp地址,因此配置成http yum源。在10.124.142.193上安装httpd服务:

yum -y install httpd systemctl start httpd systemctl enable httpd 

将上一步下载的压缩包解压之后,放到/var/www/html下

通过浏览器访问http://192.168.0.1:18080/ambari/centos7/测试http yum源是否正常。

修改解压目录下里的ambari.repo、hdp.repo baseurl地址为http yum源地址。

ambari.repo

#VERSION_NUMBER=2.6.2.0-155
[ambari-2.6.2.0]
name=ambari Version - ambari-2.6.2.0
baseurl=http://192.168.0.1:18080/ambari/centos7/2.6.2.0-155/
gpgcheck=1
gpgkey=http://192.168.0.1:18080/ambari/centos7/2.6.2.0-155/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

hdp.repo

#VERSION_NUMBER=2.6.5.0-292
[HDP-2.6.5.0]
name=HDP Version - HDP-2.6.5.0
baseurl=http://192.168.0.1:18080/HDP-2.6.5.0/centos7/2.6.5.0-292/
gpgcheck=1
gpgkey=http://192.168.0.1:18080/HDP-2.6.5.0/centos7/2.6.5.0-292/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
baseurl=http://192.168.0.1:18080/HDP-UTILS-1.1.0.21/
gpgcheck=1
gpgkey=http://192.168.0.1:18080/HDP-UTILS-1.1.0.21/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

将ambari.repo、hdp.repo拷贝至192.168.0.1,192.168.0.2,192.168.0.3,192.168.0.4的/etc/yum.repos.d目录下。

2 安装Ambari Server on PostgreSQL

yum install -y 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):root
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 3
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/jdk1.8.0_172-amd64
Validating JDK on Ambari Server...done.
Checking GPL software agreement...
Completing setup...
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 (3): 1 ####如果主机字符集编码未设置正确,可能会启动报错,具体可以查看日志/var/log/ambari-server/ambari-server.log
Database admin user (postgres): postgres
Database name (ambari): ambari
Postgres schema (ambari): ambari
Username (ambari): ambari
Enter Database Password (bigdata):
Default properties detected.
Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take up to a minute.
About to start PostgreSQL Configuring local database...
Configuring PostgreSQL...
Backup for pg_hba found, reconfiguration not required Creating schema and user... done.
Creating tables... done.
Extracting system views...
............
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully. 
ambari-server start 

通过浏览器访问http://192.168.0.1:8080测试是否正常启动,默认用户名密码为admin/admin。

如果操作系统使用中文语言环境,在初始化postgre数据库时会因为脚本仅支持UTF8而初始化失败

解决办法:
cat /var/lib/pgsql/initdb.log
rm -rf /var/lib/pgsql/data/pg_log
postgresql-setup initdb
重新运行ambari-server setup 配置即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

snipercai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值