Spark遇到的报错和坑
1. Java版本不一致,导致启动报错。
# 解决方法:
在启动脚本最前边添加系统参数,指定Java版本
export JAVA_HOME=/usr/java/jdk1..0_181-amd64/jre
2. Spark1和Spark2并存,启动时报错。
# 在SPARK_HOME中指定启动的spark版本
export SPARK_HOME=/data01/opt/cloudera/parcels/SPARK2-2.3..cloudera3-.cdh5.13.3.p0./lib/spark2
3.缺少Hadoop依赖包
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:)
at java.lang.Class.privateGetMethodRecursive(Class.java:)
at java.lang.Class.getMethod0(Class.java:)
at java.lang.Class.getMethod(Class.java:)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:)
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at java.net.URLClassLoader.findClass(URLClassLoader.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
解决方法:
#添加Hadoop的classpath到SPARK_DIST_CLASSPAHT中
export SPARK_DIST_CLASSPATH=$(hadoop classpath)
4. 报错信息:java.lang.Error: java.lang.InterruptedException: sleep interrupted
Exception in thread "receiver-supervisor-future-0" java.lang.Error: java.lang.InterruptedException: sleep interrupted
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1155)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at org.apache.spark.streaming.receiver.ReceiverSupervisor$$anonfun$restartReceiver$1.apply$mcV$sp(ReceiverSupervisor.scala:196)
at org.apache.spark.streaming.receiver.ReceiverSupervisor$$anonfun$restartReceiver$1.apply(ReceiverSupervisor.scala:189)
at org.apache.spark.streaming.receiver.ReceiverSupervisor$$anonfun$restartReceiver$1.apply(ReceiverSupervisor.scala:189)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
... 2 more
解决方法:
将 ssc.awaitTerminationOrTimeout(1000)
改成ssc.awaitTermination() 即可
5. 报错5
FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
解决方法:
set hive.mapjoin.localtask.max.memory.usage=0.99;
set hive.auto.convert.join=false; Ref: https://blog.csdn.net/qq_21383435/article/details/78593267
Spark遇到的报错和坑的更多相关文章
- IDEA中写MyBatis的xml配置文件编译报错的坑
IDEA中写MyBatis的xml配置文件编译报错的坑 说明:用IDEA编译工具在项目中使用Mybatis框架,编写mybatis-config.xml和Mapper.xml配置文件时,编译项目出现错 ...
- spark提交任务报错: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
spark提交任务报错: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes ...
- Spark程序编译报错error: object apache is not a member of package org
Spark程序编译报错: [INFO] Compiling 2 source files to E:\Develop\IDEAWorkspace\spark\target\classes at 156 ...
- intellij 调试spark scala 程序 报错
spark用的是cdh spark-2.0.1 package main.scala import org.apache.spark.rdd.RDD import org.apache.spark.{ ...
- 【原创】大叔问题定位分享(10)提交spark任务偶尔报错 org.apache.spark.SparkException: A master URL must be set in your configuration
spark 2.1.1 一 问题重现 问题代码示例 object MethodPositionTest { val sparkConf = new SparkConf().setAppName(&qu ...
- spark的bulkload报错及解决
需求 将HDFS上的数据解析出来,然后通过hfile方式批量写入Hbase(需要多列写入) 写入数据的关键api: rdd.saveAsNewAPIHadoopFile( stagingFolder, ...
- VS Code编写Python3 insert 数据库插入无效也不报错的坑~.~
标题最近在开发中需要用到web端开发工具.需要用python工具.偶然发现微软的良心之作:Visual Studio Code,这个大小才几十兆的轻量级代码编辑器,功能却是重量级的,通过插件的方法,, ...
- python MySQL安装依赖报错的坑
0X01 问题 MySQL-python是python调用MySQL的常用库 通常安装时会遇到某些坑. EnvironmentError: mysql_config not found yum -y ...
- Error- Overloaded method value createDirectStream in error Spark Streaming打包报错
直接上代码 StreamingExamples.setStreamingLogLevels() val Array(brokers, topics) = args // Create context ...
随机推荐
- Part8-不用内存怎么行_我从内部看内存lesson1
- 设计模式09: Decorator 装饰模式(结构型模式)
Decorator 装饰模式(结构型模式) 子类复子类,子类何其多加入我们需要为游戏中开发一种坦克,除了不同型号的坦克外,我们还希望在不同场合中为其增加以下一种多种功能:比如红外线夜视功能,比如水路两 ...
- angular 事件绑定
<button (click)="onClick($event)">点我</button> import { Component, OnInit } fro ...
- VS Code 运行html文件
用VS Code编写html文件,想在VS Code中直接打开运行,配置如下: 配置tasks.json 打开VS Code,点击"终端",选择"配置任务". ...
- Nginx conf基本配置
#定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_processes 8; #全局错误日志定义类型,[ debu ...
- Kotlin 函数
至于什么函数,在计算机里面就是一个密闭的执行程序的代码块(个人理解) 我们先来看看什么是函数 fun main(agrs : Array<String>) { println(" ...
- Druid连接池默认配置和坑
一.公司默认配置 ds_0: !!com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.jdbc.Driver url: ...
- 入参为json类型的接口测试示例
一.接口文档内容 二.使用postman(入参为json类型) 如下部分内容即是json串: { "name":"刘星", "grade": ...
- Django template的html明明改了,前端页面居然没有对应变化?!---Django的小坑
写django的时候,我有个模板的名字叫detail.html,被detail视图函数渲染 因为那个detail写乱了,但是里面有东西要参考,我没删掉它,改名为detail_old.html,又在目录 ...
- php常用的系统函数大全
字符串函数 strlen:获取字符串长度,字节长度 substr_count 某字符串出现的次数 substr:字符串截取,获取字符串(按照字节进行截取) mb_strlenmb_substr str ...