手把手教你通过Ambari新建Hadoop集群图解案例

                                              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

  登陆系统之后,会看到Ambari空空如也的欢迎界面,接下来我们就需要介绍如何通过Ambari新建Hadoop集群。关于如何部署Ambari是很简单的,我这里就不啰嗦了,感兴趣的小伙伴可以参考我之前的笔记:离线方式部署Ambari2.6.0.0

1>.登陆Ambari的界面

2>.点击“Launc Install Wizard”按钮进入新建集群向导

3>.自定义集群名称

4>.使用本地的yum仓库(需要选择“Use Local Repository”,我这里默认就使用的这个选项。) 

5>.在redhat7按照上图输入本地源的路径后,点击下一步

6>.将私钥上传到Ambari到管理控制台上(这个步骤应该是你在部署Ambari服务到时候就已经生成过私钥啦!)

7>.注册服务器时拍错处理(附有解决问题的详细过程)

    下图正在安装软件:

  注册服务器,如下图:

  在上面的那个过程如果你卡顿的时间比较长的话,估计会失败,如下图:

  查看错误日志,如下图:

  根据上面的报错信息,大家都知道是没有这个目录,才会报这个错误。可能是Ambari公司的开发人员在对这个目录进行判断时逻辑出现问题了,如果这个目录不存在他们并没有自动创建,

解决方案:  

  因此我们需要登陆对应的服务器手动将这个目录创建出来即可。

  我们看报错一定要看全,我们需要把进度条往下拉,看是否还有其他的报错,你会发现有以下报错:

  如上图所示,报错“SSLError: Failed to connect. Please check openssl library versions. ”,根据报错提示,说是我的openssl的版本有问题。百度一下原因,说有可能是openssl版本不匹配,因为python 2.7.5有的版本(或更高版本)增加了certificate verification,正是因为这个特性导致ambari-agent无法连接server。(呵呵~是不是感觉跟没说一样!)

解决步骤

  既然他说我的版本有问题,那我就先看卡自己的openssl到底是啥版本

[root@node101 ~]# rpm -qa | grep openssl
openssl-libs-1.0.2k-.el7.x86_64
openssl-1.0.2k-.el7.x86_64
[root@node101 ~]#

  好,接下里,咱们就说干就干,开始升级版本:

[root@node101 ~]# yum update openssl            
Loaded plugins: fastestmirror, priorities
ambari-2.6.0.0 | 2.9 kB ::
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
packages excluded due to repository priority protections
No packages marked for update
[root@node101 ~]#

  根据上面的提示,说没有可以更新的安装包对于我服务器而言,因此我得像个方法,让他可以支持更新,那就得重新更换yum源了。

