一、环境及软件准备

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

  1. 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。

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

5、复制下载文件

放到lnmp的默认目录下。

  1. mkdir /home/wwwroot/default/ambari
  2. mkdir /home/wwwroot/default/ambari/HDP-UTILS
  3. cd /home/wwwroot/default/ambari

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

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

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

  1. autoindex on; #开启nginx目录浏览功能
  2. autoindex_exact_size off; #文件大小从KB开始显示
  3. autoindex_localtime on;
 
image.png

6、配置本地源

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

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

hdp.list

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

hdp.gpl.list

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

更新list

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

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

  1. scp /etc/apt/sources.list.d/ambari.list 192.168.0.152:/etc/apt/sources.list.d/
  2. scp /etc/apt/sources.list.d/ambari.list 192.168.0.153:/etc/apt/sources.list.d/
  3. scp /etc/apt/sources.list.d/ambari.list 192.168.0.154:/etc/apt/sources.list.d/
  4. scp /etc/apt/sources.list.d/ambari.list 192.168.0.155:/etc/apt/sources.list.d/
  5. scp /etc/apt/sources.list.d/hdp.list 192.168.0.152:/etc/apt/sources.list.d/
  6. scp /etc/apt/sources.list.d/hdp.list 192.168.0.153:/etc/apt/sources.list.d/
  7. scp /etc/apt/sources.list.d/hdp.list 192.168.0.154:/etc/apt/sources.list.d/
  8. scp /etc/apt/sources.list.d/hdp.list 192.168.0.155:/etc/apt/sources.list.d/
  9. scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.152:/etc/apt/sources.list.d/
  10. scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.153:/etc/apt/sources.list.d/
  11. scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.154:/etc/apt/sources.list.d/
  12. scp /etc/apt/sources.list.d/hdp.gpl.list 192.168.0.155:/etc/apt/sources.list.d/

二、安装hdp集群

1、安装ambari &hadoop01

  1. sudo apt-get install ambari-server
  2. Success. You can now start the database server using:
  3. /usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile start
  4. Ver Cluster Port Status Owner Data directory Log file
  5. 10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
  6. 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
  7. Setting up postgresql (10+190) ...
  8. Setting up ambari-server (2.7.3.0-139) ...
  9. Processing triggers for systemd (237-3ubuntu10.9) ...
  10. Processing triggers for ureadahead (0.100.0-20) ...
  11. Processing triggers for libc-bin (2.27-3ubuntu1) ...

2、配置ambari

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

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

配置mysql

  1. Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
  2. Checking GPL software agreement...
  3. GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
  4. Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)?
  5. Completing setup...
  6. Configuring database...
  7. Enter advanced database configuration [y/n] (n)? y
  8. Configuring database...
  9. ==============================================================================
  10. Choose one of the following options:
  11. [1] - PostgreSQL (Embedded)
  12. [2] - Oracle
  13. [3] - MySQL / MariaDB
  14. [4] - PostgreSQL
  15. [5] - Microsoft SQL Server (Tech Preview)
  16. [6] - SQL Anywhere
  17. [7] - BDB
  18. ==============================================================================
  19. Enter choice (1): 3

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

  1. Configuring ambari database...
  2. Enter full path to custom jdbc driver:
  3. Configuring ambari database...
  4. Enter full path to custom jdbc driver: /var/lib/ambari-server/resources/mysql-connector-java-5.1.47-bin.jar
  5. Copying /var/lib/ambari-server/resources/mysql-connector-java-5.1.47-bin.jar to /usr/share/java
  6. Configuring remote database connection properties...
  7. 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
  8. Proceed with configuring remote database connection properties [y/n] (y)?
  9. Extracting system views...
  10. ....ambari-admin-2.7.3.0.139.jar
  11. Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it...
  12. Adjusting ambari-server permissions and ownership...
  13. Ambari Server 'setup' completed successfully.

三、配置ambari

1、导入mysql库

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

2、启动ambari

  1. root@hadoop01:/home/wwwroot/default/ambari#
  2. sudo ambari-server start
  3. Using python /usr/bin/python
  4. Starting ambari-server
  5. Ambari Server running with administrator privileges.
  6. Organizing resource files at /var/lib/ambari-server/resources...
  7. Ambari database consistency check started...
  8. Server PID at: /var/run/ambari-server/ambari-server.pid
  9. Server out at: /var/log/ambari-server/ambari-server.out
  10. Server log at: /var/log/ambari-server/ambari-server.log
  11. Waiting for server start..................................................
  12. Server started listening on 8080
  13. DB configs consistency check: no errors and warnings were found.
  14. 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
 

