flink-conf.yaml相关

-------------------------------------------------------------------------

checkpoint相关配置----------------------------

可以在代码里设置,但有的配置项如果都一致,不再想代码里设置,可以在这里配置默认值。

state.backend:状态存储后端,可配置值有'jobmanager', 'filesystem', 'rocksdb'等,在checkpoint数据存储在hdfs上时,配置该值为filesystem

state.checkpoints.dir:checkpoints写出的目录位置,比如:hdfs://ns/flink/flink-checkpoints

state.savepoints.dir:savepoints写出的目录位置,比如:hdfs://ns/flink/flink-checkpoints,一般与上面的值配置一致

execution.checkpointing.mode:检查点模式,默认值EXACTLY_ONCE,可选项AT_LEAST_ONCE

execution.checkpointing.interval:checkpoint的时间间隔,单位毫秒,比如5000

state.checkpoints.num-retained:checkpoint保留的个数,默认值1,不过建议比如设置为3,防止想要恢复更久前的状态,或者最近的一个checkpoint被误删除等情况。

execution.checkpointing.externalized-checkpoint-retention:该配置项定义了在任务取消(cancel,注意不是job failed是主动的cancel)时如何清理外部化的检查点。一般我们会配置为RETAIN_ON_CANCELLATION,即cancel时保留检查点。而DELETE_ON_CANCELLATION则表示cancel任务时删除检查点,只有在任务失败时,才会被保留。

execution.checkpointing.tolerable-failed-checkpoints:允许的连续checkpoint失败的次数,默认值是0,即只要出现checkpoint失败,作业就会失败,然后按照设置了的重启策略开始重启(setRestartStrategy),所以生产环境中一般设置2,即允许偶尔出现checkpoints失败的。

-------------------------------------------------------------------------

taskmanager.numberOfTaskSlots

每个taskmanager提供的插槽数目,默认值1。如果在standalone模式下,则我们一般一个机器界节点启动一个taskmanager,所以配置值一般略小于该机器的CPU数,而运行在yarn上,则要注意适当配置该值大小(相当于申请的vcore),假如只配置1,虽然task之间的隔离性很好(taskmanager挂掉了只影响自己),但是却不利于资源的利用率。太大则隔离性不好,taskmanager挂掉则所有运行在上面的task都将受影响。在yarn模式使用的时候会受到yarn.scheduler.maximum-allocation-vcores值的限制。在yarn模式,flink启动的task manager个数可以参照如下计算公式:num_of_manager = ceil(parallelism / slot) 即并行度除以slot个数,结果向上取整。

io.tmp.dirs

建议将其设置为不会自动定期清除的目录。
Flink 存放本地数据的目录,默认为系统临时目录(java.io.tmpdir 属性)。 如果配置了目录列表,Flink 将在目录之间轮换写文件。
默认情况下,放在这些目录中的数据包括 RocksDB 创建的文件、溢出的中间结果(批处理算法)和缓存的 jar 文件。
此数据不依赖于持久性/恢复,但如果此数据被删除,通常会导致重量级恢复操作。
默认情况下,Yarn 和 Kubernetes 设置会自动将此值配置成自己的本地工作目录。

standalone模式下jobmanager和taskmanager的pid存放位置

默认存放位置放在了/tmp下,会导致过一定时候后pids文件被删除而无法停止程序,所以建议修改存放位置,修改flink-conf.yaml里配置 env.pid.dir 修改为其他目录,一般比如$FLINK_HOME/pids

 jobmanager.rpc.address

jobmanager的监听的rpc主机名。在standalone模式下需要配置

jobmanager.rpc.port

jobmanager的监听的rpc端口,默认值6123。在standalone模式下需要配置

JM内存相关-------------------------------

提交任务时一般只需要配置 jobmanager.memory.process.size,当默认的分配不符合你的需求时,可以再指定其他值。不过要注意的是假如还配置了其他内存值,那总的内存相加值不能大于 jobmanager.memory.process.size的值,不然会报错。

jobmanager.memory.process.size

