spark-shell Caused by: java.sql.SQLException: Failed to start database 'metastore_db' with ....

主要错误信息如下:
Caused by: org.apache.derby.iapi.error.StandardException: Container Container(0, 401) cannot be opened; it either has been dropped or does not exist.

Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

Caused by: java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@65d9e72a, see the next exception for details.

Caused by: ERROR 40XD2: Container Container(0, 401) cannot be opened; it either has been dropped or does not exist.
......
原因:可能之前您的环境和hive整合过
解决方法:
删除spark安装目录下的metastore_db目录,再次启动报如下错误
java.lang.IllegalArgumentException: Error while instantiating 
'org.apache.spark.sql.hive.HiveSessionState':
Caused by: java.net.ConnectException: Call From bigdata131/192.168.137.131 to 
bigdata131:9000

原因:可能您之前和yarn整合过
解决方法:
方法1:启动hdfs
方法2:修改spark配置文件和HADOOP相关的内容
  vim ./conf/spark-env.sh
  #export HADOOP_CONF_DIR=/root/training/hadoop-2.8.5/etc/hadoop 将这行改为
  export HADOOP_CONF_DIR=  注意这里值给空,但是变量要存在
  再次启动
  ./bin/spark-shell --master spark://bigdata131:7077
  ......
  Spark session available as 'spark'.
  Welcome to
  ____              __
  / __/__  ___ _____/ /__
  _\ \/ _ \/ _ `/ __/  '_/
  /___/ .__/\_,_/_/ /_/\_\   version 2.1.0
  /_/

  Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_144)
  Type in expressions to have them evaluated.
  Type :help for more information.
  scala>

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值