hive_异常_01_hive启动异常-Role admin already exists(未解决)

简介: 一、异常信息 hive安装成功之后,执行hive命令时,控制台正常,但是通过命令: hive -hiveconf hive.root.logger=DEBUG,console;   去查看日志时,却发现出现报如下异常: 18/03/26 18:18:29 [main]: DEBUG metastore.

一、异常信息

hive安装成功之后,执行hive命令时,控制台正常,但是通过命令:

hive -hiveconf hive.root.logger=DEBUG,console;

 

去查看日志时,却发现出现报如下异常:

18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Rollback transaction, isActive: true at:
        org.apache.hadoop.hive.metastore.ObjectStore.addRole(ObjectStore.java:3215)
18/03/26 18:18:29 [main]: DEBUG metastore.HiveMetaStore: admin role already exists
InvalidObjectException(message:Role admin already exists.)
        at org.apache.hadoop.hive.metastore.ObjectStore.addRole(ObjectStore.java:3205)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:98)
        at com.sun.proxy.$Proxy5.addRole(Unknown Source)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles_core(HiveMetaStore.java:642)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles(HiveMetaStore.java:631)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:449)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5576)
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:193)
        at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:74)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1483)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:64)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:74)
        at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2841)
        at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2860)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:453)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
18/03/26 18:18:29 [main]: INFO metastore.HiveMetaStore: Added admin role in metastore
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Open transaction: count = 1, isActive = true at:
        org.apache.hadoop.hive.metastore.ObjectStore.addRole(ObjectStore.java:3202)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Open transaction: count = 2, isActive = true at:
        org.apache.hadoop.hive.metastore.ObjectStore.getMRole(ObjectStore.java:3509)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Commit transaction: count = 1, isactive true at:
        org.apache.hadoop.hive.metastore.ObjectStore.getMRole(ObjectStore.java:3515)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Rollback transaction, isActive: true at:
        org.apache.hadoop.hive.metastore.ObjectStore.addRole(ObjectStore.java:3215)
18/03/26 18:18:29 [main]: DEBUG metastore.HiveMetaStore: public role already exists
InvalidObjectException(message:Role public already exists.)
        at org.apache.hadoop.hive.metastore.ObjectStore.addRole(ObjectStore.java:3205)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:98)
        at com.sun.proxy.$Proxy5.addRole(Unknown Source)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles_core(HiveMetaStore.java:651)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles(HiveMetaStore.java:631)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:449)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5576)
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:193)
        at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:74)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1483)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:64)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:74)
        at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2841)
        at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2860)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:453)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
18/03/26 18:18:29 [main]: INFO metastore.HiveMetaStore: Added public role in metastore
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Open transaction: count = 1, isActive = true at:
        org.apache.hadoop.hive.metastore.ObjectStore.grantPrivileges(ObjectStore.java:3894)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Open transaction: count = 2, isActive = true at:
        org.apache.hadoop.hive.metastore.ObjectStore.getMRole(ObjectStore.java:3509)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Commit transaction: count = 1, isactive true at:
        org.apache.hadoop.hive.metastore.ObjectStore.getMRole(ObjectStore.java:3515)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Open transaction: count = 2, isActive = true at:
        org.apache.hadoop.hive.metastore.ObjectStore.listPrincipalGlobalGrants(ObjectStore.java:4379)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Commit transaction: count = 1, isactive true at:
        org.apache.hadoop.hive.metastore.ObjectStore.listPrincipalGlobalGrants(ObjectStore.java:4389)
18/03/26 18:18:29 [main]: DEBUG metastore.ObjectStore: Rollback transaction, isActive: true at:
        org.apache.hadoop.hive.metastore.ObjectStore.grantPrivileges(ObjectStore.java:4097)
18/03/26 18:18:29 [main]: DEBUG metastore.HiveMetaStore: Failed while granting global privs to admin
InvalidObjectException(message:All is already granted by admin)
        at org.apache.hadoop.hive.metastore.ObjectStore.grantPrivileges(ObjectStore.java:3930)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:98)
        at com.sun.proxy.$Proxy5.grantPrivileges(Unknown Source)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles_core(HiveMetaStore.java:665)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles(HiveMetaStore.java:631)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:449)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5576)
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:193)
        at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:74)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1483)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:64)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:74)
        at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2841)
        at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2860)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:453)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