jobmanager进程消耗的总内存大小,包含Total Flink Memory, JVM Metaspace, and JVM Overhead。在容器化的设置中,该值应该设置为容器内存大小,比如yarn的container内存大小。在standalone模式下,因为被所有任务共用,所以配置大点比如8g,16g。(Total Process Memory size for the JobManager. This includes all the memory that a JobManager JVM process consumes, consisting of Total Flink Memory, JVM Metaspace, and JVM Overhead. In containerized setups, this should be set to the container memory.)

jobmanager.memory.flink.size

jobmanager的总flink内存大小,包含JVM Heap Memory and Off-heap Memory,不包含JVM Metaspace and JVM Overhead。(Total Flink Memory size for the JobManager. This includes all the memory that a JobManager consumes, except for JVM Metaspace and JVM Overhead. It consists of JVM Heap Memory and Off-heap Memory.)

jobmanager.memory.heap.size

jobmanager进程的jvm heap大小。(JVM Heap Memory size for JobManager.)

jobmanager.memory.jvm-metaspace.size

jobmanager进程的jvm metaspace大小。

jobmanager.memory.jvm-overhead.fraction

jobmanager进程的jvm overhead占用process.size的百分比。

(Fraction of Total Process Memory to be reserved for JVM Overhead. This is off-heap memory reserved for JVM overhead, such as thread stack space, compile cache, etc. This includes native memory but not direct memory, and will not be counted when Flink calculates JVM max direct memory size parameter. The size of JVM Overhead is derived to make up the configured fraction of the Total Process Memory. If the derived size is less or greater than the configured min or max size, the min or max size will be used. The exact size of JVM Overhead can be explicitly specified by setting the min and max size to the same value.)

jobmanager.memory.off-heap.size

jobmanager的off-heap内存大小。

(Off-heap Memory size for JobManager. This option covers all off-heap memory usage including direct and native memory allocation. The JVM direct memory limit of the JobManager process (-XX:MaxDirectMemorySize) will be set to this value if the limit is enabled by 'jobmanager.memory.enable-jvm-direct-memory-limit'.)

JM总体内存模型:

TM内存相关-------------------------------

和JM一样,单独配置某些内存项时,内存总和超过taskmanager.memory.process.size就会报错,特别注意下一般我们单独配置heap.size和process.size时,很容易报超内存错,因为有taskmanager.memory.managed.fraction的默认值是占process.size的0.4,所以很容易超了。

taskmanager.memory.process.size

