ambari hive mysql_ambari方式安装hadoop的hive组件遇到的问题
最近在部署hadoop,我发现了ambari工具部署hadoop的hive 组件的一个问题,不知道其他人遇到过没有。
问题描述:通过ambari工具搭建了hadoop2.0完全分布式集群。在测试hive的时候,按照官方文档里的说明通过下面命令检查根目录的时候:总是报错无法连接mysql。(java.sql.SQLException: Access denied foruser 'hive'@'hdb3.yc.com'(using password: YES))
[root@hdb3 bin]# /usr/lib/hive/bin/metatool -listFSRoot
报错关键信息:
1
2
3
4
14/02/20 13:21:09 WARN bonecp.BoneCPConfig: Max Connections < 1. Setting to 20
14/02/20 13:21:09 ERROR Datastore.Schema: Failed initialising database.
Unable to open a test connection to the given database. JDBC url = jdbc:mysql://hdb3.yc.com/hive?createDatabaseIfNotExist=true, username = hive. Terminating connection pool. Original Exception: ------
java.sql.SQLException: Access denied for user 'hive'@'hdb3.yc.com' (using password: YES)
从报错信息初步判断是没有权限访问mysql数据库。但是经过测试,利用hive用户,及密码连接mysql服务器是正常的。而且我在安装之前是在mysql中对hive用户做过授权的。
1
2
3
4
5
6
7
#创建Hive帐号并授权:
mysql> CREATE USER 'hive'@'%' IDENTIFIED BY 'hive_passwd';
Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER 'hive'@'hdb3.yc.com' IDENTIFIED BY 'hive_passwd';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'hive'@'hdb3.yc.com';
Query OK, 0 rows affected (0.00 sec)
测试连接是正常的:
1
2
3
4
5
6
7
8
9
10
11
[root@hda3 ~]# mysql -h hdb3.yc.com -u hive -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 556
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
于是检查hive的配置,在ambari管理页面,如下,hive的配置项中输入了正确的密码。重启hive服务后测试依然会报错。
wKiom1MFm_qQBpIgAAIgb6M32ao228.jpg
后来检查服务器上的配置文件找到的问题原由:
上面那个web页面里配置了hive 数据库的连接密码,但是实际上hive服务器的配置文件里/usr/lib/hive/conf/hive-site.xml并没有密码的相关配置,也就是没有下面这一段参数配置:
1
2
3
4
javax.jdo.option.ConnectionPassword
hive_passwd
手动编辑配置文件增加上这些配置,加入这段密码的配置后,没有重启hive服务,再次执行下面的命令检查根目录,这次不报错了。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[root@hdb3 bin]# /usr/lib/hive/bin/metatool -listFSRoot
Initializing HiveMetaTool..
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
14/02/20 14:29:22 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
14/02/20 14:29:23 INFO metastore.ObjectStore: ObjectStore, initialize called
14/02/20 14:29:23 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/hadoop/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/hive/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
14/02/20 14:29:24 WARN bonecp.BoneCPConfig: Max Connections < 1. Setting to 20
14/02/20 14:29:24 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,Database,Type,FieldSchema,Order"
14/02/20 14:29:24 INFO metastore.ObjectStore: Initialized ObjectStore
14/02/20 14:29:25 WARN bonecp.BoneCPConfig: Max Connections < 1. Setting to 20
Listing FS Roots..
hdfs://hda1.yc.com:8020/apps/hive/warehouse
但是在通过ambari管理界面重启hive服务后又会重新自动给你去掉了。
这导致在执行 /usr/lib/hive/bin/metatool -listFSRoot 命令的时候无法连接mysql数据库。不知道这是我哪里的配置不对还是ambari的bug问题。
阅读(1648) | 评论(0) | 转发(0) |
ambari hive mysql_ambari方式安装hadoop的hive组件遇到的问题相关推荐
- linux hive的作用,Hive的基本应用 - Hadoop和Hive的实践应用_服务器应用_Linux公社-Linux系统门户网站...
前面我已经搭好了Hadoop和hive环境,并且在hive中创建了表page,将数据load了进去.现在我想从这个表中统计每个url的流量,并放到其他关系中数据库中或者展现在页面上,怎么办? 去官网是 ...
- Hive远程模式安装(1.00)
为什么80%的码农都做不了架构师?>>> hiveserver2和metastore分离部署,元数据存储采用mysql,mysql与metastore分离部署. mysql: ...
- Hive环境的安装部署(完美安装)(集群内或集群外都适用)(含卸载自带mysql安装指定版本)...
Hive环境的安装部署(完美安装)(集群内或集群外都适用)(含卸载自带mysql安装指定版本) Hive 安装依赖 Hadoop 的集群,它是运行在 Hadoop 的基础上. 所以在安装 Hive 之 ...
- Hadoop生态圈hive应用
第 1 章 Hive 基本概念 1.1 什么是 Hive Hive:由 Facebook 开源用于解决海量结构化日志的数据统计. Hive 是基于 Hadoop 的一个数据仓库工具,可以将结构化的数据 ...
- 一脸懵逼学习Hive的元数据库Mysql方式安装配置
1:要想学习Hive必须将Hadoop启动起来,因为Hive本身没有自己的数据管理功能,全是依赖外部系统,包括分析也是依赖MapReduce: 2:七个节点跑HA集群模式的: 第一步:必须先将Zook ...
- 【hadoop】hive 安装实践
1.下载Hive安装包: 官网下载:http://hive.apache.org/downloads.html 2.上传Hive的tar包,并解压: 建议和hadoop目录在一级,方便后续使用: 解压 ...
- hive安装测试及Hive 元数据的三种存储方式
一 hive安装测试 1.下载解压 tar -xf hive-x.y.z.tar.gz(本次安装为hive-0.8.1.tar.gz) 将解压后的hive-0.8.1文件放在系统的/home/had ...
- [转]大数据环境搭建步骤详解(Hadoop,Hive,Zookeeper,Kafka,Flume,Hbase,Spark等安装与配置)
大数据环境安装和配置(Hadoop2.7.7,Hive2.3.4,Zookeeper3.4.10,Kafka2.1.0,Flume1.8.0,Hbase2.1.1,Spark2.4.0等) 系统说明 ...
- 手动安装cloudera cdh4.2 hadoop + hbase + hive(一)
安装版本 hadoop-2.0.0-cdh4.2.0 hbase-0.94.2-cdh4.2.0 hive-0.10.0-cdh4.2.0 jdk1.6.0_38 安装前说明 安装目录为/opt 检查 ...
最新文章
- 扩增子分析解读5物种注释,OTU表操作
- 关于Windows不能在本地计算机启动Apache2.......并参考特定服务错误代码1问题解决...
- 【音视频安卓开发 (四)】AndroidStudio项目配置权限、jni库路径、ABI
- iOS回顾笔记( 01 )-- XIB和纯代码创建应用的对比
- 25 PP配置-生产车间控制-工序-定义生产计划参数文件
- c语言程序设计扫雷游戏实验报告,C语言程序设计扫雷游戏实验报告.pdf
- 服务器执行sh文件或目录,将window的shell脚本通过ftp传输到Linux服务器后, shell脚本中执行时提示“没有那个文件或目录”的解决办法...
- BayaiM__ oracle函数_01
- 网络第八和九章要点总结
- SparkSQL简介
- 惠普Teradici PCoIP 受OpenSSL 漏洞影响,波及1500万个端点
- .NET中加密和解密的实现方法
- LinkedList类源码阅读
- JSP学科竞赛管理系统
- Java 爱的循环_郁金花海 Tulip Sea in Love Loop
- 如何生成SSH KEY及查看SSH KEY
- SQL 嵌套 N 层太长太难写怎么办?
- 简单几步,让Mac外接显示器更好用
- 计算机中堆栈的应用举例,西门子S7-200PLC中涉及堆栈操作的指令和梯形图应用实例...
- 【前端】html+css实现鼠标悬浮变色的按钮,消除加粗边框发生抖动现象的两种方法 hover【HTML+CSS+JavaScript(JS)】