赞
踩
博主的生产环境使用的是Ambari2.6.0版本
自己研究选择的是相对较新的Ambari2.7.3版本
因此,Ambari安装及踩坑主要是围绕这两个版本进行
Ambari2.6.0版本安装可以参考该博客链接:
Ambari2.6.0+HDP2.6.3安装(离线)
博主亲测,按照博客内容逐步执行即可,所以不再单独给出自己的安装方案
仅仅指出该博客存在(或者可能存在)问题的部分
问题一: 该博客第二章系统环境配置修改/etc/hosts文件部分
# 原文配置/etc/hosts文件配置
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.12.101 master
192.168.12.102 slave1
192.168.12.103 slave2
192.168.12.104 slave3
注意:如上配置并不是FQDN(Fully Qualified Domain Name)完全合格域名/全称域名
安装Ambari时,需要设置FQDN,每个节点都要设置,因为Ambari-agent向Ambari-server发送心跳时,第一次要携带FQDN作为自己的标记。
而Ambari-server是通过FQDN识别每个Ambari-agent的;如果FQDN设置错误,Ambari-server与Ambari-agent将无法通信。
# FQDN配置
192.168.12.101 master.hadoop master
192.168.12.102 slave1.hadoop slave1
192.168.12.103 slave2.hadoop slave2
192.168.12.104 slave3.hadoop slave3
Confirm Hosts过程中hosts列表配置如下即可:
master.hadoop
slave1.hadoop
slave2.hadoop
slave3.hadoop
问题二:安装ambari-server部分 mysql安装wget命令使用
# 原文操作
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# 使用原文操作报错
ERROR: cannot verify dev.mysql.com's certificate, issued by ‘/C=CN/ST=Beijing/L=Beijing/O=Beijing SkyGuard Network Technology Co., Ltd/OU=SkyGuard Endpoint Team/CN=SkyGuard Endpoint Root CA’:
Unable to locally verify the issuer's authority.
To connect to dev.mysql.com insecurely, use `--no-check-certificate'.
# 正确操作 按照报错提示在命令后添加 --no-check-certificate
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm --no-check-certificate
问题三: 安装ambari-server部分 mysql安装yum命令使用
# 原文操作
yum install mysql-community-serve
注意:该命令是错误的,应该是博主复制的时候少复制了一个r
# 正确命令
yum install mysql-community-server
问题四:安装ambari-server部分 mysql安装 登录mysql,执行下面的语句部分
这里,有一条sql语句是错误的,如下:
select Host User Password from user where user='ambari';
该sql的含义应该是想查host,user,password这三个字段的值
正确写法:
# 列与列之间加个逗号即可
select Host,User,Password from user where user='ambari';
Ambari-2.7.3版本安装可以参考该博客链接:
Apache Ambari-2.7.3+Centos7离线安装
该博主相对严谨,对照安装即可
已加载插件:fastestmirror Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
没有可用软件包 ambari-server。
错误:无须任何处理
出现该问题,首先要检查"选择版本"步骤,BaseURL的配置
即检查如下两个文件里面的参数配置
/etc/yum.repos.d/HDP.repo
/etc/yum.repos.d/ambari.repo
如果配置无误,要确认离线下载包是否完整
博主当时出现这个问题是由于离线安装包有问题缺乏必要依赖导致的
这种情况下重新下载离线包,解压安装即可
界面显示如下:(卡在preparing阶段)
查看agent日志,发现如下报错:
tail -f /var/log/ambari-agent/ambari-agent.log
INFO 2020-03-03 14:43:56,364 NetUtil.py:70 - Connecting to https://master-045:8440/ca
ERROR 2020-03-03 14:43:56,368 NetUtil.py:96 - EOF occurred in violation of protocol (_ssl.c:618)
ERROR 2020-03-03 14:43:56,369 NetUtil.py:97 - SSLError: Failed to connect. Please check openssl library versions.
Refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1022468 for more details.
WARNING 2020-03-03 14:43:56,369 NetUtil.py:124 - Server at https://master-045:8440 is not reachable, sleeping for 10 seconds...
INFO 2020-03-03 14:44:06,369 NetUtil.py:70 - Connecting to https://master-045:8440/ca
ERROR 2020-03-03 14:44:06,373 NetUtil.py:96 - EOF occurred in violation of protocol (_ssl.c:618)
ERROR 2020-03-03 14:44:06,374 NetUtil.py:97 - SSLError: Failed to connect. Please check openssl library versions.
Refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1022468 for more details.
WARNING 2020-03-03 14:44:06,374 NetUtil.py:124 - Server at https://master-045:8440 is not reachable, sleeping for 10 seconds...
解决方式:
编辑ambari-agent.ini 配置文件
在 [security] 下面增加一行代码 [force_https_protocol=PROTOCOL_TLSv1_2 ]
# 所有节点均要加
vi /etc/ambari-agent/conf/ambari-agent.ini
修改上述文件之后,重启ambari-server即可
ambari-server stop
ambari-server setup # 为了保证成功,使用该命令,直接重启跳过该过程亦可
ambari-server start
重新启动之后,问题得到解决,状态很快更新为Success!
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py", line 73, in <module>
HdfsClient().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 367, in execute
method(env)
File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py", line 37, in install
self.install_packages(env)
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 803, in install_packages
name = self.format_package_name(package['name'])
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 538, in format_package_name
raise Fail("Cannot match package for regexp name {0}. Available packages: {1}".format(name, self.available_packages_in_repos))
resource_management.core.exceptions.Fail: Cannot match package for regexp name hadoop_${stack_version}. Available packages: ['accumulo', 'accumulo-conf-standalone', 'accumulo-source', 'accumulo_2_6_3_0_235', 'accumulo_2_6_3_0_235-conf-standalone', '
解决办法:
注释掉 /usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py
文件的533行
package_version = None
如下图所示,前面加个注释符
注释后,失败的节点重新安装即可!
附:vi文件时显示行号或者取消行号命令
# 显示行号
:set number
# 或者
:set nu
# 取消行号显示
:set nu!
如果想要每次打开文件都显示行号
编辑 vimrc 文件,添加:set number
之后,随便打开一个文件,发现都显示行号:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。