Amabri 2.6.1.5 +HDP-2.6.4.0部署文档

最近两天公司要求部署Ambari集群,我在网上找了一些资料,但是踩了许许多多的坑,我决定整理一下写一篇博客,与大家共享,如果有问题大家可以一起讨论

环境:Amabri 2.6.1.5 +HDP-2.6.4.0、腾讯云主机、Centos7.4

 

1、满足最低系统要求

1.1 浏览器

建议您将浏览器(自己使用的windows既可)更新至最新的稳定版本

1.2 软件要求(在每台主机上)

1.2.1 yum和rpm
1.2.2 scp, curl, unzip, tar、 wget
1.2.3 OpenSSL(v1.01,build 16或更高版本)
1.2.4 python:2.7(注意如果有使用python3.x的需求,不要改变python环境变量,否则3.x会报错)
1.2.5 jdk:1.8
1.2.6 mysql:5.6(官网上写的5.6,不确定更高版本有没有问题,也可以使用其他数据库,根据自己习惯)
1.2.7 内存要求:Ambari主机应该至少有1 GB RAM,500 MB空闲,(但如果使用的话,建议内存8g以上,我自己的虚拟机内存4g搭好后跑起来会很卡,配置低的话警告也会很多)
1.2.8 检查最大打开文件描述符,推荐的最大打开文件描述符数为10000或更多
1.2.9 mysql-connector-java

以上软件大部分系统自带,其余可参考:CentOS 初始环境配置

2、环境准备(在每台主机上)

2.1 ssh 免密

只需master 免密到其他节点(包含自身),不需要互通,参考:linux ssh 免密登录

2.2 启用NTP

yum install -y ntp
systemctl enable ntpd

2.3 编辑主机文件

vim /etc/hosts
10.70.19.125 master       10.70.19.170 slave01           10.70.19.52 slave02

2.4 设置主机名

以master为例

2.4.1

hostname master

2.4.2

vim /etc/hostname
master

两步缺一不可,通过命令验证

hostname
hostname -f

两个必须都为master才行

2.5 编辑网络配置文件

vim /etc/sysconfig/network

修改HOSTNAME属性为FQDN

NETWORKING=yes
HOSTNAME=master

2.6 禁用iptables

systemctl disable firewalld
service firewalld stop

2.7 禁用SELinux

2.7.1 临时禁用

setenforce 0

2.7.2 永久禁用(重启机器)

vim /etc/sysconfig/selinux

将SELINUX改为disabled

SELINUX=disabled

这样服务器或虚拟机重启也没有问题。

3、制作本地源(仅在master)

因为ambari 和 hdp 安装文件比较大,如果在线安装的话会很慢,所以最好选择本地源。

(可以在集群可以访问的任何机器上制作本地源)

3.1 安装制作本地源工具

yum install yum-utils createrepo

3.2 创建一个HTTP服务器

yum install httpd -y
systemctl enable httpd && systemctl start httpd

3.3 为Web服务器创建目录

mkdir -p /var/www/html/hdp/HDP-UTILS

3.4 下载系统对应的最新版相关安装包

3.4.1 下载

其中包括Ambari、HDP、HDP-UTILS、HDP-GPL

wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz
wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.4.0/HDP-2.6.4.0-centos7-rpm.tar.gz
wget http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.4.0/HDP-GPL-2.6.4.0-centos7-rpm.tar.gz
wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz

3.4.2 解压

tar -zxvf ambari-2.6.1.5-centos7.tar.gz -C /var/www/html
tar -zxvf HDP-2.6.4.0-centos7-rpm.tar.gz -C /var/www/html/hdp/
tar -xzvf HDP-GPL-2.6.4.0-centos7-rpm.tar.gz -C /var/www/html
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz  -C /var/www/html/hdp/HDP-UTILS/

 

3.4.3 解决在浏览器访问http://ambari.master.com/hdp/HDP/centos7/2.6.4.0-91 为空白

原因:该目录下index.xml使用了 https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js 国内访问不了谷歌,将index.xml注释掉即可

cd /var/www/html/hdp/HDP/centos7/2.6.4.0-91
mv index.xml index.xml.bak

此时应该可以在浏览器访问下面的地址了,可以验证一下

http://master.com/ambari/centos7/2.6.1.5-3/
http://master.com/hdp/HDP/centos7/2.6.4.0-91
http://master.com/hdp/HDP-UTILS

3.5 配置ambari、HDP、HDP-UTILS的本地源

(不正确配置会出现failure: repodata/repomd.xml from HDP-UTILS-1.1.0.22: [Errno 256] No more mirro)

cp /var/www/html/ambari/centos7/2.6.1.5-3/ambari.repo /etc/yum.repos.d/
cp /var/www/html/hdp/HDP/centos7/2.6.4.0-91/hdp.repo /etc/yum.repos.d/

