【已解决】Atlas 导入 Hive 元数据,执行 import-hive.sh 报错

部署完 Atlas 之后,尝试导入 Hive 元数据,遇到了一些错误,特此记录一下,方便你我他。

执行 import-hive.sh 报错

[omc@hadoop102 apache-atlas-2.2.0]$ hook-bin/import-hive.sh
Using Hive configuration directory [/opt/module/hive/conf]
Log file for import is /opt/module/apache-atlas-2.2.0/logs/import-hive.log
2023-12-17T15:48:37,827 INFO [main] org.apache.atlas.hive.bridge.HiveMetaStoreBridge - delete non existing flag : false
2023-12-17T15:48:37,846 INFO [main] org.apache.atlas.ApplicationProperties - Looking for atlas-application.properties in classpath
2023-12-17T15:48:37,847 INFO [main] org.apache.atlas.ApplicationProperties - Loading atlas-application.properties from file:/opt/module/hive/conf/atlas-application.properties
2023-12-17T15:48:37,883 INFO [main] org.apache.atlas.ApplicationProperties - Using graphdb backend 'janus'
2023-12-17T15:48:37,883 INFO [main] org.apache.atlas.ApplicationProperties - Using storage backend 'hbase2'
2023-12-17T15:48:37,883 INFO [main] org.apache.atlas.ApplicationProperties - Using index backend 'solr'
2023-12-17T15:48:37,883 INFO [main] org.apache.atlas.ApplicationProperties - Atlas is running in MODE: PROD.
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Setting solr.wait-searcher property 'false'
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Setting index.search.map-name property 'false'
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Setting atlas.graph.index.search.max-result-set-size = 150
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Setting atlas.graph.index.search.solr.wait-searcher = false
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.db-cache = true
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.db-cache-clean-wait = 20
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.db-cache-size = 0.5
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.tx-cache-size = 15000
2023-12-17T15:48:37,887 INFO [main] org.apache.atlas.ApplicationProperties - Property (set to default) atlas.graph.cache.tx-dirty-size = 120
Enter username for atlas :- admin
Enter password for atlas :-
2023-12-17T15:48:44,649 INFO [main] org.apache.atlas.AtlasBaseClient - Client has only one service URL, will use that for all actions: http://192.168.10.102:21000
2023-12-17T15:48:44,690 INFO [main] org.apache.hadoop.hive.conf.HiveConf - Found configuration file file:/opt/module/hive/conf/hive-site.xml
2023-12-17T15:48:45,786 WARN [main] org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2023-12-17T15:48:45,884 INFO [main] org.apache.hadoop.hive.metastore.HiveMetaStoreClient - Trying to connect to metastore with URI thrift://hadoop102:9083
2023-12-17T15:48:45,921 INFO [main] org.apache.hadoop.hive.metastore.HiveMetaStoreClient - Opened a connection to metastore, current connections: 1
2023-12-17T15:48:46,013 INFO [main] org.apache.hadoop.hive.metastore.HiveMetaStoreClient - Connected to metastore.
2023-12-17T15:48:46,013 INFO [main] org.apache.hadoop.hive.metastore.RetryingMetaStoreClient - RetryingMetaStoreClient proxy=class org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient ugi=omc (auth:SIMPLE) retries=1 delay=1 lifetime=0
2023-12-17T15:48:46,291 INFO [main] org.apache.atlas.hive.bridge.HiveMetaStoreBridge - Importing Hive metadata
2023-12-17T15:48:46,310 INFO [main] org.apache.atlas.hive.bridge.HiveMetaStoreBridge - Found 7 databases
2023-12-17T15:48:46,439 INFO [main] org.apache.atlas.AtlasBaseClient - method=GET path=api/atlas/v2/entity/uniqueAttribute/type/ contentType=application/json; charset=UTF-8 accept=application/json status=200
2023-12-17T15:48:46,646 INFO [main] org.apache.atlas.hive.bridge.HiveMetaStoreBridge - Database default is already registered - id=eb2c0a75-1984-404c-8cdb-0dcbfc3e74ae. Updating it.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hdfs/HdfsConfiguration
        at org.apache.atlas.utils.HdfsNameServiceResolver.init(HdfsNameServiceResolver.java:139)
        at org.apache.atlas.utils.HdfsNameServiceResolver.<clinit>(HdfsNameServiceResolver.java:47)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.toDbEntity(HiveMetaStoreBridge.java:606)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerDatabase(HiveMetaStoreBridge.java:461)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importDatabases(HiveMetaStoreBridge.java:322)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importHiveMetadata(HiveMetaStoreBridge.java:292)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.main(HiveMetaStoreBridge.java:192)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.HdfsConfiguration
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more
Failed to import Hive Meta Data!!!
[omc@hadoop102 apache-atlas-2.2.0]$

在 $HIVE_HOME/lib 目录下添加 hadoop-hdfs-client-3.1.3.jar 即可。

说明:版本号要和自己的 Hadoop 版本号一致。

相关推荐
武子康19 小时前
大数据-259 离线数仓 - Griffin架构 修改配置 pom.xml sparkProperties 编译启动
xml·java·大数据·hive·hadoop·架构
出发行进1 天前
Hive其四,Hive的数据导出,案例展示,表类型介绍
数据仓库·hive·hadoop
武子康1 天前
大数据-258 离线数仓 - Griffin架构 配置安装 Livy 架构设计 解压配置 Hadoop Hive
java·大数据·数据仓库·hive·hadoop·架构
lucky_syq2 天前
Hive SQL和Spark SQL的区别?
hive·sql·spark
武子康3 天前
大数据-257 离线数仓 - 数据质量监控 监控方法 Griffin架构
java·大数据·数据仓库·hive·hadoop·后端
清平乐的技术专栏4 天前
Hive SQL 查询所有函数
hive·hadoop·sql
csding114 天前
写入hive metastore报问题Permission denied: user=hadoop,inode=“/user/hive”
数据仓库·hive·hadoop
神秘打工猴4 天前
hive常用函数有哪些
hive
lucky_syq5 天前
Hive与HBase的区别有哪些
hive·hadoop·hbase
出发行进5 天前
Hive其五,使用技巧,数据查询,日志以及复杂类型的使用
大数据·hive·数据分析