【已解決】初始化 Hive 元數據庫報錯slf4j-log4j12-1.7.25.jar包沖突


  • 錯誤log描述

[root@hadoop102 hive]# schematool -initSchema -dbType mysql -verbose
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/module/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL: jdbc:mysql://hadoop102:3306/metastore?useSSL=false
Metastore Connection Driver : com.mysql.jdbc.Driver
Metastore connection User: root
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
Underlying cause: java.lang.ClassNotFoundException : com.mysql.jdbc.Driver
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver

 

 

  • 問題原因

系統配置的路徑中找到兩個slf4j-log4j12-1.7.25.jar不同版本的jar包。

高版本可以向下兼容,可以cd進入低版本jar包的路徑下,修改包名或者直接remove移除。

  • 解決辦法

  cd /opt/module/hadoop-3.1.3/share/hadoop/common/lib/

  rm -rf slf4j-log4j12-1.7.25.jar

 

 

 

 

 問題解決!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM