Hadoop 2.6.0 HIVE 2.1.1配置
我用的hadoop 是2.6.0 版本 ,hive 是 2.1.1版本
进入;/home/zkpk/apache-hive-2.1.1-bin/
执行hive 后报错:
(1)Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException:
java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
MetaException(message:Version information not found in metastore. )
Caused by: java.lang.RuntimeException: Unable to instantiate
org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
分析:需要在hive中首先启动 metastore:
使用:
apache-hive-2.1.1-bin/bin/hive --service metastore &
(2)然后报错:
message:Version information not found in metastore.
分析 在hive配置中吧schema设置为不验证:
message:Version information not found in metastore. )”
修改conf/hive-site.xml 中的 “hive.metastore.schema.verification” 值为 false 即可解决 “Caused by: MetaException
(message:Version information not found in metastore. )”
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
<description>
Enforce metastore schema version consistency.
True: Verify that version information stored in metastore matches with one from Hive jars. Also disable automatic
schema migration attempt. Users are required to manully migrate schema after Hive upgrade which ensures
proper metastore schema migration. (Default)
False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.
</description>
</property>
3 执行hive.继续报错误:
MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema
-dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database
in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql))
分析: 需要 使用 schematool工具初始化hive的 元素:
# 进入指定的目录
cd apache-hive-2.1.1-bin/bin/
# 初始化,如果是mysql则derby可以直接替换成mysql
./schematool -initSchema -dbType mysql
然后执行:[root@master bin]# hive
报错:: Permission denied: user=root, access=EXECUTE, inode="/tmp":zkpk:supergroup:drwx------
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:271)
分析:
我一直用zkpk用户部署hive,看来是权限不对
切换账户:
su zkpk
执行::/home/zkpk/apache-hive-2.1.1-bin/bin/hive 正常启动:
hive> show tables;
OK
Time taken: 1.993 seconds
hive>
搞定;
本文来自博客园,作者:aspirant,转载请注明原文链接:https://www.cnblogs.com/aspirant/p/6616575.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?