Ambari2.7.3 和HDP3.1.0搭建Hadoop集群

Stella981
• 阅读 773

一、环境及软件准备

1、集群规划

 

hdp01/10.1.1.11

hdp02/10.1.1.12

hdp03/10.1.1.13

hdp04/10.1.1.14

hdp05/10.1.1.15

ambari server

ambari agent

namenode

datanode

resourcemanager

journalnode

zookeeper

01和02主要做管理机,03-05做数据数据节点,01-03做zookeeper集群。
主机环境为Ubuntu server18.04,主机间已经建立互信。

2、下载ambari安装包

https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/ambari_repositories.html
找到对应的版本下载即可。

image.png

ps需要下载repo file,ambari.list

3、下载hdp安装包

https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/hdp_31_repositories.html

image.png

ps需要下载repo file,hdp.gpl.list,hdp.list.

4、安装一台lnmp备用

选择hadoop01

https://lnmp.org/install.html

wget -c http://soft.vpser.net/lnmp/lnmp1.5.tar.gz && tar zxf lnmp1.5.tar.gz && cd lnmp1.5 && ./install.sh lnmp

选择安装mysql5.7版本用于支持ambari
开启远程访问mysql。

 mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root'  ;
flush privileges; 

5、复制下载文件

放到lnmp的默认目录下。

mkdir /home/wwwroot/default/ambari
mkdir /home/wwwroot/default/ambari/HDP-UTILS
cd /home/wwwroot/default/ambari

复制下载文件到相关目录并解压。

tar -zxvf ambari-2.7.3.0-ubuntu18.tar.gz tar -zxvf HDP-GPL-3.1.0.0-ubuntu18-gpl.tar.gz tar -zxvf HDP-3.1.0.0-ubuntu18-deb.tar.gz tar -zxvf HDP-UTILS-1.1.0.22-ubuntu18.tar.gz -C HDP-UTILS 

开启nginx目录浏览
nginx.conf http { }加入

        autoindex on;   #开启nginx目录浏览功能

        autoindex_exact_size off;   #文件大小从KB开始显示

        autoindex_localtime on;   

image.png

6、配置本地源

cd /etc/apt/sources.list.d
ambari.list

#VERSION_NUMBER=2.7.3.0-139
#json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
deb http://192.168.0.151/ambari/ambari/ubuntu18/2.7.3.0-139/ Ambari main 

hdp.list

#VERSION_NUMBER=3.1.0.0-78
deb http://192.168.0.151/ambari/HDP/ubuntu18/3.1.0.0-78/ HDP main deb http://192.168.0.151/ambari/HDP-UTILS/HDP-UTILS/ubuntu18/1.1.0.22/ HDP-UTILS main 

hdp.gpl.list

#VERSION_NUMBER=3.1.0.0-78
deb http://192.168.0.151/ambari/HDP-GPL/ubuntu18/3.1.0.0-78/ HDP-GPL main 

更新list

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD sudo apt-get update apt-cache showpkg ambari-server apt-cache showpkg ambari-agent apt-cache showpkg ambari-metrics-assembly 

复制到各台主机,并在各台主机更新list。

scp /etc/apt/sources.list.d/ambari.list 192.168.0.152:/etc/apt/sources.list.d/
scp /etc/apt/sources.list.d/ambari.list 192.168.0.153:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/ambari.list 192.168.0.154:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/ambari.list 192.168.0.155:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.list 192.168.0.152:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.list 192.168.0.153:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.list 192.168.0.154:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.list 192.168.0.155:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.152:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.153:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.154:/etc/apt/sources.list.d/ scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.155:/etc/apt/sources.list.d/ 

二、安装hdp集群

1、安装ambari &hadoop01

sudo apt-get install ambari-server


Success. You can now start the database server using:

    /usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile start

Ver Cluster Port Status Owner    Data directory              Log file
10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log update-alternatives: using /usr/share/postgresql/10/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode Setting up postgresql (10+190) ... Setting up ambari-server (2.7.3.0-139) ... Processing triggers for systemd (237-3ubuntu10.9) ... Processing triggers for ureadahead (0.100.0-20) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... 

2、配置ambari

root@hadoop01:/home/wwwroot/default/ambari# sudo ambari-server setup
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
WARNING: Could not run /usr/sbin/sestatus: OK Customize user account for ambari-server daemon [y/n] (n)? y Enter user account for ambari-server daemon (root): Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Custom JDK ============================================================================== Enter choice (1): 

配置java路径即可
/usr/lib/jvm/java-8-openjdk-amd64

配置mysql

Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
Checking GPL software agreement...
GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? y Configuring 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 (1): 3 

配置jdbc,需要上传jdbc.bin.jar
路径如下。
/var/lib/ambari-server/resources/mysql-connector-java-5.1.47-bin.jar

Configuring ambari database...
Enter full path to custom jdbc driver: 
Configuring ambari database...
Enter full path to custom jdbc driver: /var/lib/ambari-server/resources/mysql-connector-java-5.1.47-bin.jar
Copying /var/lib/ambari-server/resources/mysql-connector-java-5.1.47-bin.jar to /usr/share/java Configuring remote database connection properties... WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql Proceed with configuring remote database connection properties [y/n] (y)? Extracting system views... ....ambari-admin-2.7.3.0.139.jar Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it... Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully. 

三、配置ambari

1、导入mysql库

mysql -u root -p
mysql> create database ambari;
mysql> use ambari;
mysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;

2、启动ambari

root@hadoop01:/home/wwwroot/default/ambari#
sudo ambari-server start
Using python  /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start.................................................. Server started listening on 8080 DB configs consistency check: no errors and warnings were found. Ambari Server 'start' completed successfully. 

四、安装hadoop集群

http://192.168.0.151:8080
用户名密码、admin/admin

image.png

image.png

image.png

选择本地库。
输入目录。
http://192.168.0.151/ambari/HDP/ubuntu18/3.1.0.0-78
http://192.168.0.151/ambari/HDP-UTILS/HDP-UTILS/ubuntu18/1.1.0.22/

image.png

cat ~/.ssh/id_rsa
获取ssh密钥。

image.png

image.png

其他主机出现错误,跟agent没安装上有关。
在其他主机执行
apt install ambari-agent -y

image.png

Ranger、Ranger KMS选了安装失败。取消可以成功。

image.png

image.png

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
5个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Stella981 Stella981
3年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
为什么mysql不推荐使用雪花ID作为主键
作者:毛辰飞背景在mysql中设计表的时候,mysql官方推荐不要使用uuid或者不连续不重复的雪花id(long形且唯一),而是推荐连续自增的主键id,官方的推荐是auto_increment,那么为什么不建议采用uuid,使用uuid究
Python进阶者 Python进阶者
11个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这