【已解决】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 版本号一致。

相关推荐

  1. Atlas Hook 导入 Hive 数据

    2023-12-18 06:06:06       33 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-18 06:06:06       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-18 06:06:06       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-18 06:06:06       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-18 06:06:06       18 阅读

热门阅读

  1. 【golang】go执行shell命令行的方法( exec.Command )

    2023-12-18 06:06:06       45 阅读
  2. DOS及DDOS的原理及防御方式

    2023-12-18 06:06:06       34 阅读
  3. Spring Boot中实现订单30分钟自动取消的策略

    2023-12-18 06:06:06       43 阅读
  4. @RabbitHandler和@RabbitListener的区别

    2023-12-18 06:06:06       31 阅读
  5. 自动驾驶自动换道ALC功能规范

    2023-12-18 06:06:06       32 阅读
  6. 展开说说:Android之广播BroadcastReceiver源码浅析

    2023-12-18 06:06:06       38 阅读
  7. Android共享元素动画

    2023-12-18 06:06:06       35 阅读
  8. C++-LD_PRELOAD

    2023-12-18 06:06:06       29 阅读
  9. android 源码编译android 12

    2023-12-18 06:06:06       49 阅读
  10. Linux 系统开机启动流程

    2023-12-18 06:06:06       33 阅读