Ambari搭建Hadoop家族组件
介绍
Ambari是Apache的顶级项目,就 Ambari 的作用来说,就是创建、管理、监视 Hadoop 的集群,但是这里的 Hadoop 是广义,指的是 Hadoop 整个生态圈(例如 Hive,Hbase,Sqoop,Zookeeper 等),而并不仅是特指 Hadoop。用一句话来说,Ambari 就是为了让 Hadoop 以及相关的大数据软件更容易使用的一个工具。
Ambari 自身也是一个分布式架构的软件,主要由两部分组成:Ambari Server 和 Ambari Agent。简单来说,用户通过 Ambari Server 通知 Ambari Agent 安装对应的软件;Agent 会定时地发送各个机器每个软件模块的状态给 Ambari Server,最终这些状态信息会呈现在 Ambari 的 GUI,方便用户了解到集群的各种状态,并进行相应的维护。
安装部署流程
准备
服务器系统:CentOS 7.x
数量:3台(1台master,2台agent,演示用的话,4GB内存即可)
1.SSH免密
确保Ambari的所有服务器都是互相互信的,这里面,建议用root用户,因为Ambari在安装过程中,会创建很多目录,需要权限,使用root用户,避免了不必要的麻烦;
2.Yum
确保Yum正常工作;
3.Python
确保版本大于等于2.6
4.Mysql
Ambari需要数据库来存储一些配置和部署信息,myql 5.6或以上即可;
5.JDK
安装JDK,并配置JAVA_HOME
6.防火墙关闭
请确保内网的端口之间没有防护墙限制
systemctl stop firewalld
systemctl disable firewalld
7.关闭SELinux
8.安装ntp
yum install ntp
systemctl start ntpd
systemctl enable ntpd
安装
下载导入yum库
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.2/ambari.repo
mv ambari.repo /etc/yum.repos.d
搭建HTTP私服
由于网络原因,安装包,如果都从“墙外”下载,会有很多不稳定因素和情况,建议优先下载好,搭建下载私服,提供安装包服务
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.2/ambari-2.6.2.2-centos7.tar.gz
wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.5.0/HDP-2.6.5.0-centos7-rpm.tar.gz
wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
# 搭建http服务
yum install yum-utils createrepo
yum install httpd
systemctl start httpd
systemctl enable httpd
mkdir -p /var/www/html/
然后把上面下载的3个压缩包,在/var/www/html解压,进行验证,分别浏览器打开下面3个地址:
http://192.168.1.240/ambari/centos7/2.6.2.2-1
http://192.168.1.240/HDP/centos7/2.6.5.0-292
http://192.168.1.240/HDP-UTILS/centos7/1.1.0.22
然后修改/etc/yum.repos.d/ambari.repo文件内容为
#VERSION_NUMBER=2.6.2.2-1
[ambari-2.6.2.2]
name=ambari Version - ambari-2.6.2.2
baseurl=http://192.168.1.240/ambari/centos7/2.6.2.2-1
gpgcheck=0
enabled=1
priority=1
# 更新源信息,在列表应该可以看到Ambari相关的信息
yum clean all
yum list | grep ambari
安装启动
# 运行安装命令
yum install -y ambari-server
# 安装完成后,需要进行一些配置
ambari-server setup
# 有可能得到下面2个提示
# WARNING: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties.
# WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
# 新建/usr/share/java目录,复制mysql的驱动JAR到这里 在/etc/ambari-server/conf/ambari.properties中加入一句话:server.jdbc.driver.path=/usr/share/java/mysql-connector-java-5.1.40.jar;然后在MYSQL中新建一个我们配置中输入的database同名的数据库,在此数据库中执行上面的SQL:/var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
# 最后是启动
ambari-server start
然后打开相关的WEB页面,即可看到,默认登录信息为admin / admin

STEP 1:输入集群名称

STEP 2:选择local仓库进行安装,配置地址为我们的私服地址
STEP 3:填写集群名称,上传可以登录其他机器的私钥和SSH用户、端口

STEP 4:确认HOST,并由MASTER向其他服务器推送Ambari-Agent的请求,安装和检查完成后,如下界面,点击红框内容,查询是warning情况

STEP 5:选择大数据组件进行安装


