引起:ERROR XSDB6:另一个 Derby 实例可能已经启动了数据库 [英] Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database

查看:31
本文介绍了引起:ERROR XSDB6:另一个 Derby 实例可能已经启动了数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行 SparkSQL:

I am trying to run SparkSQL :

val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)  

但我得到的错误如下:

        ... 125 more
Caused by: java.sql.SQLException: Another instance of Derby may have already booted the database /root/spark/bin/metastore_db.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        ... 122 more
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /root/spark/bin/metastore_db.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)

我看到有一个 metastore_db 文件夹存在..
我的 hive Metastore 包括 mysql 作为 Metastore.但不知道为什么错误显示为 derby execption

I see there is a metastore_db folder exists..
My hive metastore includes mysql as metastore.But not sure why the error shows as derby execption

推荐答案

我在 Spark Shell 上创建数据帧时遇到同样的错误:

I was getting the same error while creating Data frames on Spark Shell :

原因:ERROR XSDB6:另一个 Derby 实例可能已经启动了数据库/metastore_db.

原因:

我发现这是因为有多个其他 Spark-Shell 实例已经在运行并持有 derby DB,所以当我启动另一个 Spark Shell 并使用 RDD.toDF() 在其上创建数据帧时,它是抛出错误:

I found that this is happening as there were multiple other instances of Spark-Shell already running and holding derby DB already, so when i was starting yet another Spark Shell and creating Data Frame on it using RDD.toDF() it was throwing error:

解决方案:

我运行了 ps 命令来查找 Spark-Shell 的其他实例:

I ran the ps command to find other instances of Spark-Shell:

ps -ef |grep spark-shell

然后我用 kill 命令杀死了他们:

and i killed them all using kill command:

kill -9 Spark-Shell-processID(例如:kill -9 4848)

在所有 SPark-Shell 实例都消失后,我启动了一个新的 SPark SHell 并重新运行了我的数据框函数,它运行得很好:)

这篇关于引起:ERROR XSDB6:另一个 Derby 实例可能已经启动了数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