18/03/26 18:18:29 [main]: INFO metastore.HiveMetaStore: No user is added in admin role, since config is empty
18/03/26 18:18:29 [main]: DEBUG hdfs.BlockReaderLocal: dfs.client.use.legacy.blockreader.local = false
18/03/26 18:18:29 [main]: DEBUG hdfs.BlockReaderLocal: dfs.client.read.shortcircuit = false
18/03/26 18:18:29 [main]: DEBUG hdfs.BlockReaderLocal: dfs.client.domain.socket.data.traffic = false
18/03/26 18:18:29 [main]: DEBUG hdfs.BlockReaderLocal: dfs.domain.socket.path = 
18/03/26 18:18:29 [main]: DEBUG hdfs.DFSClient: No KeyProvider found.
18/03/26 18:18:29 [main]: DEBUG retry.RetryUtils: multipleLinearRandomRetry = null
18/03/26 18:18:29 [main]: DEBUG ipc.Server: rpcKind=RPC_PROTOCOL_BUFFER, rpcRequestWrapperClass=class org.apache.hadoop.ipc.ProtobufRpcEngine$RpcRequestWrapper, rpcInvoker=org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker@355a8e36
18/03/26 18:18:29 [main]: DEBUG ipc.Client: getting client out of cache: org.apache.hadoop.ipc.Client@2a9f6888
18/03/26 18:18:30 [main]: DEBUG util.PerformanceAdvisory: Both short-circuit local reads and UNIX domain socket are disabled.
18/03/26 18:18:30 [main]: DEBUG sasl.DataTransferSaslUtil: DataTransferProtocol not using SaslPropertiesResolver, no QOP found in configuration for dfs.data.transfer.protection
18/03/26 18:18:30 [main]: DEBUG ipc.Client: The ping interval is 60000 ms.

 

 

二、异常原因

 1.别人的原因

网上有说是:字符集问题

 

2.我的原因

按照网上说的字符集问题的解决方法试了一下,还是不能解决问题。

 

猜想可能是hive版本的问题,可是CDH版本一致的情况下,还会出现版本冲突的问题吗?纠结

 

三、异常解决

 

四、参考资料

1.字符集问题

 (1)Hive创建表格报【Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException】引发的血案

 

目录
相关文章
|
7月前
|
SQL 分布式计算 关系型数据库
使用 Spark 抽取 MySQL 数据到 Hive 时某列字段值出现异常(字段错位)
在 MySQL 的 `order_info` 表中,包含 `order_id` 等5个字段,主要存储订单信息。执行按 `create_time` 降序的查询,显示了部分结果。在 Hive 中复制此表结构时,所有字段除 `order_id` 外设为 `string` 类型,并添加了 `etl_date` 分区字段。然而,由于使用逗号作为字段分隔符,当 `address` 字段含逗号时,数据写入 Hive 出现错位,导致 `create_time` 值变为中文字符串。问题解决方法包括更换字段分隔符或使用 Hive 默认分隔符 `\u0001`。此案例提醒在建表时需谨慎选择字段分隔符。
152 6
Hive中的in、exists和left semi join
Hive中的in、exists和left semi join
Hive中的in、exists和left semi join
|
SQL 分布式计算 Java
sqoop to hive GC overhead limit exceeded 大表抽取到hive中发生异常
如果你已经试过了别的博客提供的修改内存的方法,但是美效果的话,不妨看看我的解决办法。 为什么Sqoop Import抛出这个异常?
269 0
|
SQL Java Apache
hive_异常_01_(未解决)FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org.apache.hadoop.hbase.HTableDescriptor.addFamily
一、异常现象 单独的 hadoop、hbase 、hive 都是正常的,但是在 hive 整合hbase 时,在 hive中输入以下建表语句, CREATE TABLE hbase_table_1(key int, value string) STORED BY 'org.
4652 0
|
SQL 分布式计算 大数据
HIVE MapJoin异常问题处理总结
HIVE被很广泛的使用,使用过程中也会遇到各种千奇百怪的问题。这里就遇到的MapJoin Local 内存不足的问题进行讨论,从问题描述、mapjion原理以及产生该问题的原因,解决方案做一下介绍,最后对该问题进行了进一步的思考,希望对解决该类问题的朋友有所帮助。
15040 1
|
SQL 分布式计算 监控
hive在E-MapReduce集群的实践(一)hive异常排查入门
hive是hadoop集群最常用的数据分析工具,只要运行sql就可以分析海量数据。初学者在使用hive时,经常会遇到各种问题,不知道该怎么解决。 本文是hive实践系列的第一篇,以E-MapReduce集群环境为例,介绍常见的hive执行异常,定位和解决方法,以及hive日志查看方法。
6950 0
|
SQL Java 关系型数据库
hive_异常_01_ Terminal initialization failed; falling back to unsupported
一、异常现象 hive初始化数据库时,在执行了 schematool -initSchema -dbType mysql 这个命令时,终端抛出如下异常: [ray@rayner bin]$ schematool -initSchema -dbType mysql Met...
1956 0
|
SQL HIVE
hive 异常 (Attempt to do update or delete on table terminal that does not use an )
    hive 异常 (Attempt to do update or delete on table terminal that does not use an )   hive > delete from terminal where 1=1 ;  出现以下    ...
2298 0
|
SQL HIVE
FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory异常的解决
<div style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px"> hive&gt; select * from dummy;</div> <div style="color:rgb(51,51,51); font-family:Arial; font-size:14px; lin
1632 0