數據分析——Hive數據庫初始化失敗Error: FUNCTION 'NUCLEUS_ASCII' already exists.


進入Hive交互系統,“show databases:”。出現報錯:

Failed to start database 'metastore_db' with class loader sun.misc.Launcher$AppClassLoader

經查找是因為數據庫初始化的問題。

進入終端初始化數據庫

[hadoop@master apache-hive-3.1.1-bin]$ ./bin/schematool -dbType derby -initSchema

報錯:

Metastore Connection Driver :     org.apache.derby.jdbc.EmbeddedDriver
Metastore connection User:     APP
Starting metastore schema initialization to 3.1.0
Initialization script hive-schema-3.1.0.derby.sql

 
Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
Use --verbose for detailed stacktrace.
*** schemaTool failed ***

解決:刪除apache-hive-3.1.1-bin文件夾下的metastore_db文件

[hadoop@master apache-hive-3.1.1-bin]$ rm -rf metastore_db

重新初始化數據庫,進入hive交互模式show databases;成功。


免責聲明!

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



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