栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

java.sql.SQLException: Failed to start database ‘metastore

java.sql.SQLException: Failed to start database ‘metastore

详细报错信息如下:

2021-12-19T19:20:16,310 ERROR [cbeeba86-79bb-4066-8f66-3997efd02277 main] pool.HikariPool: HikariPool-1 - Exception during pool initialization.
java.sql.SQLException: Failed to start database 'metastore_db' with class loader sun.misc.Launcher$AppClassLoader@2c8d66b2, see the next exception for details.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_212]
        at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.jdbc.InternalDriver$LoginCallable.call(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.jdbc.InternalDriver$LoginCallable.call(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_212]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_212]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_212]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: org.apache.derby.iapi.error.StandardException: Failed to start database 'metastore_db' with class loader sun.misc.Launcher$AppClassLoader@2c8d66b2, see the next exception for details.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source) ~[derby-10.14.1.0.jar:?]
        ... 15 more
Caused by: org.apache.derby.iapi.error.StandardException: Another instance of Derby may have already booted the database /home/lqs/module/hive/metastore_db.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.raw.data.baseDataFileFactory.privGetJBMSLockonDB(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.raw.data.baseDataFileFactory.run(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_212]
        at org.apache.derby.impl.store.raw.data.baseDataFileFactory.getJBMSLockonDB(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.raw.data.baseDataFileFactory.boot(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.baseMonitor.boot(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.baseMonitor.startModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_212]
        at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.baseMonitor.boot(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.baseMonitor.startModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_212]
        at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.baseMonitor.boot(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.baseMonitor.startModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_212]
        at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source) ~[derby-10.14.1.0.jar:?]
        at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source) ~[derby-10.14.1.0.jar:?]


原因如下:
Hive默认使用的元数据库为derby,开启Hive之后就会占用元数据库,且不与其他客户端共享数据,所以我们需要将Hive的元数据地址改为MySQL。

#解决办法:
1、在Hive的安装目录下将derby.log和metastore_db删除,顺便将hdfs上目录删除

[lqs@bdc112 hive]$ rm -rf derby.log metastore_db
[lqs@bdc112 hive]$ hadoop fs -rm -r /user
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/674211.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号