当前位置:网站首页>Flink production problems (1.10)
Flink production problems (1.10)
2022-06-27 04:58:00 【I had a good shampoo today】
1、TaskManager OOM
Place of occurrence : It happened in flink To mysql Two phase commit phase
reason ① because checkpoint Interval time yes 5 Second , Large amount of data saved , And did not put json Removal of invalid data in data
reason ②flink Default memory allocation , A portion of the memory will be allocated to managed memory , But I don't use it in my code rocksDB State backend , So this part of memory is not needed , You need to adjust the parameters to increase the heap memory taskmanager.memory.managed.fraction=0
2、OOM GC Restart on TaskManager
because gc Long time , Lead to JobManager To TaskManager My heart is broken , At this point, restart another TaskManager, There will be a waste of startup time . You need to adjust the parameters to increase the heartbeat delay time heartbeat.timeout=300000
3、 Communication problems
Due to too few resources , Lead to jvm Failure to respond in a timely manner , Affect the TM and JM Communication for , You need to adjust the timeout akka.ask.timeout=500 s web.timeout=500000
4、 The business problem
Current business scenarios :
One 、
① The upstream kafka There are many. partition, Every partition The data in is through canal monitor mysql Of binlog From the log , And the data is tabulated hash Values are assigned to different partition Medium . Therefore, the change data of each table must be in a certain kafka Of partition In order .
② At this point, our demand is , Orderly synchronize the incremental data of each table to the downstream mysql( The downstream mysql There will be three more fields in the table ,canal Of id, Data es, Type of data ), such as , If it is insert operation , Then downstream mysql Also perform once upsert operation , At this time, the saved data is upstream json In the data data data , At this time, the type is insert; If it is update operation , Then downstream mysql Also perform once upsert operation , At this time, the saved data is upstream json In the data data data , The type is update; If it is delete operation , Then downstream mysql Also perform once upsert operation , At this time, the saved data is upstream json In the data old data , The type is delete;
If there is upstream ddl change , Then the downstream also executes once ddl change .
③ From the above scenario , We must consume the change data of each table in sequence , But this leads to a problem ,subtask Uneven distribution of data , Because there are many table change messages , Some tables have few change messages , So through the table hash Values are assigned to different partition The data in will be different , Lead to flink Consumption time , The data of each degree of parallelism is also uneven .
④ If there is no upstream ddl Change message , We can use the table name + Primary keys are used to process data keyby, Try to make the data more scattered .
⑤ reflection : The current business scenario , Because there is ddl change , How do we put each subtask The data is more uniform ?
d->c->ddl->b->a
hold ddl The previous data were keyby
hold ddl Then the data is processed keyby
It is equivalent to processing batch by batch ,
First, according to the table name keyby, Save a batch of data in each window , Then judge whether there is any in this batch of data ddl, If so, according to ddl Divided into multiple parts , If there is no such thing, it will be a whole ......?
Two 、
The target downstream table has a unique index
边栏推荐
猜你喜欢
How to make ef core 6 support dateonly type
[BJDCTF2020]The mystery of ip
Vue学习笔记(五)Vue2页面跳转问题 | vue-router路由概念、分类与使用 | 编程式路由导航 | 路由组件的缓存 | 5种路由导航守卫 | 嵌套路由 | Vue2项目的打包与部署
快速排序(非递归)和归并排序
Learn crypto from Buu (Zhou Geng)
MobileNet系列(4):MobileNetv3网络详解
Microservice system design -- unified authentication service design
Mysql database foundation: DQL data query language
[C language] keyword supplement
Cultural tourism night tour | stimulate tourists' enthusiasm with immersive visual experience
随机推荐
009 basics of C language: C loop
Is the truth XX coming? Why are test / development programmers unwilling to work overtime? This is a crazy state
笔记本电脑没有WiFi选项 解决办法
Log collection system
math_ Number set (number set symbol) and set theory
微服务系统设计——分布式缓存服务设计
IOS development: understanding of dynamic library shared cache (dyld)
微服务系统设计——分布式锁服务设计
Baidu PaddlePaddle's "universal gravitation" first stop in 2022 landed in Suzhou, comprehensively launching the SME empowerment plan
halcon常用仿射变换算子
Microservice system design - service fusing and degradation design
py2neo基本语法
006 C language foundation: C storage class
日志收集系统
机械转码日记【17】模板,STL简介
020 basics of C language: C language forced type conversion and error handling
微服务系统设计——统一鉴权服务设计
EPICS记录参考5 -- 数组模拟输入记录Array Analog Input (aai)
Microservice system design -- distributed lock service design
躲避小行星游戏