taskmanager进程消耗的总内存大小,它包含Total Flink Memory, JVM Metaspace, and JVM Overhead。在容器化的设置中,该值应该设置为容器内存大小,比如yarn的container内存大小。
(Total Process Memory size for the TaskExecutors. This includes all the memory that a TaskExecutor consumes, consisting of Total Flink Memory, JVM Metaspace, and JVM Overhead. On containerized setups, this should be set to the container memory.

taskmanager.memory.task.heap.size

taskmanager进程的jvm heap大小。假如没设置的话,就是:

总内存大小 - Framework Heap Memory - Framework Off-Heap Memory - Task Off-Heap Memory - Managed Memory - Network Memory
(Task Heap Memory size for TaskExecutors. This is the size of JVM heap memory reserved for tasks. If not specified, it will be derived as Total Flink Memory minus Framework Heap Memory, Framework Off-Heap Memory, Task Off-Heap Memory, Managed Memory and Network Memory.)

taskmanager.memory.managed.size

taskmanager管理的堆外内存,由 MemoryManager 管理,用于中间结果缓存、排序、哈希表等,以及 RocksDB 状态后端。一般不指定由来taskmanager.memory.managed.fraction决定。(Managed Memory size for TaskExecutors. This is the size of off-heap memory managed by the memory manager, reserved for sorting, hash tables, caching of intermediate results and RocksDB state backend. Memory consumers can either allocate memory from the memory manager in the form of MemorySegments, or reserve bytes from the memory manager and keep their memory usage within that boundary. If unspecified, it will be derived to make up the configured fraction of the Total Flink Memory.)

taskmanager.memory.managed.fraction

taskmanager管理的堆外内存占总内存的百分比,默认值是0.4(Fraction of Total Flink Memory to be used as Managed Memory, if Managed Memory size is not explicitly specified.)

TM总体内存模型:

Flink 生产环境配置建议相关推荐

  1. flink生产环境参数配置

    1.flink生产环境配置 2.flink 可配置参数 2.1常用选项 键 默认 描述 jobmanager.heap.size 1024MB JobManager的JVM堆大小. taskmanag ...

  2. vue3.0生产环境和正式环境配置_vue开发环境和生产环境配置

    开发环境配置 一般情况下开发环境是会跨域的,所以我们只需要在跨域的位置配置即可.进入config/index.js,在proxyTable对象里面添加代码,如下: '/api': { target: ...

  3. Vue.config.js开发环境与生产环境配置

    Vue.config.js开发环境与生产环境配置 首先在项目根目录创建 .env.development 开发环境 .env.production 生产环境 VUE_APP_SERVICE_URL V ...

  4. React多页面应用5(webpack生产环境配置,包括压缩js代码,图片转码等)

    本教程总共7篇,每日更新一篇,请关注我们!你可以进入历史消息查看以往文章,也敬请期待我们的新文章! 1.React多页面应用1(webpack开发环境搭建,包括Babel.热更新等) ----2017 ...

  5. Vue——10 - webpack打包保姆级教程01——打包js、json、css、less、html、背景图片以及图片、字体(Font)文件,devsever,生产环境配置以及css的兼容写法

    目录 一.webpack打包JS文件 1.新建入口文件index.js和mathUtils.js,index.js是依赖于mathUtils.js 2.然后使用webpack命令打包js文件 二.打包 ...

  6. MongoDB认识与生产环境配置

    MongoDB作为NoSql数据库中最关系型的,是解决传统关系型数据库在业务不断复杂,数据量逐渐变大的大数据解决方案之一. 本文主要以官网为参考主题,介绍在搭建生产环境时,可能有用的配置,接下来的一段 ...

  7. JBOSS优化--比较有用的生产环境配置

    转自:http://wangtong40.iteye.com/blog/737235 Java OPTS设置 在Java的Jvm分为主要为两大块:一个是heap和 nheap Heap包括三个区域. ...

  8. 学习笔记Flink(五)—— Flink开发环境配置及运行实例(单词计数)

    一.Intellij IDEA 环境配置 1.创建Maven工程 1.1.开发环境 Maven && JDK 1.2.Pom配置 Compiler Configuration 在pom ...

  9. 开发测试服务器配置信息,node服务端中台实现及开发测试生产环境配置

    本人node服务端新人一枚,网上找了不少资料,看了很多别人的配置信息,感觉都不是很合适,看的多了自己也明白配置的具体思路跟实现方式了,以下为我的实现方式.通过package.json里面的script ...

最新文章

  1. python 求反函数_逆累积分布函数,累积分布函数及python实现
  2. Hey, everybody!
  3. Redis(十二):Redis事务的基本操作
  4. noj数据结构稀疏矩阵的加法十字链表_数据结构之:图
  5. C语言——二维数组转置
  6. 设计模式的C语言应用-命令模式-第五章
  7. python掷骰子小游戏编程入门_MicroPython实战:开发一款掷骰子小游戏
  8. win10 电脑桌面任务栏点击无反应
  9. 单片机c语言*乘法,单片机c语言教程:运算符和表达式(位运算符)
  10. CSDN博客成长记录
  11. Synaptics 蠕虫病毒
  12. linux屏幕怎么暗一点,Ubuntu 12.10 调节屏幕亮度经验分享
  13. 上午写了一段代码,下午就被开除了。。。
  14. 2022年湖南省自考考试学前教育幼儿园课程练习题及答案
  15. p1468 Party Lamps
  16. mysql数据字段属性
  17. 001 JAVA知识体系
  18. 小姐姐太强了,动图展示 10 大 Git 命令,不会都难
  19. Perl split函数
  20. 技术交流电脑BUG.sssss

热门文章

  1. XtraReport显示行序号
  2. 深度学习算法(第37期)----如何用强化学习玩游戏?
  3. 有一种空格叫做--不间断空格(空格保存到数据库变成了问号)
  4. Windows Git 多用户多仓库配置
  5. 转 为什么数码相机可以拍出彩色照片?
  6. 什么都会,也许只是盲目跟风,和优秀无关
  7. 500 内部服务器错误 解决方法
  8. 嵌入式了解 以及学习路线
  9. 谈谈从PC端到移动端的产品设计差异
  10. passcode - pwnable