[root@node101 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.`date +%F`         #先备份一份yum源
[root@node101 ~]#
[root@node101 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
---- ::-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 42.81.12.221, 42.81.12.217, 42.81.12.218, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|42.81.12.221|:... connected.
HTTP request sent, awaiting response... OK
Length: (.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’ %[===========================================================================>] , --.-K/s in .001s -- :: (2.68 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [/] [root@node101 ~]#

[root@node101 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo            #下载阿里的yum源,别忘记提前备份一份哟!

[root@node101 ~]# yum clean all
Loaded plugins: fastestmirror, priorities
Cleaning repos: HDP-2.6.3.0 HDP-UTILS-1.1.0.21 ambari-2.6.0.0 base extras updates
Cleaning up list of fastest mirrors
[root@node101 ~]#

[root@node101 ~]# yum clean all                                                        #清除缓存

[root@node101 ~]# yum makecache
Loaded plugins: fastestmirror, priorities
HDP-2.6.3.0 | 2.9 kB ::
HDP-UTILS-1.1.0.21 | 2.9 kB ::
ambari-2.6.0.0 | 2.9 kB ::
base | 3.6 kB ::
extras | 3.4 kB ::
updates | 3.4 kB ::
(/): HDP-2.6.3.0/filelists_db | kB ::
(/): HDP-2.6.3.0/primary_db | kB ::
(/): HDP-2.6.3.0/other_db | kB ::
(/): HDP-UTILS-1.1.0.21/filelists_db | kB ::
(/): HDP-UTILS-1.1.0.21/other_db | kB ::
(/): HDP-UTILS-1.1.0.21/primary_db | kB ::
(/): ambari-2.6.0.0/filelists_db | kB ::
(/): ambari-2.6.0.0/other_db | 1.3 kB ::
(/): ambari-2.6.0.0/primary_db | 8.6 kB ::
(/): base//x86_64/group_gz | kB ::
(/): base//x86_64/filelists_db | 7.1 MB ::
(/): extras//x86_64/prestodelta | kB ::
(/): extras//x86_64/filelists_db | kB ::
(/): extras//x86_64/other_db | kB ::
(/): updates//x86_64/prestodelta | kB ::
(/): updates//x86_64/filelists_db | 1.3 MB ::
(/): extras//x86_64/primary_db | kB ::
(/): updates//x86_64/other_db | kB ::
(/): updates//x86_64/primary_db | 1.3 MB ::
(/): base//x86_64/other_db | 2.6 MB ::
(/): base//x86_64/primary_db | 6.0 MB ::
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Metadata Cache Created
[root@node101 ~]#

[root@node101 ~]# yum makecache                                                        #创建缓存

[root@node101 ~]# yum -y update
......(内容太多了我就懒得复制了~) libdrm.x86_64 :2.4.-.el7
libffi.x86_64 :3.0.-.el7
libgcc.x86_64 :4.8.-.el7
libgcrypt.x86_64 :1.5.-.el7
libgomp.x86_64 :4.8.-.el7
libgudev1.x86_64 :-.el7
libmount.x86_64 :2.23.-.el7
libndp.x86_64 :1.2-.el7
libnetfilter_conntrack.x86_64 :1.0.-.el7_3
libnl3.x86_64 :3.2.-.el7
libpcap.x86_64 :1.5.-.el7
libpciaccess.x86_64 :0.14-.el7
libproxy.x86_64 :0.4.-.el7
libpwquality.x86_64 :1.2.-.el7
libselinux.x86_64 :2.5-14.1.el7
libselinux-python.x86_64 :2.5-14.1.el7
libselinux-utils.x86_64 :2.5-14.1.el7
libsemanage.x86_64 :2.5-.el7
libsepol.x86_64 :2.5-.el7
libsoup.x86_64 :2.62.-.el7
libss.x86_64 :1.42.-.el7
libssh2.x86_64 :1.4.-.el7
libstdc++.x86_64 :4.8.-.el7
libtasn1.x86_64 :4.10-.el7
libuser.x86_64 :0.60-.el7
libuuid.x86_64 :2.23.-.el7
linux-firmware.noarch :-.git85c5d90.el7
logrotate.x86_64 :3.8.-.el7
lsscsi.x86_64 :0.27-.el7
lua.x86_64 :5.1.-.el7
lvm2.x86_64 :2.02.-.el7_6.
lvm2-libs.x86_64 :2.02.-.el7_6.
make.x86_64 :3.82-.el7
man-db.x86_64 :2.6.-.el7
mariadb-libs.x86_64 :5.5.-.el7_5
microcode_ctl.x86_64 :2.1-.el7
mozjs17.x86_64 :17.0.-.el7
ncurses.x86_64 :5.9-14.20130511.el7_4
ncurses-base.noarch :5.9-14.20130511.el7_4
ncurses-libs.x86_64 :5.9-14.20130511.el7_4
net-tools.x86_64 :2.0-0.24.20131004git.el7
nettle.x86_64 :2.7.-.el7
nspr.x86_64 :4.19.-.el7_5
nss.x86_64 :3.36.-.el7_5
nss-softokn.x86_64 :3.36.-.el7_5
nss-softokn-freebl.x86_64 :3.36.-.el7_5
nss-sysinit.x86_64 :3.36.-.el7_5
nss-tools.x86_64 :3.36.-.el7_5
nss-util.x86_64 :3.36.-.el7_5
numactl-libs.x86_64 :2.0.-.el7
openldap.x86_64 :2.4.-.el7
openssh.x86_64 :.4p1-.el7
openssh-clients.x86_64 :.4p1-.el7
openssh-server.x86_64 :.4p1-.el7
os-prober.x86_64 :1.58-.el7
p11-kit.x86_64 :0.23.-.el7
p11-kit-trust.x86_64 :0.23.-.el7
pam.x86_64 :1.1.-.el7
parted.x86_64 :3.1-.el7
pciutils-libs.x86_64 :3.5.-.el7
pcre.x86_64 :8.32-.el7
perl.x86_64 :5.16.-.el7
perl-Pod-Escapes.noarch :1.04-.el7
perl-libs.x86_64 :5.16.-.el7
perl-macros.x86_64 :5.16.-.el7
pinentry.x86_64 :0.8.-.el7
plymouth.x86_64 :0.8.-0.31..el7.centos
plymouth-core-libs.x86_64 :0.8.-0.31..el7.centos
plymouth-scripts.x86_64 :0.8.-0.31..el7.centos
policycoreutils.x86_64 :2.5-.el7
polkit.x86_64 :0.112-.el7
postfix.x86_64 :2.10.-.el7
procps-ng.x86_64 :3.3.-.el7
python.x86_64 :2.7.-.el7
python-libs.x86_64 :2.7.-.el7
python-perf.x86_64 :3.10.-957.1..el7
python-pycurl.x86_64 :7.19.-.el7
python-pyudev.noarch :0.15-.el7
python-slip.noarch :0.4.-.el7
python-slip-dbus.noarch :0.4.-.el7
readline.x86_64 :6.2-.el7
rsyslog.x86_64 :8.24.-.el7
selinux-policy.noarch :3.13.-.el7_6.
selinux-policy-targeted.noarch :3.13.-.el7_6.
setup.noarch :2.8.-.el7
shadow-utils.x86_64 :4.1.5.1-.el7
shared-mime-info.x86_64 :1.8-.el7
sudo.x86_64 :1.8.-.el7
systemd.x86_64 :-.el7
systemd-libs.x86_64 :-.el7
systemd-sysv.x86_64 :-.el7
tar.x86_64 :1.26-.el7
trousers.x86_64 :0.3.-.el7
tuned.noarch :2.10.-.el7
tzdata.noarch :2018g-.el7
util-linux.x86_64 :2.23.-.el7
vim-minimal.x86_64 :7.4.-.el7
virt-what.x86_64 :1.18-.el7
wpa_supplicant.x86_64 :2.6-.el7
xfsprogs.x86_64 :4.5.-.el7
xz.x86_64 :5.2.-.el7
xz-libs.x86_64 :5.2.-.el7
yum-plugin-fastestmirror.noarch :1.1.-.el7
zlib.x86_64 :1.2.-.el7 Replaced:
NetworkManager.x86_64 :1.0.-.el7 grub2.x86_64 :2.02-0.29.el7.centos
grub2-tools.x86_64 :2.02-0.29.el7.centos pygobject3-base.x86_64 :3.14.-.el7 Complete!
[root@node101 ~]#

[root@node101 ~]# yum -y update                                                        #更新yum源

[root@node101 ~]# yum update openssl
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
packages excluded due to repository priority protections
No packages marked for update
[root@node101 ~]#

[root@node101 ~]# yum update openssl                                                     #更新yum源后,发现并没有最新版本的opennssl

  问题依旧还是僵持着,参考社区版本链接:https://community.hortonworks.com/questions/145/openssl-error-upon-host-registration.html

    修改/etc/python/cert-verification.cfg配置文件

[root@node101 ~]# cat /etc/python/cert-verification.cfg
# Possible values are:
# 'enable' to ensure HTTPS certificate verification is enabled by default
# 'disable' to ensure HTTPS certificate verification is disabled by default
# 'platform_default' to delegate the decision to the redistributor providing this particular Python version # For more info refer to https://www.python.org/dev/peps/pep-0493/
[https]
#verify=platform_default          #这是我操作系统默认的设置,我将它的值改为“disable”,建议复制一行进行修改,这样你知道上修改前的属性值是多少,便于你恢复。
verify=disable
[root@node101 ~]#

  修改/etc/ambari-agent/conf/ambari-agent.ini,在[security]添加下面内容:

[root@node101 ~]# cat /etc/ambari-agent/conf/ambari-agent.ini
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific [server]
hostname=node101.yinzhengjie.org.cn
url_port=
secured_url_port=
connect_retry_delay=
max_reconnect_retry_delay= [agent]
logdir=/var/log/ambari-agent
piddir=/var/run/ambari-agent
prefix=/var/lib/ambari-agent/data
;loglevel=(DEBUG/INFO)
loglevel=INFO
data_cleanup_interval=
data_cleanup_max_age=
data_cleanup_max_size_MB =
ping_port=
cache_dir=/var/lib/ambari-agent/cache
tolerate_download_failures=true
run_as_user=root
parallel_execution=
alert_grace_period=
status_command_timeout=
alert_kinit_timeout=
system_resource_overrides=/etc/resource_overrides
; memory_threshold_soft_mb=
; memory_threshold_hard_mb=
; ignore_mount_points=/mnt/custom1,/mnt/custom2 [security]
keysdir=/var/lib/ambari-agent/keys
server_crt=ca.crt
passphrase_env_var_name=AMBARI_PASSPHRASE
ssl_verify_cert=
credential_lib_dir=/var/lib/ambari-agent/cred/lib
credential_conf_dir=/var/lib/ambari-agent/cred/conf
credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell force_https_protocol=PROTOCOL_TLSv1_2 #没错,我修改的就是它! [network]
; this option apply only for Agent communication
use_system_proxy_settings=true [services]
pidLookupPath=/var/run/ [heartbeat]
state_interval_seconds=
dirs=/etc/hadoop,/etc/hadoop/conf,/etc/hbase,/etc/hcatalog,/etc/hive,/etc/oozie,
/etc/sqoop,
/var/run/hadoop,/var/run/zookeeper,/var/run/hbase,/var/run/templeton,/var/run/oozie,
/var/log/hadoop,/var/log/zookeeper,/var/log/hbase,/var/run/templeton,/var/log/hive
; - unlimited
log_lines_count=
idle_interval_min=
idle_interval_max= [logging]
syslog_enabled=
[root@node101 ~]#

[root@node101 ~]# cat /etc/ambari-agent/conf/ambari-agent.ini

  修改上述的配置文件后,我们需要重启重启ambari-agent 服务:

[root@node101 ~]# xrsync.sh /etc/ambari-agent/conf/ambari-agent.ini
=========== node102.yinzhengjie.org.cn : /etc/ambari-agent/conf/ambari-agent.ini ===========
命令执行成功
=========== node103.yinzhengjie.org.cn : /etc/ambari-agent/conf/ambari-agent.ini ===========
命令执行成功
[root@node101 ~]#

[root@node101 ~]# xrsync.sh /etc/ambari-agent/conf/ambari-agent.ini          #将修改的配置信息同步到其他2个节点上去。如果没有同步配置文件,有可能你只有修改的那台服务器是正常的

[root@node101 ~]# ambari-agent restart
Restarting ambari-agent
Verifying Python version compatibility...
Using python /usr/bin/python
Found ambari-agent PID:
Stopping ambari-agent
Removing PID file at /run/ambari-agent/ambari-agent.pid
ambari-agent successfully stopped
Verifying Python version compatibility...
Using python /usr/bin/python
Checking for previously running Ambari Agent...
Checking ambari-common dir...
Starting ambari-agent
Verifying ambari-agent process status...
Ambari Agent successfully started
Agent PID at: /run/ambari-agent/ambari-agent.pid
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log
[root@node101 ~]#

[root@node101 ~]# ambari-agent restart                            #修改文件需要重启服务。

  Duang~,你会发现服务器注册成功啦~问题得到解决:(看来HDP社区版的论坛的确是有不少大佬啊~哈哈哈)

8>.进入服务选择页面,自定义需要安装的服务

9>.自定义需要安装的服务后,点击下一步

10>.分配主控服务,分配完毕后点击下一步

11>.分配子服务和客户端

12>.配置NameNode和DataNode在服务器上的存储路径

  输入Grafana Admin的密码,如下图:

  点击途中的有警告的按钮,咱们依然还需要输入一个密码,如下图:

13>.查看安装预览页面,显示了安装组件的概览信息(如果你察觉到哪里配置的不合理可以点击“back”返回去修改),如无异常,点击“Deploy”

14>.等待组件安装过程

15>.安装完毕,点击下一步

16>.安装完毕后,点击“Complete”,进入主界面

17>.进入Ambari的主界面

  

手把手教你通过Ambari新建Hadoop集群图解案例的更多相关文章

  1. 通过ambari安装hadoop集群,ZT

    通过ambari安装hadoop集群,ZT http://www.cnblogs.com/cenyuhai/p/3295635.html http://www.cnblogs.com/cenyuhai ...

  2. AMBARI部署HADOOP集群(4)

    通过 Ambari 部署 hadoop 集群 1. 打开 http://192.168.242.181:8080  登陆的用户名/密码是 : admin/admin 2. 点击 “LAUNCH INS ...

  3. ambari部署Hadoop集群(2)

    准备本地 repository 1. 下载下面的包 wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3 ...

  4. 使用Ambari部署hadoop集群

    准备工作 1. 设置sudo免密码登陆 由于CentOS安装之后,普通用户无sudo权限,故应该设置sudo权限. 参考文章:http://www.cnblogs.com/maybob/p/32988 ...

  5. 从零开始安装 Ambari (4) -- 通过 Ambari 部署 hadoop 集群

    1. 打开 http://192.168.242.181:8080  登陆的用户名/密码是 : admin/admin 2. 点击 “LAUNCH INSTALL WIZARD”,开始创建一个集群 3 ...

  6. 通过ambari安装hadoop集群(一)

    之前一直用的开源社区的版本,最近突然想到找一个好的商业版本用着,然后一直使用,然后就定上了hdp和cdh,都装上去了,但是cdh使用难度太大了,和开源版本的差距比较大,api不会使用,需要学它的cdk ...

  7. 通过ambari安装hadoop集群

    转载:http://www.cnblogs.com/cenyuhai/p/3295635.html 整个过程走完,问题不大,不过有一个事情要注意的是就算创建数据库的,使用localhost会报错,要使 ...

  8. ambari部署Hadoop集群(1)

    本例使用hortonworks 提供了 ambari 的安装方法,而且还很详细.以下是在 centos7 上的安装步骤. 基础配置: 1. 修改电脑的主机名 hostnamectl set-hostn ...

  9. 使用Ambari安装hadoop集群

    最近需要做些spark的工作,所以弄了几台dell7500就这么准备开始搭建集群,之前用过几台更破的台式机搭建过一次,折腾了半个月之久,终于成功搭建,这次不想走老路,所以网上查了一下,发现一个神器AM ...

随机推荐

  1. Luogu4389 付公主的背包(生成函数+多项式exp)

    显然构造出生成函数,对体积v的物品,生成函数为1+xv+x2v+……=1/(1-xv).将所有生成函数乘起来得到的多项式即为答案,设为F(x),即F(x)=1/∏(1-xvi).但这个多项式的项数是Σ ...

  2. verilog parameter 位宽问题

    前言 一直以为parameter 的位宽是无限的,其实不然. 流程: 仿真一下就知道啦: 用处: 精准控制位宽理论上会占用更少的内存,其他好像并没有什么卵用,注意不要越界,我这里系统默认32bit位宽 ...

  3. AMH 软件目录介绍

    AMH系统shell脚本目录:/root/amh系统所有shell脚本文件目录,不可删除. 网站运行工作根目录:/home/wwwroot面板程序与新建虚拟主机网站都存放于此目录. 其中:/home/ ...

  4. maven编译时出现There are test failures

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-tes ...

  5. Github Desktop 克隆新项目 Authentication failed. You may not have permission to access the repository or the repository may ha

    原来:ssh://git@github.com/xxx.git 改成:https://git@github.com/xxx.git

  6. 「UVA10766」Organising the Organisation(生成树计数)

    BUPT 2017 Summer Training (for 16) #6C 题意 n个点,完全图减去m条边,求生成树个数. 题解 注意可能会给重边. 然后就是生成树计数了. 代码 #include ...

  7. Hdoj 2044.一只小蜜蜂... 题解

    Problem Description 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行.请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数. 其中,蜂房的结构如下所示. Input 输入数据的第一 ...

  8. Hdoj 1007 Quoit Design 题解

    Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat rings ...

  9. LOJ#510 北校门外的回忆(找性质+倍增+线段树)

    这题一场模拟赛我们出了弱化版(n<=1e6),抄题面给的程序能拿到71分的好成绩 其实后面的29分是加了几个1e9的数据卡人 这糟老头子真是坏得很 正解我们机房看了三天 在这里感谢这篇题解的作者 ...

  10. Linux的wget命令详解【转载】

    Linux wget是一个下载文件的工具,它用在命令行下.对于Linux用户是必不可少的工具,尤其对于网络管理员,经常要下载一些软件或从远程服务器恢复备份到本地服务器.如果我们使用虚拟主机,处理这样的 ...