@zhangyy
2020-07-02T21:45:11.000000Z
字数 6702
阅读 147
大数据平台构建
- 一: 关于HDP的介绍
- 二: 系统环境介绍
- 三: 系统环境初始化
- 四: 安装HDP-2.6.4平台
- 五: 启用NameNode HA 与 YARN HA
HDP全称叫做Hortonworks Data Platform。
Hortonworks数据平台是一款基于Apache Hadoop的是开源数据平台,提供大数据云存储,大数据处理和分析等服务。该平台是专门用来应对多来源和多格式的数据,并使其处理起来能变成简单、更有成本效益。HDP还提供了一个开放,稳定和高度可扩展的平台,使得更容易地集成Apache Hadoop的数据流业务与现有的数据架构。该平台包括各种的Apache Hadoop项目以及Hadoop分布式文件系统(HDFS)、MapReduce、Pig、Hive、HBase、Zookeeper和其他各种组件,使Hadoop的平台更易于管理,更加具有开放性以及可扩展性。
官网地址为:http://zh.hortonworks.com/
系统: RHEL7.5 X64
---
172.17.100.11 ZY-001.flyfish
172.17.100.12 ZY-002.flyfish
172.17.100.13 ZY-003.flyfish
---
1.集群服务器配置,包括安装操作系统、关闭防火墙、同步服务器时钟等;
2.外部数据库安装
3.安装Ambari管理器;
4.安装HDP集群;
5.集群完整性检查,包括 HDFS 文件系统、MapReduce、Hive 等是否可以正常运行。
做root用户无密钥认证
ssh-keygen ---一直敲回车到最后
cat id_rsa.pub >> authorized_keys
将所有的公钥导入authorized_keys 分发到 所有的 机器的.ssh/ 下面
然后测试
yum install -y firewall* iptable*
(1) 关闭firewalld
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
(2) 关闭iptables
iptables -F
systemctl stop iptables.service
service iptables save
systemctl disable iptables.service
(3) 禁用 selinux
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
setenforce 0
getenforce 0
sestatus
重启机器
reboot
vim /etc/security/limits.conf
---
* soft nofile 65535
* hard nofile 1029345
* soft nproc unlimited
* hard nproc unlimited
* soft memlock unlimited
* hard memlock unlimited
---
所有机器 yum install chrony*
1. ZY-001.flyfish:
vim /etc/chrony.conf 增加
----
注释掉相关默认的server
server ntp1.aliyun.com iburst
allow 172.17.100.0.0/16
service chronyd start
chkconfig chronyd on
2. ZY-002.flyfish---ZY-003.flyfish 同步node-01.flyfish
vim /etc/chrony.conf
----
注释掉默认的server
server 172.17.100.21 iburst
----
service chronyd stop
service chronyd start
chkconfig chronyd on
ambari-2.6.1.5-centos7.tar.gz
下载地址:
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz
HDP-2.6.4.0-centos7-rpm.tar.gz
下载地址:
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.4.0-centos7-rpm.tar.gz
HDP-UTILS-1.1.0.22-centos7.tar.gz
下载地址:
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
关于 ambari-2.6.1的docs
https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-installation/content/hdp_26_repositories.html
tar -zxvf jdk-8u162-linux-x64.tar.gz
mkdir /training
mv jdk1.8.0_162 /training
cd /training
ln -s jdk1.8.0_162 jdk
vim /etc/profile
---
export JAVA_HOME=/training/jdk
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
---
source /etc/profile
java -version
安装httpd
yum install -y httpd
service httpd start
chkconfig httpd on
cd /var/www/html/
mkdir ambari
1. ambari 的 yum源
cd /root/hdp
tar -zxvf ambari-2.6.1.5-centos7.tar.gz
mv /root/hdp/ambari /var/www/html/ambari
cd /var/www/html/ambari/ambari/centos7/2.6.1.5-3
cp -p ambari.repo /etc/yum.repos.d/
cd /etc/yum.repos.d
vim ambari.repo
----
#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://172.17.100.21/ambari/ambari/centos7/2.6.1.5-3
gpgcheck=1
gpgkey=http://172.17.100.21/ambari/ambari/centos7/2.6.1.5-3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
----
cd /root/hdp
tar -zxvf HDP-2.6.4.0-centos7-rpm.tar.gz
mv HDP /var/www/html/ambari
cd /var/www/html/ambari/HDP/centos7/2.6.4.0-91/
cp -p hdp.repo /etc/yum.repos.d/
cd /root/hdp
mkdir HDP-UTILS
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C HDP-UTILS
mv HDP-UTILS /var/www/html/ambari/
cd /etc/yum.repos.d/
vim hdp.repo
---
#VERSION_NUMBER=2.6.4.0-91
[HDP-2.6.4.0]
name=HDP Version - HDP-2.6.4.0
baseurl=http://172.17.100.21/ambari/HDP/centos7/2.6.4.0-91/
gpgcheck=1
gpgkey=http://172.17.100.21/ambari/HDP/centos7/2.6.4.0-91/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://172.17.100.21/ambari/HDP-UTILS/
gpgcheck=1
gpgkey=http://172.17.100.21/ambari/HDP-UTILS/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
---
tar -zxvf HDP-GPL-2.6.4.0-centos7-rpm.tar.gz
mv HDP-GPL /var/www/html/ambari
cd /var/www/html/ambari/HDP-GPL/
mv hdp-gpl.repo /etc/yum.repos.d/
cd /etc/yum.repos.d/
vim hdp-gpl.repo
---
#VERSION_NUMBER=2.6.4.0-91
[HDP-GPL-2.6.4.0]
name=HDP-GPL Version - HDP-GPL-2.6.4.0
baseurl=http://172.17.100.21/ambari/HDP-GPL/centos7/2.6.4.0-91/
gpgcheck=1
gpgkey=http://172.17.100.21/ambari/HDP-GPL/centos7/2.6.4.0-91/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
---
cd /etc/yum.repos.d/
scp ambari.repo hdp.repo hdp-gpl.repo zy-002.flyfish:/etc/yum.repos.d/
scp ambari.repo hdp.repo hdp-gpl.repo zy-003.flyfish:/etc/yum.repos.d/
yum clean all
yum makecache
yum install -y mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
mysql -uroot -pflyfish225.com
ambari 数据库:
create database ambari character set utf8 ;
CREATE USER 'ambari'@'%'IDENTIFIED BY 'Ambari-123';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;
hive 数据库:
create database hive character set utf8 ;
CREATE USER 'hive'@'%'IDENTIFIED BY 'Hive-123';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
FLUSH PRIVILEGES;
oozie 数据库:
create database oozie character set utf8 ;
CREATE USER 'oozie'@'%'IDENTIFIED BY 'Oozie-123';
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
FLUSH PRIVILEGES;
拷贝jdbc 到 java的目录
tar -zxvf mysql-connector-java-5.1.44.tar.gz
cd mysql-connector-java-5.1.44
cp mysql-connector-java-5.1.44-bin.jar /usr/share/java/
cd /usr/share/java/
mv mysql-connector-java-5.1.44-bin.jar mysql-connector-java.jar
chmod 777 mysql-connector-java.jar
yum install -y ambari-server
vim /etc/ambari-server/conf/ambari.properties
----
增加:
server.jdbc.driver.path=/usr/share/java/mysql-connector-java.jar
---
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
ambari-server setup
mysql -uroot -pflyfish225.com
use ambari
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
ambari-server start
http://172.17.100.21:8080
用户名:admin
密码: admin
这里需要注意,主机注册成功后会对主机进行前置检查,如果有警告,需要进行检查并按要求进行相应的修改。
报错:
请求 libtirpc-lib
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libtirpc-0.2.4-0.10.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libtirpc-devel-0.2.4-0.10.el7.x86_64.rpm
rpm -ivh libtirpc-*
Retry
可以在安装前面的步骤,增加其它组件,hive/oozie/pig/sqoop/hbase/spark/zeppelin
su - hdfs
hdfs dfs -mkdir /input
vim wc.input
----
zhangyy hadoop
hadoop spark
yarn spark
----
hdfs dfs -put wc.input /input
hadoop jar /usr/hdp/2.6.4.0-91/hadoop-mapreduce/hadoop-mapreduce-examples.jar wordcount /input/ /output
hdfs dfs -get /output
先停掉hbase
sudo su hdfs -l -c 'hdfs dfsadmin -safemode enter'
sudo su hdfs -l -c 'hdfs dfsadmin -saveNamespace'
sudo su hdfs -l -c 'hdfs namenode -initializeSharedEdits'
ZY-001.flyfish:
sudo su hdfs -l -c 'hdfs zkfc -formatZK'
ZY-002.flyfish
sudo su hdfs -l -c 'hdfs namenode -bootstrapStandby'