Ambari2.7.3 和HDP3.1.0搭建Hadoop集群的更多相关文章

  1. 使用Windows Azure的VM安装和配置CDH搭建Hadoop集群

    本文主要内容是使用Windows Azure的VIRTUAL MACHINES和NETWORKS服务安装CDH (Cloudera Distribution Including Apache Hado ...

  2. virtualbox 虚拟3台虚拟机搭建hadoop集群

    用了这么久的hadoop,只会使用streaming接口跑任务,各种调优还不熟练,自定义inputformat , outputformat, partitioner 还不会写,于是干脆从头开始,自己 ...

  3. 搭建Hadoop集群 (三)

    通过 搭建Hadoop集群 (二), 我们已经可以顺利运行自带的wordcount程序. 下面学习如何创建自己的Java应用, 放到Hadoop集群上运行, 并且可以通过debug来调试. 有多少种D ...

  4. 搭建Hadoop集群 (一)

    上面讲了如何搭建Hadoop的Standalone和Pseudo-Distributed Mode(搭建单节点Hadoop应用环境), 现在我们来搭建一个Fully-Distributed Mode的 ...

  5. 搭建Hadoop集群 (二)

    前面的步骤请看  搭建Hadoop集群 (一) 安装Hadoop 解压安装 登录master, 下载解压hadoop 2.6.2压缩包到/home/hm/文件夹. (也可以从主机拖拽或者psftp压缩 ...

  6. Hadoop入门进阶步步高(五)-搭建Hadoop集群

    五.搭建Hadoop集群 上面的步骤,确认了单机能够运行Hadoop的伪分布运行,真正的分布式运行无非也就是多几台slave机器而已,配置方面的有一点点差别,配置起来就很easy了. 1.准备三台se ...

  7. Linux 搭建Hadoop集群 成功

    内容基于(自己的真是操作步骤编写) Linux 搭建Hadoop集群---Jdk配置 Linux 搭建Hadoop集群 ---SSH免密登陆 一:下载安装 Hadoop 1.1:下载指定的Hadoop ...

  8. 阿里云搭建hadoop集群服务器,内网、外网访问问题(详解。。。)

    这个问题花费了我将近两天的时间,经过多次试错和尝试,现在想分享给大家来解决此问题避免大家入坑,以前都是在局域网上搭建的hadoop集群,并且是局域网访问的,没遇见此问题. 因为阿里云上搭建的hadoo ...

  9. 虚拟机搭建Hadoop集群

    安装包准备 操作系统:ubuntu-16.04.3-desktop-amd64.iso 软件包:VirtualBox 安装包:hadoop-3.0.0.tar.gz,jdk-8u161-linux-x ...

随机推荐

  1. SQL 优化经历

    一次非常有趣的 SQL 优化经历   阅读本文大概需要 6 分钟. 前言 在网上刷到一篇数据库优化的文章,自己也来研究一波. 场景 数据库版本:5.7.25 ,运行在虚拟机中. 课程表 #课程表 cr ...

  2. VUE2中使用mint-ui,日期选择picker

    首先页面引入需要使用的组件 import { DatetimePicker,Toast,Popup,Picker } from 'mint-ui'; methods部分 openPicker () { ...

  3. jsp/servlet环境搭建

    手动配置servlet开发环境: 1. eclipse.tomcat.jdk下载安装: 2. eclipse新建项目,项目依赖tomcat的jar包(包含tomcat和servlet相关jar包)以及 ...

  4. python魔法方法

    1.__call__ 实现__call__后,该类的对象可以被调用 举例如: class test_call_: def __init__(self, n): self.n = n def __cal ...

  5. C#通过代码判断并注册程序集到GAC

    var dllName = "EasyHook.dll"; var dllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirec ...

  6. VS2015 使用 Visual Studio Emulator For Android 调试无法命中断点的解决办法?

    源解决方案是英文版的,地址:https://dzone.com/articles/fix-for-could-not-connect-to-the-debugger-while-de 问题现象: 1. ...

  7. django admin 支持时间更改

    from django.db import models import django.utils.timezone as timezone class Doc(models.Model): add_d ...

  8. Windows下struct和union字节对齐设置以及大小的确定(一 简介和结构体大小的确定)

    在windows下设置字节对齐大小的方式,目前我了解有三种: 1. 在编译程序时候的编译选项  /Zp[n],如 cl /Zp4 表示对齐大小是4字节: 2. 预处理命令   #pragma pack ...

  9. Linux 判断进程是否运行

    问题 linux平台 多人开发服务器,有时自己运行一个进程在服务器上,但未知原因导致停止运行了,需要添加一个定时任务,用于监控指定进程是否运行 方法 一个通用的方法,以便使用在不同项目中. 思路:定时 ...

  10. C# 调用打印机 打印 Excel

    打印 Excel 模板 大体思路,通过NPOI操作Excel文件,通过Spire将Excel转成图片,将图片传给系统打印. Spire是收费工具,在微软库中下载Free版本. #region 打印所用 ...