一,搭建环境及版本

1.1操作系统:centos7

http://mirrors.huaweicloud.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-2003.iso

1.2数据库:mysql5.7

 https://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm

1.3 ambari: 2.7.3.0

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

1.4 hdp:3.1.0.0

http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/HDP-3.1.0.0-centos7-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.0.0/hdp.repo
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz

二,配置虚拟机环境

主机名角色
hdp001ambari-server
hdp002ambari-agent
hdp003ambari-agent

2.1 配置网络

三台服务器

systemctl stop NetworkManager
systemctl disableNetworkManager

修改/etc/sysconfig/network-scripts/ifcfg-ens33 网卡文件
在这里插入图片描述重启网络

systemctl restart network

2.2 关闭防火墙

三台服务器

systemctl disable firewalld
systemctl stop firewalld

2.3 关闭selinux

目标服务器:hdp001,hdp002,hdp003。
修改 /etc/selinux/config。
SELINUX=disabled

2.4 配置免密ssh,域名,hostname,ulimit

2.4.1修改/etc/hosts文件

目标服务器:hdp001,hdp002,hdp003。
在这里插入图片描述

2.4.2 修改主机名。

目标服务器:hdp001,hdp002,hdp003。
vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=<fully.qualified.domain.name>     #hdp00[1-3].edu.org

vi /etc/hostname
删掉localhost.localdomain 添加主机名
<fully.qualified.domain.name>

2.4.3 修改ulimit。

目标服务器:hdp001,hdp002,hdp003。
修改 /etc/security/limits.conf
添加:

* soft nofile 10000
* hard nofile 10000

2.4.4 配置主节点到从节点的免密登录

目标服务器:hdp001。

ssh-keygen   #一路回车
ssh-copy-id root@hdp001
ssh-copy-id root@hdp002
ssh-copy-id root@hdp003

重启服务器似上面一系列服务生效

reboot

三,安装ntp 时间同步服务

目标服务器:hdp001,hdp002,hdp003。

yum install -y ntp
systemctl enable ntpd
systemctl start ntpd

四,安装配置mysql5.7

4.1 安装

目标服务器:hdp001。
不要安装高版本的mysql,官网说不支持。

#下载
wget https://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
#添加本地repo
rpm -ivh mysql57-community-release-el7-10.noarch.rpm
#安装
yum check-update
yum update
yum install mysql mysql-server -y

#启动msyql
systemctl start mysqld
systemctl enable mysqld

#获取自动生成的临时密码
grep 'temporary password' /var/log/mysqld.log
#登录
mysql -u root -p
#修改密码并授权
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root@2020';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '密码' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
FLUSH PRIVILEGES;

4.2 下载 mysql-connector

目标服务器:hdp001,hdp002,hdp003。
下载mysql-connector-java.jar 上传到/usr/share/java。
地址:https://dev.mysql.com/downloads/connector/j/5.1.html

ln -s /usr/share/java/mysql-connector-java-5.1.49.jar /usr/share/java/mysql-connector-java.jar

五,安装java

目标服务器:hdp001,hdp002,hdp003。
选择的是openjdk的开发版。

yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel

六,制作本地 repository

6.1安装httpd

目标服务器:hdp001,hdp002,hdp003

yum install httpd -y

6.2准备安装文件

6.2.1

目标服务器:hdp001

cd /var/www/html/
tar  -zxvf  ambari-2.7.3.0-centos7.tar.gz -C  /var/www/html/
tar -zxvf  HDP-3.1.0.0-centos7-rpm.tar.gz -C  /var/www/html/
tar -zxvf  HDP-UTILS-1.1.0.22-centos7.tar.gz -C  /var/www/html/

修改ambari.repo 文件
baseurl=http://hdp001.edu.org/ambari/centos7/2.7.3.0-139
gpgkey=http://hdp001.edu.org/ambari/centos7/2.7.3.0-139/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

cp ambari.repo  /etc/yum.repos.d/ambari.repo

修改hdp.repo 文件

[root@hdp001 hive]# more /etc/yum.repos.d/hdp.repo 
#VERSION_NUMBER=3.1.0.0-78
[HDP-3.1.0.0]
name=HDP Version - HDP-3.1.0.0
baseurl=http://hdp001.edu.org/HDP/centos7/3.1.0.0-78
gpgcheck=1
gpgkey=http://hdp001.edu.org/HDP/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://hdp001.edu.org/HDP-UTILS/centos7/1.1.0.22
gpgcheck=1
gpgkey=http:/hdp001.edu.org/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

cp hdp.repo /etc/yum.repos.d/

拷贝repo文件到hdp002,hdp003.

scp /etc/yum.repos.d/ambari.repo hdp002:/etc/yum.repos.d/
scp /etc/yum.repos.d/hdp.repo hdp002:/etc/yum.repos.d/
scp /etc/yum.repos.d/ambari.repo hdp003:/etc/yum.repos.d/
scp /etc/yum.repos.d/hdp.repo hdp003:/etc/yum.repos.d/

6.2.2 启动httpd

目标服务器:hdp001,hdp002,hdp003。

systemctl start httpd

6.3 安装配置ambari-server

目标服务器:hdp001

#安装ambari-server
yum install ambari-server -y
#初始化ambari-server
ambari-server setup

配置jdk:
在这里插入图片描述配置mysql:
在这里插入图片描述登录mysql执行:

CREATE DATABASE ambari  CHARACTER SET utf8;
use ambari ;
source  /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

CREATE USER 'ambari'@'localhost' IDENTIFIED BY '上面输入的密码';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%' IDENTIFIED BY '上面输入的密码';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost' IDENTIFIED BY '上面输入的密码' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%' IDENTIFIED BY '上面输入的密码' WITH GRANT OPTION;
FLUSH PRIVILEGES;
启动ambari-server
ambari-server start

七 通过界面安装hdp

地址

http://hdp001:8080

在这里插入图片描述
在这里插入图片描述私钥文件为hdp001.edu.org 节点的 ~root/.ssh/id_rs 文件。

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

在这里插入图片描述
很多服务都需要创建库,和用户

CREATE DATABASE hive CHARACTER SET utf8;
CREATE USER 'hive'@'localhost' IDENTIFIED BY 'Hive@2020';
ALTER USER 'hive'@'localhost' IDENTIFIED BY 'Hive@2020';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'Hive@2020';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost' IDENTIFIED BY 'Hive@2020' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'Hive@2020' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