将每个repo里的baseurl和gpgkey的地址修改为本地的

vim /etc/yum.repos.d/ambari.repo
#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://10.70.19.125/ambari/centos7/2.6.1.5-3
gpgcheck=1
gpgkey=http://10.70.19.125/ambari/centos7/2.6.1.5-3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
vim /etc/yum.repos.d/hdp.repo

#VERSION_NUMBER=2.6.4.0-91
[HDP-2.6.4.0]
name=HDP Version - HDP-2.6.4.0
baseurl=http://10.70.19.125/hdp/HDP/centos7/2.6.4.0-91
gpgcheck=1
gpgkey=http://10.70.19.125/hdp/HDP/centos7/2.6.4.0-91/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1


[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://10.70.19.125/hdp/HDP-UTILS/HDP-UTILS/centos7/1.1.0.22
gpgcheck=1
gpgkey=http://10.70.19.125/hdp/HDP/centos7/2.6.4.0-91/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

yum clean all
yum list update
yum makecache
yum repolist

3.6 (可选)如果您的环境中配置了多个存储库,请在集群中的所有节点上部署以下插件

yum install yum-plugin-priorities -y
vim /etc/yum/pluginconf.d/priorities.conf
[main]
enabled = 1
gpgcheck=0                

4、安装Mariadb

yum -y install mariadb mariadb-server

安装完成MariaDB,首先启动MariaDB

systemctl start mariadb

设置开机启动

systemctl enable mariadb

初始化Mariadb

mysql -uroot

use mysql;

delete from user where host<> '%';

#允许远程登录
grant all privileges on *.* to root@'%' identified by '123456'; 

#更新root的权限,否则root用户可能无法给hive、Ambari用户赋权限
update user set Grant_priv='Y' where user='root';

flush privileges;

 

 

4、安装ambari(仅在master)

4.1安装ambari-server

yum install ambari-server -y

4.2 设置mysql连接器

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

可以到这个网站下载驱动jar

https://mvnrepository.com/artifact/mysql/mysql-connector-java

(如果使用mysql作为hive的元数据库)

 

4.3 创建相关的mysql数据库

创建ambari数据库及用户,登录root用户执行下面语句:

mysql -uroot -pRoot-123
create database ambari character set utf8 ;  
CREATE USER 'ambari'@'%'IDENTIFIED BY 'ambari';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;

如果要安装Hive,再创建Hive数据库和用户,再执行下面的语句:

create database hive character set utf8 ;  
CREATE USER 'hive'@'%'IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
FLUSH PRIVILEGES;

hive用户可以不用指定全部库的权限。

#不知道为什么我root用户无法给其他用户赋权限,我用Navicat连接之后,新建查询就可以修改权限了,不知道为什么

4.4 配置ambari-server

4.4.1 setup

ambari-server setup

4.4.2 配置流程

以下为全部的配置过程,其中主要是自定义jdk,输入JAVA_HOME路径,自定义数据库选mysql,输入数据库用户名,密码等

ambari-server setup
Using python  /usr/bin/python2
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 (root):ambari
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[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: /opt/jdk1.8.0_151
Validating JDK on Ambari Server...done.
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)? y
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
Hostname (localhost): 10.70.19.125
Port (3306): 3306
Database name (ambari): ambari
Username (ambari): ambari
Enter Database Password (bigdata): ambari
Re-enter password: 
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.1.5.3.jar
...........
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

4.4.3将Ambari数据库脚本导入到数据库

mysql -uambari -pambari
use ambari;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

4.4.4 启动ambari

ambari-server start

4.4.5 启动成功,可以通过如下地址访问:

http://master:8080

用户名,密码为admin admin

 

5、使用ambari浏览器界面安装hadoop,hive等组件

5.1 登录到ambari管理界面

http://ambari.master.com:8080

 

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第1张图片

5.2 安装hdp集群,点击Launch Install Wizard

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第2张图片

5.3,设置集群名称

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第3张图片

5.4 配置本地源(图片中GPL的地址不对,按照下面的输入)

http://10.70.19.125/HDP-GPL/centos7/2.6.4.0-91/
http://10.70.19.125/hdp/HDP-UTILS/HDP-UTILS/centos7/1.1.0.22
http://10.70.19.125/hdp/HDP/centos7/2.6.4.0-91/
Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第4张图片

 

5.5 设置host

其中下面的为master上ssh的私钥(~/.ssh/id_rsa)。

输入master的私钥,感觉直接用导入文件的方式有问题,会有很多换行符,我是直接在linux上查看,一行一行复制的,去掉了换行符

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第5张图片

5.6 Host确认

如果失败或者卡住不动可根据日志解决,如果warn根据提示信息解决,知道全部为Success才可以进行下一步。Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第6张图片

5.6.1 在此安装期间可能会出现  SSLError: Failed to connect. Please check openssl library versions. 问题

解决办法:

①在所有的节点上

yum upgrade openssl :升级ssl

②在所有的节点上

1、vi /etc/ambari-agent/conf/ambari-agent.ini

添加  在 [security] 下  force_https_protocol=PROTOCOL_TLSv1_2

③在所有的节点上

vi /etc/python/cert-verification.cfg

[https]

verify=disable

修改完之后还不好,可以考虑重启一下机器

 

5.6.2 .可能会发生的异常:在add host并confirm host的时候,会卡住不动,然后看日志会发现异常信息:

Error executing bootstrap Cannot create /var/run/ambari-server/bootstrap

1.2 解决办法
通过查看,/var/run/ambari-server目录下确实没有bootstrap文件夹,手动添加即可

mkdir bootstrap
1
但是,如果只创建该文件夹的话,ambari依然报错,大概是没有权限相关的,就不贴出详细的异常了

为ambari用户添加权限即可

chown -R ambari:ambari /var/run/ambari-server/bootstrap/

 

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第7张图片

 

5.7 选择要安装的服务

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第8张图片

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第9张图片

如果有依赖其他组件选择ok即可,如安装hive依赖tez,pig等

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第10张图片

 

5.8 设置各个服务Master

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第11张图片

5.9 设置Slaves 和 Clients

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第12张图片

5.10 自定义配置

其中红色的必须要改,大致是设置路径,密码等,如hive要设置hive元数据的数据库信息,我用的master上的mysql

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第13张图片

测试一下连接

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第14张图片

没有了红色的即可进行下一步,如遇到warn,可根据提示信息进行修改配置,也可以忽略警告,等装完以后再改。

5.11 review前面的配置

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第15张图片

5.12 安装、启动、测试

这里因为个人电脑配置较低,浏览器有点卡,进度条没有显示出来。

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第16张图片

5.13 安装完成

若最后出现警告,可以装完重启所有服务,再检查看看有没有问题,如有警告或启动失败,可根据日志排查原因,一开始安装的的组件较多的话,出现警告的可能性会大一些,所以可以先装几个必要的组件,之后一个一个组件装。

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第17张图片

5.14 概要

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第18张图片

5.15 hive启动异常

这次安装重启之后发现hive等服务启动不成功,我就把hive等卸载然后重装,本来以为是开始是hive没安装成功,但是重装后hive还是启动不成功,看了一下日志,发现是之前手动安装的原生的hive的环境变量没有注释掉,注释掉,重启ambari之后,再启动所有服务,就成功了(再在hive shell 里建表、插入数据、查询验证一下),所以如果在已经安装好的大数据集群上安装ambari,最好先把之前配的环境变量注释掉。

5.16 启动成功

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第19张图片

Amabri 2.6.1.5 +HDP-2.6.4.0部署文档_第20张图片

 

5.17 Ambari UI中使用File viewer 创建文件报错

org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security.AccessControlException: Permission denied: user=DrWho, access=WRITE, inode="hadoop":hadoop:supergroup:rwxr-xr-x

解决方法:

  到服务器上修改hadoop的配置文件:conf/hdfs-core.xml, 找到 dfs.permissions 的配置项 , 将value值改为 false


dfs.permissions
false

 

5.18 Ambari UI中使用Hive viewer 报错

500 status code received on GET method for API: /api/v1/stacks/HDP/versions/2.4/recommendations 
Error message: Error occured during stack advisor command invocation: Cannot create /var/run/ambari-server/stack-recommendations

解决方案:sudo chown -R ambari /var/run/ambari-server

 

5.19 Ambari UI中使用Hive viewer2.0 报错

E090 HDFS020 Could not write file /user/admin/hive/jobs/hive-job-11-2017-01-03_06-05/query.hql [HdfsApiException]

-----------------------------------------------------------------------------------------

解决办法:

①查看当面登录Ambari集群中的用户是谁,比如我当前登录的用户是admin,记住

②在hdfs的配置中添加或者修改hadoop.proxyuser.admin.hosts=*的value为*(admin为 ①中的用户)

③在hdfs的配置中添加或者修改hadoop.proxyuser.admin.groups=*的value为*(admin为 ①中的用户)

④sudo -u hdfs hadoop fs -mkdir /user/admin(admin为 ①中的用户)

⑤sudo -u hdfs hadoop fs -chown -R root:hdfs /user/admin(admin为 ①中的用户)

 

5.20 Ambari UI中使用Hive viewer2.0 报错

Caught exception trying to store view entity JobImpl{id='null, owner='ip56, hiveQueryId='null, dagId='null, queryId='null}

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'ambari.DS_JOBIMPL_14' doesn't exist
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'ambari.DS_JOBIMPL_14' doesn't exist
Call: INSERT INTO DS_JOBIMPL_14 (DS_id, DS_applicationId, DS_confFile, DS_dagId, DS_dagName, DS_dataBase, DS_dateSubmitted, DS_duration, DS_forcedContent, DS_globalSettings, DS_guid, DS_hiveQueryId, DS_logFile, DS_owner, DS_queryFile, DS_queryId, DS_referrer, DS_sessionTag, DS_sqlState, DS_status, DS_statusDir, DS_statusMessage, DS_title) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
 

解决办法:

查看报错中的DS_JOBIMPL_14的表的编号是多少,我的是14,然后创建DS_JOBIMPL_14这个表,如下图

在ambari库中创建表

CREATE TABLE DS_JOBIMPL_14 (
ds_id VARCHAR(255) NOT NULL,
ds_applicationid TEXT,
ds_conffile TEXT,
ds_dagid TEXT,
ds_dagname TEXT,
ds_database TEXT,
ds_datesubmitted BIGINT,
ds_duration BIGINT,
ds_forcedcontent TEXT,
ds_globalsettings TEXT,
DS_guid TEXT,
DS_hiveQueryId TEXT,
ds_logfile TEXT,
ds_owner TEXT,
ds_queryfile TEXT,
ds_queryid TEXT,
ds_referrer TEXT,
ds_sessiontag TEXT,
ds_sqlstate TEXT,
ds_status TEXT,
ds_statusdir TEXT,
ds_statusmessage TEXT,
ds_title TEXT,
PRIMARY KEY (ds_id)
);

 

5.1.21 Ambari安装组件报错

500 status code received on GET method for API: /api/v1/stacks/HDP/versions/2.4/recommendations 
Error message: Error occured during stack advisor command invocation: Cannot create /var/run/ambari-server/stack-recommendations
解决方案:sudo chown -R ambari /var/run/ambari-server

 

5.1.22 Ambari启动报错

144) Error injecting constructor, java.lang.RuntimeException: Error while creating database accessor 
  at org.apache.ambari.server.orm.DBAccessorImpl.(DBAccessorImpl.java:87)
  at org.apache.ambari.server.orm.DBAccessorImpl.class(DBAccessorImpl.java:75)
  while locating org.apache.ambari.server.orm.DBAccessorImpl
  while locating org.apache.ambari.server.orm.DBAccessor
    for field at org.apache.ambari.server.orm.dao.DaoUtils.dbAccessor(DaoUtils.java:36)
  at org.apache.ambari.server.orm.dao.DaoUtils.class(DaoUtils.java:36)
  while locating org.apache.ambari.server.orm.dao.DaoUtils
    for field at org.apache.ambari.server.orm.dao.AlertsDAO.m_daoUtils(AlertsDAO.java:87)
  at org.apache.ambari.server.orm.dao.AlertsDAO.class(AlertsDAO.java:87)
  while locating org.apache.ambari.server.orm.dao.AlertsDAO
    for field at org.apache.ambari.server.state.services.CachedAlertFlushService.m_alertsDAO(CachedAlertFlushService.java:41)
at org.apache.ambari.server.controller.ControllerModule.bindByAnnotation(ControllerModule.java:585)
Caused by: java.lang.RuntimeException: Error while creating database accessor 
	at org.apache.ambari.server.orm.DBAccessorImpl.(DBAccessorImpl.java:120)
	at org.apache.ambari.server.orm.DBAccessorImpl$$FastClassByGuice$$86dbc63e.newInstance()
	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
	at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:75)
	at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:73)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
	at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
	at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:147)
	at com.google.inject.internal.Initializer.injectAll(Initializer.java:92)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:173)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
	at com.google.inject.Guice.createInjector(Guice.java:95)
	at com.google.inject.Guice.createInjector(Guice.java:72)
	at com.google.inject.Guice.createInjector(Guice.java:62)
	at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1041)
Caused by: java.sql.SQLException: Access denied for user 'ambari'@'ambari01' (using password: YES)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2199)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
	at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:778)
	at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
	at sun.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:247)
	at org.apache.ambari.server.orm.DBAccessorImpl.(DBAccessorImpl.java:93)
	... 43 more
144 errors
	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:175)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
	at com.google.inject.Guice.createInjector(Guice.java:95)
	at com.google.inject.Guice.createInjector(Guice.java:72)
	at com.google.inject.Guice.createInjector(Guice.java:62)
	at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1041)

解决方法:

执行ambari-server setup命令进行ambari安装时候,ambari数据库账号密码不对,重新执行,输入正确的账号密码

你可能感兴趣的:(ambari)