千家信息网

大数据平台HDP搭建

发表于:2025-01-30 作者:千家信息网编辑
千家信息网最后更新 2025年01月30日,一、概述Apache Ambari是一个基于Web的支持Apache Hadoop集群的供应、管理和监控的开源工具,Ambari已支持大多数Hadoop组件,包括HDFS、MapReduce、Hive
千家信息网最后更新 2025年01月30日大数据平台HDP搭建

一、概述

Apache Ambari是一个基于Web的支持Apache Hadoop集群的供应、管理和监控的开源工具,Ambari已支持大多数Hadoop组件,包括HDFS、MapReduce、Hive、Pig、 Hbase、Zookeeper、Sqoop和Hcatalog等。提供Web UI进行可视化的集群管理,简化了大数据平台的安装、使用难度。

二、安装部署

2.1 主机规划

序号IP地址主机名系统版本
1172.20.2.222ambari-servercentos7.3
2172.20.2.203hadoop-1centos7.3
3172.20.2.204hadoop-2centos7.3
4172.20.2.205hadoop-3centos7.3

2.2 部署

2.2.1 基础环境部署

a.修改主机名配置hosts

systemctl stop firewalldhostnamectl set-hostname  ambari-server   #更改个主机名sed -i 's/SELINUX=enforcing/SELINUX=disable/g' /etc/selinux/configsetenforce 0cat >>/etc/hosts<

b.配置ambari-server免密钥登录其他节点

ssh-keygen -t rsa     #在ambari-server生成密钥对for num in `seq 1 3`;do ssh-copy-id -i /root/.ssh/id_rsa.pub root@hadoop-$num;done

c.在ambari-server安装数据库
在ambari的setup中我们可以选择使用默认的postgresql,也可以自定义使用其他数据库,此处选用mariadb,便于后期管理维护

yum -y install mariadb-server mysql-connector-javasystemctl start mariadbmysql -uroot password "mysqladmin"登录数据库后我们采用root登录

d.配置本地yum源
由于ambari的各个组件包很大,HDP大约快6G,我们采取离线安装方式,将ambari-server配置为yum源,事先在网上下载HDP、HDP-UTILS和Ambari
软件版本:

参考url:ambari各版本参考链接
HDP和HDP UTILS参考链接

ambariHDPHDP-UTILS
2.4.1.02.5.0.01.1.0.21
yum install httpd -y && systemctl start httpdmkdir /software && cd /software#下载软件wget -c http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.1.0/ambari-2.4.1.0-centos7.tar.gzwget -c http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.0.0/HDP-2.5.0.0-centos7-rpm.tar.gzwget -c http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz#创建目录mkdir -p /var/www/html/ambarimkdir /var/www/html/hdp/{HDP,HDP-UTILS-1.1.0.21}#解压软件tar -zxvf ambari-2.4.1.0-centos7.tar.gz -C /var/www/html/ambari/tar -zxvf HDP-UTILS-1.1.0.21-centos7.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.21/tar -zxvf HDP-2.5.0.0-centos7-rpm.tar.gz -C /var/www/html/hdp/配置ambari YUM源cat >/etc/yum.repos.d/ambari.repo</etc/yum.repos.d/hdp.repo<

2.2.2 安装配置ambari

a.安装ambari server

yum clean allyum makecacheyum -y install ambari-server#进入数据库创建ambari库和导入数据mysql>create database ambari DEFAULT CHARSET utf8;mysql>use ambarimysql>source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

b.配置ambari

[root@ambari-server hdp]# ambari-server setupUsing python  /usr/bin/pythonSetup ambari-serverChecking SELinux...SELinux status is 'enabled'SELinux mode is 'permissive'WARNING: SELinux is set to 'permissive' mode and temporarily disabled.OK to continue [y/n] (y)? yCustomize user account for ambari-server daemon [y/n] (n)? yEnter user account for ambari-server daemon (root):rootAdjusting 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): 1To download the Oracle JDK and the Java Cryptography Extension (JCE) Policy Files you must accept the license terms found at http://www.oracle.com/technetwork/java/javase/terms/license/index.html and not accepting will cancel the Ambari Server setup and you must install the JDK and JCE files manually.Do you accept the Oracle Binary Code License Agreement [y/n] (y)? yDownloading JDK from http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u77-linux-x64.tar.gz to /var/lib/ambari-server/resources/jdk-8u77-linux-x64.tar.gzjdk-8u77-linux-x64.tar.gz... 100% (173.0 MB of 173.0 MB)Successfully downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-8u77-linux-x64.tar.gzInstalling JDK to /usr/jdk64/Successfully installed JDK to /usr/jdk64/Downloading JCE Policy archive from http://public-repo-1.hortonworks.com/ARTIFACTS/jce_policy-8.zip to /var/lib/ambari-server/resources/jce_policy-8.zipSuccessfully downloaded JCE Policy archive to /var/lib/ambari-server/resources/jce_policy-8.zipInstalling JCE policy...Completing setup...Configuring database...Enter advanced database configuration [y/n] (n)? yConfiguring 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): 3Hostname (ambari-server): ambari-serverPort (3306): Database name (ambari): Username (root): rootEnter Database Password (mysqladmin): Configuring ambari database...Copying JDBC drivers to server resources...Configuring remote database connection 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.sqlProceed with configuring remote database connection properties [y/n] (y)? yExtracting system views...............Adjusting ambari-server permissions and ownership...Ambari Server 'setup' completed successfully.#启动服务ambari-server start

c.浏览器文本界面安装
浏览器访问:http://172.20.2.222:8080 默认用户名密码admin/admin

启动安装向导

添加将要创建的集群名称

下载hdp版本

选择本地hdp源

添加写需要安装的各个目标节点的主机名,填写ambari-server免密钥登录其他节点的私钥,确认注册


选择需要安装的服务

选择安装软件所在的那个节点上

自定义服务路径或密码

Review

进行安装部署


添加服务

查看各组件的概况和配置

0