executor

Spark submit提交求PI

一个人想着一个人 提交于 2020-01-25 21:50:40
一. spark提交任务方式: 1.第一种方法:spark-submit:提交任务的,使用spark Demo 求PI,蒙特卡洛求PI(圆周率) [root@bigdata111 spark-2.1.0-bin-hadoop2.7]# ./bin/spark-submit --master spark://bigdata111:7077 --class org.apache.spark.examples.SparkPi /opt/module/spark-2.1.0-bin-hadoop2.7/examples/jars/spark-examples_2.11-2.1.0.jar 1000 结果: 20/01/21 11:16:26 INFO TaskSetManager: Starting task 997.0 in stage 0.0 (TID 997, 192.168.1.122, executor 1, partition 997, PROCESS_LOCAL, 6029 bytes) 20/01/21 11:16:26 INFO TaskSetManager: Finished task 995.0 in stage 0.0 (TID 995) in 11 ms on 192.168.1.122 (executor 1) (996/1000) 20/01/21 11:16

【Spark】(六)Spark 运行流程

≡放荡痞女 提交于 2020-01-25 15:11:32
文章目录 一、Spark中的基本概念 二、Spark的运行流程 2.1 Spark的基本运行流程 1、说明 2、图解 3、Spark运行架构特点 4、DAGScheduler 5、TaskScheduler 6、SchedulerBackend 7、Executor 三、Spark在不同集群中的运行架构 3.1 Spark on Standalone运行过程 3.2 Spark on YARN运行过程 3.2.1 YARN框架流程 3.2.2 YARN-Client 3.2.3 YARN-Cluster 3.2.4 YARN-Client 与 YARN-Cluster 区别 一、Spark中的基本概念 (1)Application:表示你的应用程序 (2)Driver:表示main()函数,创建SparkContext。由SparkContext负责与ClusterManager通信,进行资源的申请,任务的分配和监控等。程序执行完毕后关闭SparkContext (3)Executor:某个Application运行在Worker节点上的一个进程,该进程负责运行某些task,并且负责将数据存在内存或者磁盘上。在Spark on Yarn模式下,其进程名称为 CoarseGrainedExecutor Backend,一个CoarseGrainedExecutor

Databricks Job timed out with error : Lost executor 0 on [IP]. Remote RPC client disassociated

戏子无情 提交于 2020-01-25 10:13:09
问题 Complete error : Databricks Job timed out with error : Lost executor 0 on [IP]. Remote RPC client disassociated. Likely due to containers exceeding thresholds, or network issues. Check driver logs for WARN messages. We are running jobs using Jobs API 2.0 on Azure Databricks subscription and using the Pools interface for less spawn time and using the worker/driver as Standard_DS12_v2. We have a job(JAR main) which has just one SQL procedure call. This call takes more than 1.2 hour to complete.

hadoop 开发&调试

怎甘沉沦 提交于 2020-01-25 04:45:42
写好的hadoop任务打成jar后,可以在服务器上用命令hadoop jar 提交。但开发阶段总不能一直用这种方式来调试,最好是在本机的ide 上可以直接debug。 如果在wiindow上配置一套开发调试环境,说实话真是觉得很不爽。为了以后方便,整理了一下windows 下hadoop开发环境的配置和调试过程。 首先本地下载一个和服务器相同版本的hadoop安装包。 然后配置一个HADOOPHOME环境变量 还要去网上下载window的工具包,需要有下面两个文件。 下载的时候要注意,如果你是安装的32位Jdk 那么下32位的工具包。 把下后的两个文件拷贝到HADOOPHOME bin目录下。 到这里配置还没有完,除了上面几个配置外,不同的场景还需要不同的配置。(我也是很无语)。 为了便于区分,接下来,我将列出本地Hadoop开发调试的四种场景。 1,本机访问Hdfs数据 如果只是访问远程hdfs目录和文件,需要有 %HADOOP_HOME% ,还有 %HADOOP_HOME%\bin \winutils.exe就可以了。 另外运行的时候会有访问权限的问题。主要是纠结hadoop 服务器的用户名和你本地机器用户名不一样。 解决办法有两种 方法1:hdfs-site.xml 加上如下配置,重启。 <property> <name>dfs.permissions</name>

mybatis精讲(六)--二级缓存

