Yun2集群上Ambari+HDP安装
1. 安装环境说明:
系统版本:CentOS7
安装版本:
Ambari版本:2.2.2.0
HDP版本:2.4.2.0
集群机器:
Ambari Server :yun2
Ambari Agent:yun3 ,yun4,yun6,yun18,yun19,yun20,yun21
2. 操作系统环境准备
2.1 配置SSH免密码登录
主节点里root用户登录执行如下步骤:
ssh-keygen –t rsa
cd /root/.ssh
cat id_rsa.pub >>authorized_keys
分发主节点里配置好的authorized_keys到各从节点:
scp -r /root/.ssh/authorized_keys yun3,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun4,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun6,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun18,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun19,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun20,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun21,: /root/.ssh/authorized_keys
2.2 创建ambari系统用户和用户组
只在主节点操作
添加ambari安装、运行用户和用户组,也可以不创建新用户,直接使用root或者系统其他账号
useradd admin
passwd admin
2.3 开启NTP服务
所有集群上节点都需要操作
yum install ntp
systemctl is-enabled ntpd
systemctl enable ntpd
systemctl start ntpd
2.4 关闭防火墙
所有节点都要设置
systemctl disable firewalld
systemctl stop firewalld
2.5 关闭SELinux
所有节点都要设置
查看SELinux状态:
sestatus
如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
临时关闭,不用重启机器:
setenforce 0
修改配置文件需要重启机器:
vi /etc/sysconfig/selinux SELINUX=disabled
3.制作本地源
制作本地源只需在主节点上进行即可
3.1 相关准备工作
3.1.1安装 Apache HTTP 服务器
安装HTTP 服务器,允许 http 服务通过防火墙(永久)
yum install httpd
firewall-cmd --add-service=http
firewall-cmd --permanent --add-service=http
添加 Apache 服务到系统层使其随系统自动启动
systemctl start httpd.service
systemctl enable httpd.service
3.1.2 安装本地源制作相关工具
下载 Ambari 2.2.2 , HDP 2.4.2 的安装资源,本次安装是在Centos 7 上,只列出centos7的资源,其他系统的请现在对用系统的资源,不同版本资源请上http://docs.hortonworks.com/index.html上查找
Ambari 2.2.2 下载资源
OS Format URL
CentOS 7 Base URL http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0
CentOS 7 Repo File http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo
CentOS 7 Tarball md5 asc http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0/ambari-2.2.2.0-centos7.tar.gz
HDP 2.4.2 下载资源
OS Repository Name Format URL
CentOS 7 HDP Base URL http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0
CentOS 7 HDP Repo File http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/hdp.repo
CentOS 7 HDP Tarball md5 asc http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/HDP-2.4.2.0-centos7-rpm.tar.gz
CentOS 7 HDP-UTILS Base URL http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7
CentOS 7 HDP-UTILS Repo File http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz
需要下载的压缩包如下:
Ambari 2.2.2 http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.0.0/HDP-2.4.0.0-centos7-rpm.tar.gz
HDP 2.4.2 http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0/ambari-2.2.2.0-centos7.tar.gz
HDP-UTILS 1.1.0 http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz
在httpd网站根目录,默认是即/var/www/html/,
cd /var/www/html/
根据版本创建目录:Ambari2.2.2.0-HDP2.4.2.0
mkdir Ambari2.2.2.0-HDP2.4.2.0
进入/var/www/html/ambari/
cd /var/www/html/ambari/
将下载的压缩包解压到/var/www/html/ Ambari2.2.2.0-HDP2.4.2.0目录
tar -zxvf ambari-2.2.2.0-centos7.tar.gz
tar -zxvf HDP-2.4.2.0-centos7-rpm.tar.gz
tar -zxvf HDP-UTILS-1.1.0.20-centos7.tar.gz
验证httd网站是否可用,可以使用浏览器直接访问下面的地址:
HTTP://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0
3.3 配置ambari、HDP、HDP-UTILS的本地源
首先下载上面资源列表中的相应repo文件,修改其中的URL为本地的地址,相关配置如下:
ambari.repo:
#VERSION_NUMBER=2.2.2.2.0
[ambari-2.2.2.0]
name=ambari Version - ambari-2.2.2.0
baseurl=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/AMBARI-2.2.2.0/centos7/2.2.2.0-460
gpgcheck=1
gpgkey=http://192.168.1.205/Ambari2.2.2.0-HDP2.4.2.0/AMBARI-2.2.2.0/centos7/2.2.2.0-460/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
hdp.repo:
#VERSION_NUMBER=2.4.2.0-258
[HDP-2.4.2.0]
name=HDP Version - HDP-2.4.2.0
baseurl=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP/centos7/2.x/updates/2.4.2.0
gpgcheck=1
gpgkey=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP/centos7/2.x/updates/2.4.2.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.20]
name=HDP Utils Version - HDP-UTILS-1.1.0.20
baseurl=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP-UTILS-1.1.0.20/repos/centos7
gpgcheck=1
gpgkey=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP-UTILS-1.1.0.20/repos/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
将上面的修改过的源放到/etc/yum.repos.d/下面
yum clean all
yum list update
yum makecache
yum repolist
4.进行安装Ambari
4.1 安装Ambari2.2.2
4.1.1安装Ambari
yum install ambari-server
如果报错,提示:
Error: Package: ambari-server-2.2.2.0-460.x86_64 (ambari-2.2.2.0)
Requires: postgresql-server >= 8.1
原因是postgresql没有安装或版本太低,将Postgresql相关RPM安装包拷入仓库中,然后安装
yum install postgresql-devel-9.2.7-1.el7.x86_64.rpm
yum install postgresql-server-9.2.7-1.el7.x86_64.rpm
yum install postgresql-9.2.7-1.el7.x86_64.rpm
之后再安装Ambari
yum install postgresql-9.2.7-1.el7.x86_64.rpm
4.1.2配置Ambari
ambari-server setup
下面是配置执行流程,按照提示操作
1. 检查SELinux是否关闭,输入y:
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is ‘disabled‘
WARNING: SELinux is set to ‘permissive‘ mode and temporarily disabled.
OK to continue [y/n] (y)? y
2. 提示是否自定义设置。输入:y
Customize user account for ambari-server daemon [y/n] (n)? y
3. ambari-server 账号。直接回车
Enter user account for ambari-server daemon (root):
Adjusting ambari-server permissions and ownership...
4. 检查防火墙,如果关闭则不用操作
Checking firewall status...
Redirecting to /bin/systemctl status iptables.service
5. 设置JDK。输入:3 ,自定义JDK
Checking JDK...
Checking JDK...
[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
6. 如果上面选择3自定义JDK,则需要设置JAVA_HOME。输入:/usr/local/jdk
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/local/jdk Validating JDK on Ambari Server...done. Completing setup...
7. 数据库配置。选择:y
Configuring database... Enter advanced database configuration [y/n] (n)? y
8. 选择数据库类型。输入:1 ,Ambari内置PostgreSQL数据库
Configuring database... ==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] – PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (1): 1
9. 设置数据库的具体配置信息,根据实际情况输入,如果和括号内相同,则可以直接回车。
Hostname (localhost):
Port ():
Database name (ambari):
Username (ambari):ambari
Enter Database Password (bigdata):ambari
4.1.3启动Amabri
执行启动命令,启动Ambari服务
ambari-server start
成功启动后在浏览器输入Ambari地址:
http://192.168.1.202:8080/
出现登录界面,默认管理员账户登录, 账户:admin 密码:admin
登录成功后出现下面的界面,至此Ambari的安装成功
4.2 安装安装HDP 2.4.2 配置集群
点击上面登录成功页面的Launch Install Wizard 按钮进行集群配置
4.2.1设置集群名称
4.2.2设置HDP 安装源
选择HDP2.4 ,并且设置Advanced Repository Options 的信息,本次使用本地源,所以修改对用系统的安装源为本地源地址。
4.2.3设置集群机器
4.2.4 Host 确认
确认前面配置集群中hosts列表 中的机器是否都可用,也可以移除相关机器,集群中机器Success后进行下一步操作。
4.2.5 选择要安装的服务
4.2.6各个服务Master配置
4.2.6 服务的Slaves 和 Clients节配置
4.2.7 服务的客制化配置
其中Ambari Metrics中的Grafana Admin Password必须要在初始化时设置:密码设置为:grafana
HIVE的METASTORE DATAABSE的DATABASE Password也必须设置,设置为:hive
4.2.8 显示配置信息
4.2.9开始安装
安装各个服务,并且完成安装后会启动相关服务,安装过程比较长,如果中途出现错误,请根据具体提示或者log进行操作。
全部安装成功界面如下
原文地址:http://xiaolanlan.blog.51cto.com/11307341/1927259