1、服务器环境1.1 修改主机名称1.2 修改ip地址1.3 linux修改hosts并添加集群主机1.4 windows修改hosts文件并添加集群主机2、免密配置2.1 切换root用户2.2 生成公钥与私钥对2.3 将公钥复制到目标机器,并测试免密登录是否成功2.4 集群其他主机免密配置2.5 异常演示3、关闭防火墙3.1 防火墙设置3.2 设置之后3.3 设置之前4、禁用selinux4.1 selinux介绍4.2 设置selinux5、安装JDK5.1 上传jdk5.2 配置Java环境变量5.3 检查Java环境是否生效6、安装mysql6.1 mysql安装6.2 mysql设置6.3 修改密码6.4 上传驱动7、安装httpd服务7.1 httpd介绍7.1 安装httpd服务7.2 查看httpd服务7.3 tips:网页访问本地文件内容8、安装ntp服务8.1 ntp介绍8.2 安装8.3 修改ntp.conf配置8.4 时钟同步8.5 检查时钟同步效果9、搭建yum环境和创建ambari本地源9.1 安装yum工具9.2 安装9.3 创建repo文件9.4 分发repo文件9.4 生成本地yum源10、安装ambari10.1 在mysql中创建ambari用户和授权10.2 安装ambari10.2 初始化配置10.3 初始化ambari数据库10.4 启动ambari10.5 报错及解决10.6 ambari页面配置步骤10.6.1 第1步 启动安装10.6.2 第2步 输出集群名称10.6.3 第3步 选择版本、选择本地仓库及路径10.6.4 第4步 输入集群节点名称、私钥10.6.5 节点认证10.6.6 选择服务10.6.7 分配主节点10.6.8 分配从节点和客户端10.6.9 自定义服务10.6.10 确认配置10.6.11 安装部署11、启动服务11.1 java权限问题11.2 hive元数据初始化
my-hdp1、my-hdp2、my-hdp3均执行以下操作
hostnamectl set-hostname my-hdp1
hostnamectl set-hostname my-hdp2
hostnamectl set-hostname my-hdp3
#三台节点按照各自的节点修改ip地址
vim /etc/sysconfig/network-scripts/ifcfg-ens33
#linux环境下,三台服务器均添加
vim /etc/hosts
192.168.8.105 my-hdp1
192.168.8.106 my-hdp2
192.168.8.107 my-hdp3
#在windows下修改hosts文件,C:\Windows\System32\drivers\etc在这个路径下
192.168.8.105 my-hdp1
192.168.8.106 my-hdp2
192.168.8.107 my-hdp3
ssh-keygen
#ssh-copy-id 用户名@主机名称
ssh-copy-id root@my-hdp1
#如果执行不成功,检查一下1.3中是否添加了目标ip地址和主机名称映射
my-hdp2、my-hdp3均执行2.1-2.3步
在my-hdp1上执行
ssh-copy-id my-hdp2
ssh-copy-id my-hdp3
在my-hdp2执行
ssh-copy-id my-hdp1
ssh-copy-id my-hdp3
在my-hdp3执行
ssh-copy-id my-hdp2
ssh-copy-id my-hdp3
my-hdp1、my-hdp2、my-hdp3均执行以下操作
#查看防火墙状态
systemctl status firewalld
#关闭防火墙
systemctl stop firewalld
#设置防火墙服务开机不自启
systemctl disable firewalld
#再次查看防火墙检查防火墙是否关闭
systemctl status firewalld
my-hdp1、my-hdp2、my-hdp3均执行以下操作
安全增强型 Linux(Security-Enhanced Linux)简称 SELinux,它是一个 Linux 内核模块,也是 Linux 的一个安全子系统。
SELinux 主要由美国国家安全局开发。2.6 及以上版本的 Linux 内核都已经集成了 SELinux 模块。
SELinux 的结构及配置非常复杂,而且有大量概念性的东西,要学精难度较大。很多 Linux 系统管理员嫌麻烦都把 SELinux 关闭了。
SELinux 主要作用就是最大限度地减小系统中服务进程可访问的资源(最小权限原则)。
vim /etc/selinux.config
把SELINUX=enforcing修改为SELINUX=disabled
my-hdp1、my-hdp2、my-hdp3均执行以下操作
#创建目录
mkdir /usr/share/java
#将java压缩包上传到该目录
#解压jdk*.tar.gz
tar -zxf jdk-8u144-linux-x64.tar.gz
vim /etc/profile.d/my_env.sh
#添加如下内容
#!/bin/bash
export JAVA_HOME=/usr/share/java/jdk1.8.0_144
export PATH=$PATH:$JAVA_HOME/bin
#使用下面这个命令可以不用重启电脑
source /etc/profile.d/my_env.sh
#输出java版本号
java -version
#终端信息如下
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
mysql安装包
-rw-rw-r--. 1 sweet sweet 26460548 4月 7 18:30 mysql-community-client-5.7.32-1.el7.x86_64.rpm
-rw-rw-r--. 1 sweet sweet 314936 4月 7 18:30 mysql-community-common-5.7.32-1.el7.x86_64.rpm
-rw-rw-r--. 1 sweet sweet 2457204 4月 7 18:30 mysql-community-libs-5.7.32-1.el7.x86_64.rpm
-rw-rw-r--. 1 sweet sweet 1260336 4月 7 18:30 mysql-community-libs-compat-5.7.32-1.el7.x86_64.rpm
-rw-rw-r--. 1 sweet sweet 181712536 4月 7 18:30 mysql-community-server-5.7.32-1.el7.x86_64.rpm
mysql各个安装包之间是有依赖的,如果直接安装,则会出现下图1的情况
将上面的安装包放在一个目录下
yum install * 即可一键安装
安装的效果如下图2
#启动Mysql服务
systemctl start mysqld.service
#查看Mysql服务状态
systemctl status mysqld.service
#设置Mysql服务开机自启
system enable mysqld.service
#获取初始化密码
grep "password" /var/log/mysqld.log
如下图,红色框表示root用户本地登录密码为后面的乱码
#mysql登录
mysql -uroot -pfeEa8F53kn(m
#设置mysql密码安全强度为0
set global validate_password_policy=0;
#设置mysql密码最低长度为1
set global validate_password_length=1;
#修改root用户密码
alter user 'root'@'localhost' identified by 'root';
#授权root用户所有权限并设置本地登录
grant all privileges on *.* to 'root'@'localhost' identified by 'root';
#授权root用户所有权限并设置远程登录
grant all privileges on *.* to 'root'@'%' identified by 'root';
#刷新权限
flush privileges;
my-hdp1、my-hdp2、my-hdp3均执行
将驱动上传到/usr/share/java路径
httpd是Apache超文本传输协议(HTTP)服务器的主程序。被设计为一个独立运行的后台进程,它会建立一个处理请求的子进程或线程的池。
安装部署httpd服务后,可以通过浏览器访问/var/www/html/下的文件。
#my-hdp1执行以下操作
#安装
yum install httpd
#开机自启动
systemctl enable httpd.service
#启动httpd服务
systemctl start httpd.service
#查看httpd服务状态
systemctl staus httpd.service
#默认httpd服务已经启动
#访问httpd服务
在windows的浏览器地址栏输入http://my-hdp1/
这一步可以不执行,作为扩展学习,了解httpd
#在my-hdp下,进入html目录
cd /var/www/html
#创建demo.html
vim demo.html
#添加内容
hello world
#访问demo
在windows浏览器地址栏中输入http://my-hdp1/demo.html
my-hdp1、my-hdp2、my-hdp3均执行以下操作
在linux系统中,/usr/share/zoneinfo目录下存在很多时区,其中Asia/Shanghai代表中国时间
ntp是Network Time Protocol的简称,中文名称是网络时间协议,用来在分布式时间服务器和客户端之间进行时间同步,ntp基于udp报文进行传输,使用的udp端口号为123
使用ntp的目的是对网络内所有具有时钟的设备进行时钟同步,使网络内所有设备的始终保持一致,从而使设备能够提供基于同一时间的多种应用。
#安装
yum install ntp
#开机自启动
systemctl enable ntpd
#启动ntp服务
systemctl start ntpd
#查看ntpd服务状态
systemctl status ntpd
vim /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
#表示ntp主服务器是与自身的系统时钟同步
server 127.127.1.0
#指定阶层编号为10,降低优先度
fudge 127.127.1.0 stratum 10
#my-hdp2、my-hdp3执行以下操作
vim /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
#表示ntp主服务器是与自身的系统时钟同步
server 127.127.1.0
#指定阶层编号为10,降低优先度
fudge 127.127.1.0 stratum 10
#配置时间服务器为本地的时间服务器
server my-hdp1
#允许上层时间服务器主动修改本机时间
restrict my-hdp1 nomodify notrap noquery
#在my-hdp2、my-hdp3执行以下操作
#重启服务
systemctl restart ntpd
#date查看时间
date
#检查my-hdp2、my-hdp3是否和my-hdp1时间一致
#my-hdp1、my-hdp2、my-hdp3执行以下操作
yum install wget
yum install createrepo
yum install yum-utils
yum repolist
#在my-hdp1上执行
#将安装包上传到/var/www/html
ambari-2.6.2.2-centos7.tar.gz
HDP-2.6.5.0-centos7-rpm.tar.gz
HDP-UTILS-1.1.0.22-centos7.tar.gz
#解压
tar -zxf 上面的包
在my-hdp1执行以下操作
#进入/etc/yum.repo.d/
cd /etc/yum.repo.d/
#新建ambari.repo文件
vim ambari.repo
#添加以下内容
[ambari]
name=ambari
baseurl=http://my-hdp1/ambari/centos7/2.6.2.2-1
enabled=1
gpgcheck=0
#新建HDP.repo
vim HDP.repo
#添加以下内容
[HDP]
name=HDP
baseurl=http://my-hdp1/HDP/centos7/2.6.5.0-292
path=/
enabled=1
gpgcheck=0
#新建HDP-UTILS.repo
vim HDP-UTILS.repo
#添加以下内容
[HDP-UTILS]
name=HDP-UTILS
baseurl=http://my-hdp1/HDP-UTILS/centos7/1.1.0.22
path=/
enabled=1
gpgcheck=0
#分发文件到my-hdp2、my-hdp3,使用分发的方式避免文件出错
#分发ambari.repo
scp ambari.repo root@my-hdp2:/etc/yum.repo.d
scp ambari.repo root@my-hdp3:/etc/yum.repo.d
#分发HDP.repo
scp HDP.repo root@my-hdp2:/etc/yum.repo.d
scp HDP.repo root@my-hdp3:/etc/yum.repo.d
#分发HDP-UTILS.repo
scp HDP-UTILS.repo root@my-hdp2:/etc/yum.repo.d
scp HDP-UTILS.repo root@my-hdp3:/etc/yum.repo.d
#在/var/www/html下有三个文件夹
drwxr-xr-x. 3 root root 21 4月 7 14:58 ambari
drwxr-xr-x. 3 1001 users 21 5月 15 2018 HDP
drwxr-xr-x. 3 1001 users 21 8月 13 2018 HDP-UTILS
#分别进入以下目录查看是否有repodata目录
#ambari目录
/var/www/html/ambari/centos7/2.6.2.2-1
#HDP目录
/var/www/html/HDP/centos7/2.6.5.0-292
#HDP-UTILS目录
/var/www/html/HDP-UTILS/centos7/1.1.0.22
#repodata如下图所示
#如果上面的目录中没有repodata,则在上面的路径下执行
createrepo .
#createrepo执行情况如下如所示
#登录mysql
mysql -uroot -proot
#创建ambari用户
create user 'ambari'@'%' identified by 'ambari';
#授权ambari用户所有权限并设置本地登录
grant all privileges on *.* to 'ambari'@'localhost' identified by 'ambari';
#授权ambari用户所有权限并设置远程登录
grant all privileges on *.* to 'ambari'@'%' identified by 'ambari';
#刷新权限
flush privileges;
#退出登录
exit;
#使用ambari用户登录,检查ambari是否可以登录
mysql -uambari -pambari
#使用ambari用户登录并创建数据库
create database ambari;
#安装ambari-server
yum install ambari-server
#修改ambari.properties
vim /etc/ambari-server/conf/ambari.properties
#在ambari.properties文件末尾添加mysql-connector-java驱动
server.jdbc.driver.path=/var/share/java/mysql-connector-java-5.1.27-bin.jar
#ambari-server初始化配置
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.27-bin.jar
[root@my-hdp1 java]# ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? y
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (sweet):root
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 3
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME:
Property cannot be blank.
Path to JAVA_HOME: /home/sweet/jdk1.8.0_144
Validating JDK on Ambari Server...done.
Checking GPL software agreement...
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 (3): 3
Hostname (localhost):
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (ambari):
Configuring ambari database...
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? n
WARNING: Remote database setup aborted.
Ambari Server 'setup' completed with warnings.
[root@my-hdp1 java]# ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? y
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (sweet):root
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 3
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME: /home/sweet/jdk1.8.0_144
Validating JDK on Ambari Server...done.
Checking GPL software agreement...
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 (3): 3
Hostname (localhost):
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (ambari):
Configuring ambari database...
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.6.2.2.1.jar
...........
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
#使用amabri用户登录Mysql
mysql -uambari -pambari
#切换数据库
use ambari;
#初始化ambari数据库
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
#启动ambari
ambari-server start
#启动成功后
在windows浏览器地址栏中输入
http://my-hdp1:8080/
#报错
Caused by: java.lang.RuntimeException: If you are using a non-default database for Ambari and a custom JDBC driver jar, you need to set property "server.jdbc.driver.path={path/to/custom_jdbc_driver}" in ambari.properties config file, to include it in ambari-server classpath.
#分析
根据错误日志提示,mysql驱动没有找到
#查看日志,找到关键信息
server.jdbc.driver.path=/var/share/java/mysql-connector-java-5.1.27-bin.jar
#查看mysql驱动地址
/usr/share/java
#修改ambari.properties
server.jdbc.driver.path=/usr/share/java/mysql-connector-java-5.1.27-bin.jar
#再次启动,成功启动,过程如下图
#HDP-2.6
http://my-hdp1/HDP/centos7/2.6.5.0-292
#HDP-UTILS
http://my-hdp1/HDP-UTILS/centos7/1.1.0.22
#host names
my-hdp1
my-hdp2
my-hdp3
#可以使用范围表达式
my-hdp[1-3]
#id_rsa
----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA1lxD/n+ml4KBv02v96RxxMpuXmh8PBP5y8hCtKHzAEu0RQ/R
InCQ5386efPAILRVohKlksG/HsJ5+Vh7huEKZrbZtSul5VV97MUvDSHp04t/cacI
QOPRN4Povyz8a3LEaYu6ixmm63DBTL7zrmhe8mUlkjzAOnHHm3eFPqzqFOAHFPES
7K4/HOGvFri2mfwLZ/X5PqMcW9gDm7EHrzF5fHmoJ3dXtPQZot7PnKjgA/8Vz71c
uhgFU+15xJFtSHiF1Qq0HzYho93L7KK7iq6RjOfTRhOm47lVcZLbHIp5Q3UCRNhJ
MreltXXR06CTP04yhubiSo282vxhtg/vyNujmQIDAQABAoIBAQDEnOYktVLI3wRA
wnHnM6bCOGZZI37n3+6bUjiU04I+QDG9so9BBnxySQkKuF794Eo3GOFTJXA2N2yH
HvhWM21F3ur6uGk2W17f39CTPArrZKTlSq5QTmUkhVHin9F6gE7U/DuCwGmQw+AY
k4CQ9Nw5ejqm0iACuz+5Qjwty438y/zLV8pg4D4JbTg5dYG+vkbyojRQoJRUp9Zr
uWuldY+tuPJzZInj8UbGb2Bh13lknqALmVm1LfnKMmeJcK+QXDpqqUXE52U2/+O3
DGkOjnn5MrmUvf2kcRTa0Hoab/VozST15r/U5LVJKMFvEK5EoidlOhHvMpLssyJp
Gl60emuBAoGBAPMoT2botLz51474IaXwEaQ+LGWqhirtBYWSCYMlxTNUbWPHkFDM
jbh7wSytuFEAjsPGhxy7FtwCaEn1IPlTmArSgrKv0OkgrvMz8eWvax1Sx9N7GVA3
dK85gJ6pE2Fg6dgpwR0VkowFtmFQjQWE5xkoSHtNTVrn2mM/KohAZAiJAoGBAOGu
mHUE2oNlBiy/h+T4xXE5DfSvFIT2/wsOevGUTrnajWa8wcC71LwC0UXdeZnnGt6K
fFkr+6I1KQCOMqzKNX7RVcemse8NCQaGZNmBpL9+dnmNzEc0Anqvpv72iIz8T6ll
g5oplji0Llgl9AdWI/sAuSjaN28zsQZhaVV/bN6RAoGBAJAilO6rgneCogRdkZSL
eemh8S9SpbVMSrmil4DmIr8KjM1YvnMmzdtNgHS7hUZ+ziG+zNh7DlHcG3W7mJAy
vS2tG0xQa8XFWe9QG1PLZ/M53rm9foPOW5yCuXtTPem7SOKZ3Z8f6n6V5EZLOUzM
OzDucAinCfOY/BtYlh2uDZ4BAoGAOJhjTT05WygTg1dIyggE457uPAVH/Qw/61Ln
S/voPj1rpm8Bm8a+06NVPdMLsqe9Gj/abTZVdVklfikq1iAjiDkQ7O+FwbAgKk27
rrwPR6J8LYF80AJf+Mph86B5n/mKNK3rcdaqAHBXCu4Bo3Fbto9436DRtAZfh30Y
QEOjVrECgYAkm/V66qSV1sN5ijHYdEsrcFwAguEe9HeB5HDTL+2ugWLmK2EGW5bJ
2KY142ep+UMbEsWqPqoYtoBt7wEJ8dHS2IqXVJ82DSzirgiAvhTmFdVQigZ7QVdg
h4XoxTgo82jN4qTkgvzGZGBOMlKyxnVml+prjvMer2/l40qsDqNXJQ==
-----END RSA PRIVATE KEY-----
认证失败
#错误
ERROR 2021-04-07 17:23:09,187 NetUtil.py:96 - EOF occurred in violation of protocol (_ssl.c:618)
ERROR 2021-04-07 17:23:09,187 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 2021-04-07 17:23:09,188 NetUtil.py:124 - Server at https://my-hdp1:8440 is not reachable, sleeping for 10 seconds...
", None)
#解决,my-hdp1、my-hdp2、my-hdp3均执行以下操作
#修改cert-verification.cfg
vim /etc/python/cert-verification.cfg
[https]
verify=disable
#修改ambari-agent.ini
vim /etc/ambari-agent/conf/ambari-agent.ini
[security]
ssl_verify_cert=0
force_https_protocol=PROTOCOL_TLSv1_2
#修改完成后重启ambari-agent
ambari-agent restart
重新刷新页面,即可
创建hive用户及数据库
#登录mysql
mysql -uroot -proot
#创建hive用户
create user 'hive'@'%' identified by 'hive';
#授权ambari用户所有权限并设置本地登录
grant all privileges on *.* to 'hive'@'localhost' identified by 'hive';
#授权ambari用户所有权限并设置远程登录
grant all privileges on *.* to 'hive'@'%' identified by 'hive';
#刷新权限
flush privileges;
#退出登录
exit;
#使用hive用户登录,检查ambari是否可以登录
mysql -uhive -phive
#使用hive用户登录并创建数据库
create database hive;
安装失败
2021-04-07 22:45:40,575 - Execution of '/usr/bin/yum -d 0 -e 0 -y install hadoop_2_6_5_0_292' returned 1. Error: Package: hadoop_2_6_5_0_292-2.7.3.2.6.5.0-292.x86_64 (HDP)
Requires: zookeeper_2_6_5_0_292 >= 3.4.0
Error: Package: hadoop_2_6_5_0_292-2.7.3.2.6.5.0-292.x86_64 (HDP)
Requires: ranger_2_6_5_0_292-yarn-plugin
Error: Package: hadoop_2_6_5_0_292-2.7.3.2.6.5.0-292.x86_64 (HDP)
Requires: ranger_2_6_5_0_292-hdfs-plugin
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
2021-04-07 22:45:40,576 - Failed to install package hadoop_2_6_5_0_292. Executing '/usr/bin/yum clean metadata'
原因:缺zookeeper包,通过日志,找到HDP包,发现缺包,经过查找,使用xshell客户端传输,上传的文件有限制,但文件可以正常使用,通俗易懂的说,HDP压缩包一共6.8G,按照之前的方式上传是由2多个G,但文件没有损坏,在最后安装的时候因为缺包导致无法部署。这也说明ambari平台或者yum源依赖安装的这种机制能够将上下游服务打通,安装即用,但也缺乏灵活性
报错日志
resource_management.core.exceptions.ExecutionFailed: Execution of 'export HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ; /usr/hdp/current/hive-server2-hive2/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED] -verbose' returned 1. SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.5.0-292/hive2/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
出错原因
在执行10.2 初始化配置的时候直接运行ambari-server setup
导致没有加载mysql-connector-java.jar驱动
#我认为在后面的配置中有输入mysql驱动的路径,现在想来应该ambari-server连接mysql的时候需要的,并不是给hive使用的
解决办法
#重新执行
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-5.1.27-bin.jar
#重新启动ambari服务
ambari-server restart
#在ambari界面进入hive服务,重启三台节点服务
hive就可以正常运行了
关注公众号:大数据最后一公里