强颜欢笑 提交于 2020-01-25 03:14:40
[TOC] 简介 上一章节我们简单了解了二级缓存的配置。今天我们详细分析下二级缓存以及为什么不建议使用二级缓存。 一级缓存针对的是sqlsession。二级缓存针对的是namespace层面的。 配置 之前我们已经提到了配置二级缓存以及配置自定义的二级缓存。下面我们从头开始实现二级缓存。 public Executor newExecutor(Transaction transaction, ExecutorType executorType) { executorType = executorType == null ? defaultExecutorType : executorType; executorType = executorType == null ? ExecutorType.SIMPLE : executorType; Executor executor; if (ExecutorType.BATCH == executorType) { executor = new BatchExecutor(this, transaction); } else if (ExecutorType.REUSE == executorType) { executor = new ReuseExecutor(this, transaction); } else { executor

Spark性能调优之Shuffle调优

假装没事ソ 提交于 2020-01-24 10:06:58
Spark性能调优之Shuffle调优 • Spark底层shuffle的传输方式是使用netty传输,netty在进行网络传输的过程会申请堆外 内存(netty是零拷贝),所以使用了 堆外内存 。 • shuffle过程中常出现的问题 常见问题一:reduce oom? 问题原因: reduce task 去map端获取数据,reduce一边拉取数据一边聚合,reduce端有一块聚合内存(executor memory * 0.2),也就是这块内存不够 解决办法: 1.增加reduce 聚合操作的内存的比例 2.增加Executor memory的大小 --executor-memory 5G 3.减少reduce task每次拉取的数据量 设置 spak.reducer.maxSizeInFlight 24m, 拉取的次数就多了,因此建立连接的次数增多,有可能会连接不上(正好赶上map task端进行GC) 常见问题二:错误描述--shuffle file cannot find or executor lost • 什 么时候需要调节Executor的堆外内存大小? • shuffle file cannot find (DAGScheduler,resubmitting task) • executor lost • task lost • out of memory

【Spark】(七)spark partition 理解 / coalesce 与 repartition的区别

牧云@^-^@ 提交于 2020-01-24 04:24:36
文章目录 一、spark 分区 partition的理解 二、coalesce 与 repartition的区别(我们下面说的coalesce都默认shuffle参数为false的情况) 三、实例 四、总结 一、spark 分区 partition的理解 spark中是以vcore级别调度task 如果读取的是hdfs,那么有多少个block,就有多少个partition 举例来说: sparksql 要读表T, 如果表T有1w个小文件,那么就有1w个partition 这时候读取效率会较低。假设设置资源为 --executor-memory 2g --executor-cores 2 --num-executors 5 。 步骤是: 拿出1-10号10个小文件(也就是10个partition) 分别给5个executor读取(spark调度会以vcore为单位,实际就是5个executor,10个task读10个partition) 如果5个executor执行速度相同,再拿11-20号文件 依次给这5个executor读取 而实际执行速度不会完全相同,那就是哪个task先执行完,哪个task领取下一个partition读取执行,以此类推。这样往往读取文件的调度时间大于读取文件本身,而且会频繁打开关闭文件句柄,浪费较为宝贵的io资源,执行效率也大大降低。 二、coalesce 与

Wait for all threads in an Executor to finish?

微笑、不失礼 提交于 2020-01-23 07:04:27
问题 I'm implementing a parellel quicksort as programming practice, and after I finished, I read the Java tutorial page on Executors, which sound like they could make my code even faster. Unfortunately, I was relying on join()'s to make sure that the program doesn't continue until everything is sorted. Right now I'm using: public static void quicksort(double[] a, int left, int right) { if (right <= left) return; int i = partition(a, left, right); // threads is an AtomicInteger I'm using to make

Java实现异步调用

荒凉一梦 提交于 2020-01-22 07:39:09
一、创建线程 @Test public void test0() throws Exception { System.out.println("main函数开始执行"); Thread thread=new Thread(new Runnable() { @Override public void run() { System.out.println("===task start==="); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("===task finish==="); } }); thread.start(); System.out.println("main函数执行结束"); } 二、Future jdk8之前的实现方式,在JUC下增加了Future,从字面意思理解就是未来的意思,但使用起来却着实有点鸡肋,并不能实现真正意义上的异步,获取结果时需要阻塞线程,或者不断轮询。 @Test public void test1() throws Exception { System.out.println("main函数开始执行"); ExecutorService executor = Executors

Executor框架

陌路散爱 提交于 2020-01-21 08:17:06
目录 Executor框架简介 Executor框架的结构与成员 Executor框架的结构 Executor框架的成员 ThreadPoolExecutor详解 FixedThreadPool详解 SingleThreadExecutor详解 CachedThreadPool详解 ScheduledThreadPoolExecutor详解 ScheduledThreadPoolExecutor的运行机制 ScheduledThreadPoolExecutor的实现 FutureTask详解 FutureTask简介 FutureTask的使用 FutureTask的实现 在Java中,使用线程来异步执行任务。Java线程的创建与销毁需要一定的开销,如果我们 为每一个任务创建一个新线程来执行,这些线程的创建与销毁将消耗大量的计算资源。同时, 为每一个任务创建一个新线程来执行,这种策略可能会使处于高负荷状态的应用最终崩溃。 Java的线程既是工作单元,也是执行机制。从JDK5开始,把工作单元与执行机制分离开 来。工作单元包括Runable和Callable, 而执行机制由Executor框架提供。 Executor框架简介 Executor框架的两级调度模型 在HotSpotVM的线程模型中, Java线程(java.lang. Thread)被一对一映射为本地操作系统线 程。