Flink å¦ä¹
麻ç¦è·¯è¿çåä½äº²ç»è¿ä¸ªé¡¹ç®ç¹ä¸ª starï¼å¤ªä¸æäºï¼åäºè¿ä¹å¤ï¼ç®æ¯å¯¹æåæä¸æ¥çä¸ç§é¼å±å§ï¼å¦å¤ç¹å«æè°¢ JetBrains å
¬å¸æä¾çå
è´¹å
¨å®¶æ¡¶å·¥å
·ï¼ðððï¼
Stargazers over time
æ¬é¡¹ç®ç»æ
How to build
Maybe your Maven conf file settings.xml
mirrors can add aliyun central mirror :
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/central</url>
</mirror>
then you can run the following command :
mvn clean package -Dmaven.test.skip=true
you can see following result if build success.
Flink ç³»ç»ä¸æ
åºäº Flink 1.9 讲解çä¸æ ï¼æ¶åå
¥é¨ãæ¦å¿µãåçãå®æãæ§è½è°ä¼ãç³»ç»æ¡ä¾ç讲解ãæ«ç ä¸é¢ä¸æ äºç»´ç å¯ä»¥è®¢é
该ä¸æ
é¦åå°åï¼http://www.54tianzhisheng.cn/2019/11/15/flink-in-action/
ä¸æ å°åï¼https://gitbook.cn/gitchat/column/5dad4a20669f843a1a37cb4f
Change
2022/02/26 å°èªå·± ãFlink å®æä¸æ§è½ä¼åãä¸æ æ¾å¨ GitHubï¼åè§ books ç®å½
2021/12/18 å°è¯¥é¡¹ç®ç Flink çæ¬åçº§è³ 1.14.2ï¼å¦ææéè¦å¯ä»¥å»èçåæ¯æ¥çã
2021/08/15 å°è¯¥é¡¹ç®ç Flink çæ¬åçº§è³ 1.13.2ï¼API åçé大æ¹åï¼æ以代ç ç»æä¹åäºç¸åºçè°æ´ï¼é¨å代ç å¨ master åæ¯å·²ç»å é¤ï¼åæ¶å°ä¹åç代ç åå° feature/flink-1.10.0 ä¸äºï¼å¦ææéè¦å¯ä»¥å»èçåæ¯æ¥çï¼ã
2020/02/16 å°è¯¥é¡¹ç®ç Flink çæ¬åçº§è³ 1.10ï¼è¯¥çæ¬ä»£ç é½æ¯ç»è¿æµè¯æåè¿è¡çï¼å°½é以该çæ¬ä½ä¸ºåèï¼å¦æ代ç å¨ä½ 们é群æµè¯ä¸æåï¼éº»ç¦æ£æ¥ Flink çæ¬æ¯å¦ä¸è´ï¼æè
æ¯å¦æå
å²çªé®é¢ã
2019/09/06 å°è¯¥é¡¹ç®ç Flink çæ¬åçº§å° 1.9.0ï¼æä¸äºåå¨ï¼Flink 1.8.0 çæ¬ç代ç ç»ç¾¤é讨论ä¿åå¨åæ¯ feature/flink-1.8.0 以便é¨ååå¦éè¦ã
2019/06/08 åæ¬ Flink 书ç±ï¼
2019/06/09 æ°å¢æµå¤çå¼æç¸å
³ç Paperï¼å¨ paper ç®å½ä¸ï¼
ãæ示ãï¼å
³äºä¹¦ç±çä¸è½½ï¼å çæé®é¢ï¼ä¸æ¹ä¾¿æä¾ï¼æ以已ç»å é¤ï¼éè¦çè¯å¯ä»¥åæ¢å°èåæ¯å»ä¸è½½ã
å客
1ãFlink ä»0å°1å¦ä¹ ââ Apache Flink ä»ç»
2ãFlink ä»0å°1å¦ä¹ ââ Mac ä¸æ建 Flink 1.6.0 ç¯å¢å¹¶æ建è¿è¡ç®åç¨åºå
¥é¨
3ãFlink ä»0å°1å¦ä¹ ââ Flink é
ç½®æ件详解
4ãFlink ä»0å°1å¦ä¹ ââ Data Source ä»ç»
5ãFlink ä»0å°1å¦ä¹ ââ å¦ä½èªå®ä¹ Data Source ï¼
6ãFlink ä»0å°1å¦ä¹ ââ Data Sink ä»ç»
7ãFlink ä»0å°1å¦ä¹ ââ å¦ä½èªå®ä¹ Data Sink ï¼
8ãFlink ä»0å°1å¦ä¹ ââ Flink Data transformation(转æ¢)
9ãFlink ä»0å°1å¦ä¹ ââ ä»ç» Flink ä¸ç Stream Windows
10ãFlink ä»0å°1å¦ä¹ ââ Flink ä¸çå ç§ Time 详解
11ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° ElasticSearch
12ãFlink ä»0å°1å¦ä¹ ââ Flink 项ç®å¦ä½è¿è¡ï¼
13ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° Kafka
14ãFlink ä»0å°1å¦ä¹ ââ Flink JobManager é«å¯ç¨æ§é
ç½®
15ãFlink ä»0å°1å¦ä¹ ââ Flink parallelism å Slot ä»ç»
16ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®æ¹éåå
¥å° MySQL
17ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° RabbitMQ
18ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° HBase
19ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° HDFS
20ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° Redis
21ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° Cassandra
22ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° Flume
23ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° InfluxDB
24ãFlink ä»0å°1å¦ä¹ ââ Flink 读å Kafka æ°æ®åå
¥å° RocketMQ
25ãFlink ä»0å°1å¦ä¹ ââ ä½ ä¸ä¼ ç jar å
èå°åªéå»äº
26ãFlink ä»0å°1å¦ä¹ ââ ä½ ç Flink job æ¥å¿è·å°åªéå»äº
Flink æºç 项ç®ç»æ
å¦ä¹ èµæ
å¦å¤æèªå·±æ´çäºäº Flink çå¦ä¹ èµæï¼ç®åå·²ç»å
¨é¨æ¾å°å¾®ä¿¡å
¬ä¼å·äºã
ä½ å¯ä»¥å æç微信ï¼yuanblog_tzsï¼ç¶ååå¤å
³é®åï¼Flink å³å¯æ æ¡ä»¶è·åå°ï¼è½¬è½½è¯·èç³»æ¬äººè·åææï¼è¿è
å¿
究ã
æ´å¤ç§å¯èµæ请å å
¥ç¥è¯æçï¼
æ人è¦é®ç¥è¯æçéé¢æ´æ°ä»ä¹å
容ï¼å¼å¾å å
¥åï¼
ç®åç¥è¯æçå
å·²æ´æ°çç³»åæç« ï¼
大æ°æ®éç£
ç¸å¼¹
1ãã大æ°æ®éç£
ç¸å¼¹ââå®æ¶è®¡ç®å¼æ Flinkãå¼ç¯è¯
2ãä½ å
¬å¸å°åºéä¸éè¦å¼å
¥å®æ¶è®¡ç®å¼æï¼
3ãä¸æè®©ä½ å½»åºäºè§£å¤§æ°æ®å®æ¶è®¡ç®æ¡æ¶ Flink â
4ãå«åå»å»çåä¸æ¸
大æ°æ®æ¡æ¶FlinkãBlinkãSpark StreamingãStructured StreamingåStormä¹é´çåºå«äºâ
5ãFlink ç¯å¢åå¤çè¿ä¸ç¯å°±å¤äº â
6ãä¸æè®²è§£ä» Flink ç¯å¢å®è£
å°æºç ç¼è¯è¿è¡
7ãéè¿ WordCount ç¨åºæä½ å¿«éå
¥é¨ä¸æ Flink ââ
8ãFlink å¦ä½å¤ç Socket æ°æ®ååæå®ç°è¿ç¨ â
9ãFlink job å¦ä½å¨ StandaloneãYARNãMesosãK8S ä¸é¨ç½²è¿è¡ï¼
10ãFlink æ°æ®è½¬æ¢å¿
é¡»çæçç®åï¼Operatorï¼
11ãFlink ä¸ Processing TimeãEvent TimeãIngestion Time 对æ¯åå
¶ä½¿ç¨åºæ¯åæ
12ãå¦ä½ä½¿ç¨ Flink Window å Window åºæ¬æ¦å¿µä¸å®ç°åç
13ãå¦ä½ä½¿ç¨ DataStream API æ¥å¤çæ°æ®ï¼
14ãFlink WaterMark 详解åç»å WaterMark å¤ç延è¿æ°æ®
15ãåºäº Apache Flink ççæ§åè¦ç³»ç»
16ãæ°æ®ä»åºãæ°æ®åºç对æ¯ä»ç»ä¸å®æ¶æ°ä»æ¡ä¾å享
17ãä½¿ç¨ Prometheus Grafana çæ§ Flink
æºç ç³»å
1ãFlink æºç 解æ ââ æºç ç¼è¯è¿è¡
2ãFlink æºç 解æ ââ 项ç®ç»æä¸è§
3ãFlink æºç 解æââ local 模å¼å¯å¨æµç¨
4ãFlink æºç 解æ ââ standalonesession 模å¼å¯å¨æµç¨
5ãFlink æºç 解æ ââ Standalone Session Cluster å¯å¨æµç¨æ·±åº¦åæä¹ Job Manager å¯å¨
6ãFlink æºç 解æ ââ Standalone Session Cluster å¯å¨æµç¨æ·±åº¦åæä¹ Task Manager å¯å¨
7ãFlink æºç 解æ ââ åæ Batch WordCount ç¨åºçæ§è¡è¿ç¨
8ãFlink æºç 解æ ââ åæ Streaming WordCount ç¨åºçæ§è¡è¿ç¨
9ãFlink æºç 解æ ââ å¦ä½è·å JobGraphï¼
10ãFlink æºç 解æ ââ å¦ä½è·å StreamGraphï¼
11ãFlink æºç 解æ ââ Flink JobManager æä»ä¹ä½ç¨ï¼
12ãFlink æºç 解æ ââ Flink TaskManager æä»ä¹ä½ç¨ï¼
13ãFlink æºç 解æ ââ JobManager å¤ç SubmitJob çè¿ç¨
14ãFlink æºç 解æ ââ TaskManager å¤ç SubmitJob çè¿ç¨
15ãFlink æºç 解æ ââ 深度解æ Flink Checkpoint æºå¶
16ãFlink æºç 解æ ââ 深度解æ Flink åºååæºå¶
17ãFlink æºç 解æ ââ 深度解æ Flink æ¯å¦ä½ç®¡ç好å
åçï¼
18ãFlink Metrics æºç 解æ ââ Flink-metrics-core
19ãFlink Metrics æºç 解æ ââ Flink-metrics-datadog
20ãFlink Metrics æºç 解æ ââ Flink-metrics-dropwizard
21ãFlink Metrics æºç 解æ ââ Flink-metrics-graphite
22ãFlink Metrics æºç 解æ ââ Flink-metrics-influxdb
23ãFlink Metrics æºç 解æ ââ Flink-metrics-jmx
24ãFlink Metrics æºç 解æ ââ Flink-metrics-slf4j
25ãFlink Metrics æºç 解æ ââ Flink-metrics-statsd
26ãFlink Metrics æºç 解æ ââ Flink-metrics-prometheus
26ãFlink Annotations æºç 解æ
é¤äºãä»1å°100æ·±å
¥å¦ä¹ Flinkãæºç å¦ä¹ è¿ä¸ªç³»åæç« ï¼ãä»0å°1å¦ä¹ Flinkãçæ¡ä¾æç« ä¹ä¼ä¼å
å¨ç¥è¯æçæ´æ°ï¼è®©å¤§å®¶å
éè¿ä¸äº demo å¦ä¹ Flinkï¼åå»æ·±å
¥æºç å¦ä¹ ï¼
å¦æå¦ä¹ Flink çè¿ç¨ä¸ï¼éå°ä»ä¹é®é¢ï¼å¯ä»¥å¨éé¢æé®ï¼æä¼ä¼å
解çï¼è¿éå个æ±æï¼èªå·±å¹³æ¶å·¥ä½ä¹æºå¿ï¼å¾®ä¿¡çé®é¢ä¸è½åå
¨é¨åä¸äºè§£çï¼
ä½è¯å®ä¼ä¼å
åå¤ç»ç¥è¯æççä»è´¹ç¨æ·çï¼åºå¹¸çæ¯ç°å¨æçéçæ´»è·æ°å´è¿æ¯å¯ä»¥çï¼æä¸å°é®é¢éè¿æé®å解ççæ¹å¼æ²æ·äºä¸æ¥ã
1ã为ä½æä½¿ç¨ ValueState ä¿åç¶æ Job æ¢å¤æ¯ç¶æ没æ¢å¤ï¼
2ãflinkä¸watermark究ç«æ¯å¦ä½çæçï¼çæçè§åæ¯ä»ä¹ï¼æä¹ç¨æ¥å¤çä¹±åºæ°æ®
3ãæ¶è´¹kafkaæ°æ®çæ¶åï¼å¦æéå°äºèæ°æ®ï¼æè
æ¯ä¸ç¬¦åè§åçæ°æ®ççæä¹å¤çå¢ï¼
4ãå¨Kafka é群ä¸æä¹æå®è¯»å/åå
¥æ°æ®å°æå®brokeræä»æå®brokerçoffsetå¼å§æ¶è´¹ï¼
5ãFlinkè½éè¿oozieæè
azkabanæ交åï¼
6ãjobmanagerææåï¼æ交çjobæä¹ä¸ç»è¿æå¨éæ°æ交æ§è¡ï¼
7ã使ç¨flink-web-uiæ交ä½ä¸å¹¶æ§è¡ ä½æ¯/opt/flink/logç®å½ä¸æ²¡ææ¥å¿æ件 请é®å
³äºflinkçæ¥å¿ï¼å
æ¬jobmanagerãtaskmanagerãæ¯ä¸ªjobèªå·±çæ¥å¿é»è®¤åå«åå¨åªä¸ªç®å½ ï¼éè¦æä¹é
ç½®ï¼
8ãéè¿flink 仪表çæ交çjar æ¯åå¨å¨åªä¸ªç®å½ä¸ï¼
9ãä»Kafkaæ¶è´¹æ°æ®è¿è¡etlæ¸
æ´ï¼æç»æåå
¥hdfsæ å°æhive表ï¼åç¼©æ ¼å¼ãhiveç´æ¥è½å¤è¯»åflinkååºçæ件ãæç
§æ件大å°æè
æ¶é´æ»å¨çææ件
10ãflink jarå
ä¸ä¼ è³é群ä¸è¿è¡ï¼ææåï¼æææé´kafkaä¸æªè¢«æ¶è´¹çæ°æ®ï¼å¨éæ°å¯å¨ç¨åºåï¼æ¯èªå¨ä»checkpointè·åææä¹åçkafka offsetä½ç½®ï¼èªå¨æ¶è´¹ä¹åçæ°æ®è¿è¡å¤çï¼è¿æ¯éè¦æäºæå¨çæä½å¢ï¼
11ãflink å¯å¨æ¶ä¸èªå¨å建 ä¸ä¼ jarçè·¯å¾ï¼è½æå®ä¸ä¸ªå建好çç®å½å
12ãFlink sink to es é群ä¸æ¥ slot ä¸å¤ï¼åæºè·æ¯å¥½çï¼ä¸ºä»ä¹ï¼
13ãFllink to elasticsearchå¦ä½å建索å¼ææ¡£ææ¶é´æ³ï¼
14ãblinkæ没æapiææ¡£æè
demoï¼æ¯å¦å»ºè®®blinkç¨äºç产ç¯å¢ã
15ãflinkçPython apiææ ·ï¼bugå¤åï¼
16ãFlink VS Spark Streaming VS Storm VS Kafka Stream
17ãä½ ä»¬åå®æ¶å¤§å±çææ¯æ¶ææ¯ä»ä¹æ ·åçï¼flumeâkafkaâflinkâredisï¼ç¶åå端å»rediséé¢ææ°æ®ï¼é
±ç´«å¯è¡åï¼
18ãåä¸ä¸ªç»è®¡ææ çæ¶åï¼éè¦å¨Flinkç计ç®è¿ç¨ä¸å¤æ¬¡è¯»åredisï¼æè§å¥½æªï¼æ主æ没æ好çæ¹æ¡ï¼
19ãFlink 使ç¨åºæ¯å¤§åæï¼å举äºå¾å¤ç常ç¨åºæ¯ï¼å¯ä»¥å¥½å¥½åèä¸ä¸
20ãå°kafkaä¸æ°æ®sinkå°mysqlæ¶ï¼metadataçæ°æ®ä¸ºç©ºï¼å¯¼å
¥mysqlæ°æ®ä¸æåï¼ï¼ï¼
21ã使ç¨äºValueStateæ¥ä¿åä¸é´ç¶æï¼å¨è¿è¡æ¶ä¸é´ç¶æä¿åæ£å¸¸ï¼ä½æ¯å¨æå¨åæ¢åï¼åéæ°è¿è¡ï¼åç°ä¸é´ç¶æå¼æ²¡æäºï¼ä¹ååºç°çé®å¼æ¯ä»0å¼å§è®¡æ°çï¼è¿æ¯ä¸ºä»ä¹ï¼æ¯éè¦å®ç°CheckpointedFunctionåï¼
22ãflink on yarn jobmanagerçHAéè¦æä¹é
ç½®ãè¿æ¯è¯´yarnç»ç®¡çäº
23ãæ两个æ°æ®æµå°±è¡connectï¼å
¶ä¸ä¸ä¸ªæ¯å®æ¶æ°æ®æµï¼kafka 读å)ï¼å¦ä¸ä¸ªæ¯é
ç½®æµãç±äºé
ç½®æµæ¯ä»å
³ç³»åæ°æ®åºä¸è¯»åï¼é度è¾æ
¢ï¼å¯¼è´å®æ¶æ°æ®æµæµå
¥æ°æ®çæ¶åï¼é
置信æ¯è¿æªåéï¼è¿æ ·ä¼å¯¼è´æäºå®æ¶æ°æ®è¯»åä¸å°é
置信æ¯ãç®åéåçæªæ½æ¯å¨connectæ¹æ³åçflatmapçå®ç°çå¨open æ¹æ³ä¸ï¼æåå è½½ä¸æ¬¡é
置信æ¯ï¼æè§è¿ç§å®ç°æ¹å¼ä¸å好ï¼è¯·é®è¿æå
¶ä»çå®ç°æ¹å¼åï¼
24ãFlinkè½éè¿oozieæè
azkabanæ交åï¼
25ãä¸éç¨yarmé¨ç½²flinkï¼è¿æå
¶ä»çæ¹æ¡åï¼ ä¸»è¦æ³è§£å³æå¡å¨éå¯åï¼flinkæå¡æä¹èªå¨æèµ·ï¼ jobmanagerææåï¼æ交çjobæä¹ä¸ç»è¿æå¨éæ°æ交æ§è¡ï¼
26ãå¨ä¸ä¸ª Job éå°å份æ°æ®æ¨ææ¸
æ´æä½åï¼sink å°å端å¤ä¸ªå°æ¹ï¼çä¸å¡éæ±ï¼ï¼å¦ä½ä¿æä¸è´æ§ï¼ï¼ä¸ä¸ªsinkåºéï¼å¦å¤çä¹ä¿è¯ä¸è½æå
¥ï¼
27ãflink sqlä»»å¡å¨æ个ç¹å®é¶æ®µä¼åçtmåjm丢失å¿è·³ï¼æ¯ä¸æ¯ç±äºgcæ¶é´è¿é¿å¢ï¼
28ãæè¿æ ·ä¸ä¸ªéæ±ï¼ç»è®¡ç¨æ·è¿ä¸¤å¨è¿å
¥äº§å详æ
页çæ¥æºï¼1é¦é¡µå¤§æç´¢ï¼2产åé¢éæç´¢ï¼3å
¶ä»ï¼ï¼ä¸ºphpå端æä¾æ°æ®æ¯æï¼è¯¥ä¿¡æ¯å¨ç«¯ä¸æ¥äºä»¶ä¸ï¼phpç´æ¥è·åæç¹å°é¾ã æç°å¨ç解å³æ¹æ¡ éè¿flinkæ»å¨çªå£ï¼åå°æ¶ï¼ï¼ç»è®¡ç¨æ·åå°æ¶å
3个æ¥æºpvï¼ç¶åæç
§æ¥æåºååï¼ç´æ¥åmysqlãphpä»æ°æ®åºä¸è§£æåºæ¥ï¼åå»ç»è®¡è¿ä¸¤å¨å æ¯ã é®é¢1ï¼è¿ä¸ªéæ±éåç¨flinkå»ååï¼ é®é¢2ï¼æçæ¹æ¡æ»æè§æªæªçï¼æ没æ好çæ¹æ¡ï¼
29ãä¸ä¸ªtask slot åªè½åæ¶è¿è¡ä¸ä¸ªä»»å¡è¿æ¯å¤ä¸ªä»»å¡å¢ï¼å¦ætask slotè¿è¡çä»»å¡æ¯è¾å¤§ï¼ä¼åºç°OOMçæ
åµåï¼
30ãä½ ä»¬æä¹å¯¹çº¿ä¸flinkåçæ§çï¼å¦ææ´ä¸ªç¨åºå¤±è´¥äºæä¹èªå¨éå¯çç
31ãflink cepè§åå¨æ解æææ¥è§¦åï¼æ没ææåçæ¡æ¶ï¼
32ãæ¯ä¸ä¸ªWindowé½æä¸ä¸ªwatermarkåï¼windowæ¯æä¹æ ¹æ®watermarkè¿è¡è§¦åæè
éæ¯çï¼
33ã CheckPointä¸SavePointçåºå«æ¯ä»ä¹ï¼
34ãflinkå¯ä»¥å¨ç®åä¸å
±äº«ç¶æåï¼æè
å¤§ä½¬ä½ æä»ä¹æ¹æ³å¯ä»¥å
±äº«ç¶æçå¢ï¼
35ãè¿è¡å åéå°±æ¥äºï¼çtaskmageræ¥å¿ï¼æ¥çæ¯ failed elasticsearch bulk request nullï¼å¯æ¯æ代ç éé¢å·²ç»åè¿ç©ºå¼å¤æäºå èä¸ä¹è¿æ»¤æäºï¼flinkçæ¬1.7.2 esçæ¬6.3.1
36ãè¿ç§æ
åµï¼æ们è°å¹¶è¡åº¦ è¿æ¯é
ç½®åæ°å¥½
37ã大家é½ç¨jdbcåï¼åç§æ°æ®åºå¢å æ¥æ¹æ¼sqlæ没æè§å¾å¾ç´¯ï¼ps.set代ç ä¸å¤§å ï¼è¿è¦è®¡ç®æ¯ä¸ªåæ°çä½ç½®
38ãå
³äºdatasourceçé
ç½®ï¼æ¯ä¸ªtaskmanager对åºä¸ä¸ªdatasource?è¿æ¯æ¯ä¸ªslot? å®é
è¿è¡ä¸æ¥ï¼æ¯ä¸ªslotä¸datasorce线ç¨æ± åªè¦è®¾ç½®1å°±è¡äºï¼å¤äºä¹ç¨ä¸å°?
39ãkafkaç°å¨æ¯å¤©åºç°æ°æ®ä¸¢å¤±ï¼ç°å¨å°æ¹éæ°æ®ï¼ä¸å¤©200Wå·¦å³, kafkaçæ¬ä¸º 1.0.0ï¼é群æ»å
±7个èç¹ï¼TOPICæåå
个ååºï¼åæ¡æ¥æ1.5kå·¦å³
40ãæ ¹æ®key.hashçç»å¯¹å¼ 对并å度æ±æ¨¡ï¼è¿è¡åç»ï¼å设10å并å度ï¼å®é
åªæ8个ååºæå¤çæ°æ®ï¼æ2个å§ç»ä¸å¤çï¼è¿æä¸ä¸ªååºå¤ççæ°æ®æ¯å
¶ä»çä¸åï¼å¦æªå¾
41ãflinkæ¯7å°æ¶ä¸ç¥éå¨å¤çä»ä¹ï¼ CPU è´è½½ æ¯7å°æ¶ï¼æä¸æ¬¡é«å³°ï¼5åéå
å¹³åè´è½½è¶
è¿0.8ï¼å¦æªå¾
42ãæ没æFlinkåç项ç®æ¨èï¼ææ³çå°ç¨Flinkåçæ´ä½é¡¹ç®æ¯æä¹ç»ç»çï¼ä¸ååæ¯ä¸ä¸ªåä¾å
43ãFlink æºç çç»æå¾
44ãææ³æ ¹æ®ä¸åä¸å¡è¡¨ï¼case whenï¼è¿è¡ä¸åçredis sinkï¼hash ï¼setï¼ï¼æè¦å¦ä½æä½ï¼
45ãè¿ä¸ªéè¦æ¸
çä»ä¹æ°æ®åï¼ææhdfséé¢çå·²ç»æ¸
çäº å¯å¨è¿æ¯æ¥è¿ä¸ª
46ã å¨æµå¤çç³»ç»ï¼å¨æºå¨åçæ
éæ¢å¤ä¹åï¼ä»ä¹æ
åµæ¶æ¯æå¤ä¼è¢«å¤çä¸æ¬¡ï¼ä»ä¹æ
åµæ¶æ¯æå°ä¼è¢«å¤çä¸æ¬¡å¢ï¼
47ãææ£æ¥ç¹é½è°å°5åéäºï¼è¿æ¯ä»ä¹é®é¢
48ãreduceæ¹æ³å é£ä¸ªäº¤ææ¶é´ æä¹ä¸æ¯ææ°çï¼æ¯ç¬¬ä¸æ¬¡è¿å
¥çé£ä¸ªæ¶é´ï¼
49ãFlink on Yarn 模å¼ï¼ç¨yarn sessionèæ¬å¯å¨çæ¶åï¼æå¨åå°æ²¡æçå°å°Jobmanagerï¼TaskManagerï¼ApplicationMasterè¿å 个è¿ç¨ï¼æ³è¯·é®ä¸ä¸è¿æ¯ä»ä¹åå å¢ï¼å 为ä¹åçå®ç½çæ¶åï¼è¯´Jobmanagerå°±æ¯ä¸ä¸ªjvmè¿ç¨ï¼Taskmanageä¹æ¯ä¸ä¸ªJVMè¿ç¨
50ãFlink on Yarnçæ¶åå¾æå® å¤å°ä¸ªTaskManageråæ¯ä¸ªTaskManager slotå»è¿è¡ä»»å¡ï¼è¿æ ·åæè§ä¸å¤ªåçï¼å 为ç¨æ·ä¹ä¸ç¥ééè¦å¤å°ä¸ªTaskManageréåï¼Flink æå¨æå¯å¨TaskManagerçæºå¶åã
51ãåèè¿ä¸ªä¾åï¼Flink é¶åºç¡å®ææç¨ï¼å¦ä½è®¡ç®å®æ¶çé¨åå | Jark's Blogï¼ çªå£èåçæ¶åï¼ç¨keywindowï¼ç¨çæ¯timeWindowAllï¼ç¶åå¨aggregateçæ¶åç¨aggregate(new CustomAggregateFunction(), new CustomWindowFunction())ï¼æå°ç»æåï¼åç°çªå£ä¸ä¸ç´ä½¿ç¨çéå¤çæ°æ®ï¼ç»è®¡çç»æä¹ä¸åï¼å»æCustomWindowFunction()å°±æ£å¸¸äº ï¼ é常å¥æª
52ãç¨æ·è¿å
¥äº§åé¢å®é¡µé¢ï¼ç«¯åç¹ä¸æ¥ï¼ï¼å¹¶å¡«åäºä¸äºä¿¡æ¯ï¼ç«¯åç¹ä¸æ¥ï¼ï¼ä½åå°æ¶å
并没æ产çä»»ä½è®¢åï¼ç¶åç»è¯¥ç±»ç¨æ·åéä¸ä¸ªpushã 1. è¿ç§éæ±éåç¨flinkå»ååï¼2. å¦æéåï¼è¯´ä¸å¤§æ¦çæè·¯
53ãä¸å¡åºæ¯æ¯å®æ¶è·åæ°æ®åredisï¼è¯·é®æè¦å¦ä½æ天ãæå¨ãææåå«åå
¥rediséï¼ï¼æ¯æ¹è¯´è¿äºä¸å¤©èªå¨æ¢ä¸ä¸ªä½ç½®åredisï¼
54ãæ人 AggregatingState çä¾åå, æè§å®æ¹çä¾åå å®ç½çä¸å¤ªä¸æ ·?
55ãflink-jdbcè¿ä¸ªjaræåï¼æä¹æ²¡æ¾å°åï¼1.8.0ç没æ¾å°ï¼1.6.2çæ
56ãç°æ个å
³äºsavepointçé®é¢ï¼æä½æµç¨ä¸ºï¼åæ¶ä»»å¡æ¶è®¾ç½®ä¿åç¹ï¼æ´æ°ä»»å¡ï¼ä»ä¿åç¹å¯å¨ä»»å¡ï¼ç°å¨éå°ä¸ªé®é¢ï¼å设æä¸é´æ个ç®åéåï¼åå
éè¿stateç¼åï¼æç¨å®æ¶å¨ï¼ç°å¨æ´æ¹åï¼éç¨çªå£ï¼åæ£å°±æ¯å®ç°æ¹å¼å®å
¨ä¸ä¸æ ·ï¼ä»ä¿åç¹å¯å¨å°±ä¼ä¸ç´æ¥éï¼éå¯ï¼åå
çä¿åç¹ä¸è½è¿åï¼æ¤æ¶å°±ä¼æå¾å¤æ°æ®éå¤çåç§é®é¢ï¼å¦ä½æè½ä¿è¯æ°æ®ä¸ä¸¢å¤±ï¼ä¸éå¤çï¼æ¢å¤å°åæ¢çæ¶åï¼ç°å¨æ³å°çæ¯è®°ä¸kafkaçå移éï¼ååå¤çï¼è²ä¼¼ä¹ä¸æ¯å¾å¥½å¼ï¼æä»ä¹è§£å³åæ³å
57ãéè¦å¨flink计ç®app页é¢è®¿é®æ¶é¿ï¼æ¶è´¹Kafka计ç®åè¾åºå°Kafkaã第ä¸æ¡logéè¦çå¾
第äºæ¡logçæ¶é´æ³è®¡ç®è®¿é®æ¶é¿ãææ³é®çæ¯ï¼flinkæ¯åå¸å¼çï¼é£ä¹å®è½å¦ä¿è¯æ§è¡ç顺åºæ§ï¼åæ¥çæ°æ®æ没æå¯è½å
被æ§è¡ï¼
58ãæå
¬å¸æ³åå®æ¶å¤§å±ï¼ç°æææ¯æ¯å°ä¸å¡æéææ å®æ¶ç¨sparkæå°rediséåçï¼ç¶ååç¨ä¸æ¡spark streamingæµè®¡ç®ç®åä¹é¤è¿ç®ï¼ææ å
å«äºåæ份çæ¯è¾ã请é®æ该å¦ä½ç¨flinkç®åä¸è¿°æµç¨ï¼
59ãflink on yarn æ¹å¼ï¼è¿æ ·ç解ä¸ç¥é对ä¸å¯¹ï¼yarn-sessionè¿ä¸ªèæ¬å
¶å®å°±æ¯åå¤yarnç¯å¢çï¼æ§è¡runä»»å¡çæ¶åï¼æ ¹æ®yarn-sessionåå§åçyarnDescription æ flink ä»»å¡çjobGraphæ交å°yarnä¸å»æ§è¡
60ãåæ ·ç代ç é»è¾åå¨åç¬çmainå½æ°ä¸å°±å¯ä»¥æåçæ¶è´¹kafka ï¼åå¨ä¸ä¸ªspring bootçç¨åºä¸ï¼æ¥åå¤é¨è¯·æ±ï¼ç¶åæ§è¡ç¸åçé»è¾å°±ä¸è½æ¶è´¹kafkaãä½ éå°è¿åï¼è½ç»ä¸äºæ¥é®é¢ç建议ï¼æè
å¨åªéæ个æç¹ï¼è½çå°ä¸ºä»ä¹æ¶è´¹ä¸å°kafkaçæ¶æ¯å¢ï¼
61ã请é®ä¸flinkå¯ä»¥å®ç°ä¸ä¸ªæµä¸åæ¶åå¨è®¢å表å订ååå表çæ°æ® 两è
æ¯ä¸å¯¹å¤çå
³ç³» è½å®ç°å¾å° 以订å表为主 ä¸ä¸ªè®¢åå¤ä¸ªåå è¿ç§éæ±å
62ãå¨ç¨ä¸é´ç¶æçæ¶åï¼å¦æä¸é´ä¸äºä¿¡æ¯ä¿åå¨stateä¸ï¼æ没æå¿
è¦å¨redisä¸åä¿åä¸ä»½ï¼æ¥å第ä¸æ¹çåå¨ã
63ãè½å¦åºä¸æflink stateçæç« ãä»ä¹åºæ¯ä¸ç¨ä»ä¹æ ·çstateï¼å¦ï¼æç®åçï¼å®æ¶ç´¯å updateå°stateã
64ãflinkçåæµjoinå主æ使ç¨çç»éªåï¼ä¼æä»ä¹å¸¸è§çé®é¢å
65ãçªå£è§¦åçæ¡ä»¶é®é¢
66ãflink å®æ¶ä»»å¡æä¹åï¼æç¸å
³çdemoä¹ï¼
67ãæµå¼å¤çè¿ç¨ä¸æ°æ®çä¸è´æ§å¦ä½ä¿è¯æè
å¦ä½æ£æµ
68ãéå¯flinkåæºé群ï¼è¿æ¥job not found å¼å¸¸ã
69ãkafkaçæ°æ®æ¯ç¨ org.apache.kafka.common.serialization.ByteArraySerializeåºååçï¼flinkè¿è¾¹æ¶è´¹çæ¶åæä¹éè¿FlinkKafkaConsumerå建DataStreamï¼
70ãç°å¨å
¬å¸æä¸ä¸ªéæ±ï¼ä¸äºç¨æ·çæ¯ä»æ¥å¿ï¼éè¿slsæ¶éï¼è¦æè¿äºæ¥å¿å¤çåï¼ç»æåå
¥å°MySQLï¼å
³é®è¿äºæ¥å¿å¯è½è¿çæ¥å¥½å æ¡ææ¯ä¸ä¸ªç¨æ·çï¼å 为å起请æ±ï¼ååºçæ¯ä¸ªç¯èé½æç¸åºçæ¥å¿ï¼è¿å æ¡æ¥å¿ç»¼åå¤çæè½å¾å°æç»çç»æï¼è¯·é®å主æä»ä¹å¥½çæ¹æ³æ²¡æï¼
71ãflink æ¯æhadoop 主å¤ä¹ï¼ hadoop主èç¹æäº flink ä¼åæ¢å°hadoop å¤ç¨èç¹ï¼
72ã请æ大家: å®é
flink å¼åä¸ç¨ scala å¤è¿æ¯ javaå¤äºï¼ åå
¥æ flink 大æ°æ® scala éè¦æ·±å
¥å¦ä¹ ä¹ï¼
73ãæ使ç¨çæ¯flinkæ¯1.7.2æè¿ç¨äºsplitçæ¹å¼åæµï¼ä½æ¯åºå±çSplitStreamä¸å´æ 注为Deprecatedï¼è¯·é®æ¯å®æ¹ä¸æ¨è使ç¨åæµçæ¹å¼åï¼
74ãKeyBy çæ£ç¡®ç解ï¼åæ°æ®å¾æé®é¢ç解é
75ãç¨flinkæ¶ï¼éå°ä¸ªé®é¢ checkpoint大æ¦æ2Gå·¦å³ï¼ æèåæ¶ï¼flinkä¼éå¯æéå°è¿è¿ä¸ªé®é¢å
76ãflink使ç¨yarn-sessionæ¹å¼é¨ç½²ï¼å¦ä½ä¿è¯yarn-sessionç稳å®æ§ï¼å¦æyarn-sessionæäºï¼éè¦éæ°é¨ç½²ä¸ä¸ªyarn-sessionï¼å¦ä½æ¢å¤ä¹åyarn-sessionä¸çjobå¢ï¼ä¹åçcheckpointè¿è½ä½¿ç¨åï¼
77ãææ³è¯·æä¸ä¸å
³äºsinkçé®é¢ãæç°å¨çéæ±æ¯ä»Kafkaæ¶è´¹Jsonæ°æ®ï¼è¿ä¸ªJsonæ°æ®å段å¯è½ä¼å¢å ï¼ç¶åå°æ¿å°çjsonæ°æ®ä»¥parquetçæ ¼å¼åå
¥hdfsãç°å¨æå¯ä»¥æ¿å°jsonæ°æ®çschemaï¼ä½æ¯å¨ä¿åparquetæ件çæ¶åä¸ç¥éæä¹å¤çãä¸æ¯flink没æä¸é¨çformat parquetï¼äºæ¯å¯¹äºå¯åå段çJsonæä¹å¤çæparquetæ¯è¾åéï¼
78ãflinkå¦ä½å¨è¾å¤§çæ°æ®éä¸åå»é计ç®ã
79ãflinkè½å¨æ²¡ææ°æ®çæ¶åä¹å®æ¶æ§è¡ç®ååï¼
80ã使ç¨rocksdbç¶æå端ï¼èªå®ä¹pojoæä¹å®ç°åºåååååºååçï¼æç¸å
³demoä¹ï¼
81ãcheck point èæ¯å¤±è´¥ï¼æ¯ä¸æ¯èªå®ä¹çpojoé®é¢ï¼å°æ¬å°å¯ä»¥ï¼å°hdfså°±ä¸è¡ï¼ç½ä¸ä¹æå¾å¤ç±»ä¼¼çé®é¢ é½æ²¡æä¸ä¸ªå¾å¥½ç解éå解å³æ¹æ¡
82ãcepè§åå¦å¾ï¼å½startäºä»¶è¿å
¥æ¶ï¼æ¶é´00:00:15ï¼èåè¿å
¥endäºä»¶ï¼æ¶é´00:00:40ãæåç°è§åæ æ³å½ä¸ã请é®within æ¯ä»startäºä»¶å¼å§è®¡æ¶ï¼è¿æ¯è·windowä¸æ ·æ ¹æ®ç³»ç»æ¶é´ååçï¼å¦ææ¯åè
ï¼è¯·é®æä¹é
ç½®æè½ä»startå¼å§è®¡æ¶ï¼
83ãFlinkèåç»æç´æ¥åMysqlçå¹çæ§è®¾è®¡é®é¢
84ãFlink jobæå¼äºcheckpointï¼ç¨çrocksdbï¼éè¿è§å¯hdfsä¸checkpointç®å½ï¼ä¸ºå¥ç®å¯æ¬æ»éä¼æ´å¢çå
85ãFlink æ交任å¡ç jarå
å¯ä»¥æå®è·¯å¾ä¸º HDFS ä¸çå
86ãå¨flink web Uiä¸æ交çä»»å¡ï¼è®¾ç½®ç并è¡åº¦ä¸º2ï¼flinkæ¯stand aloneé¨ç½²çã两个任å¡é½æ£å¸¸çè¿è¡äºå 天äºï¼ä»å¤©æ个å°æ¹é»è¾éè¦ä¿®æ¹ï¼äºæ¯å°ä»»å¡cancelæ(å¨å½ä»¤è¡cancelä¹è¯äº)ï¼ç»ætaskmangerææäºä¸ä¸ªèç¹ãåæ¥ç¨å
¶ä»ä»»å¡è¯äºï¼ä¹åæ ·ä¼å¯¼è´èç¹ææ
87ãä¸ä¸ªé
ç½®å¨ææ´æ°çé®é¢æè
¾å¥½ä¹
ï¼é
ç½®ç¨ä¸ªéæçmapåéåçï¼æ个线ç¨å®æ¶å»æ°æ®åºææ°æ®ç¶ååå¨è¿ä¸ªmapéé¢æ´æ°ä¸æï¼ï¼æ¬å° idea è°è¯æ²¡é®é¢ï¼é群é¨ç½²å°±ä¸ç´æ¥ 空æéå¼å¸¸ãä¸æ¸¸çç®å使ç¨è¿ä¸ªéæåémapå»get keyå¨é群模å¼ä¸ä¼åºç°è¿ä¸ªç©ºæéå¼å¸¸ï¼ä¼°è®¡å°±æ¯æ¿ä¸å° map
88ãæ¹éåå
¥MySQLï¼å®æHBaseæ¹éåå
¥
89ãç¨flinkæ¸
æ´æ°æ®ï¼å
¶ä¸è¦è®¿é®redisï¼æ ¹æ®redisçç»ææ¥å³å®æ¯å¦ææ°æ®ä¼ éå°ä¸æµï¼è¿æå¯è½å®ç°åï¼
90ãçæ§é¡µé¢æµå¤ççæ¶åè¿ä¸ªåéåæ¥æ¶åè为0ã
91ãsinkå°MySQLï¼å¦æç´æ¥ç¨ideaçè¯å¯ä»¥è¿è¡ï¼å¹¶ä¸æåï¼å¤§å¤§ç代ç ä¸é¢ç¨çFlinkKafkaConsumer010ï¼èæçFlinkçæ¬ä¸º1.7ï¼kafkaçæ¬ä¸º2.12ï¼æ以å½æç¨FlinkKafkaConsumer010å°±æé®é¢ï¼äºæ¯æ¹ä¸º
FlinkKafkaConsumerå°±å¯ä»¥ç´æ¥å¨ideaå®æsinkå°MySQLï¼ä½æ¯ä¸ºä½å½ææ该ç¨åºææJarå
ï¼å»è¿è¡çæ¶åï¼å°±æ¯æ¥FlinkKafkaConsumeræ¾ä¸å°å¢
92ãSocketTextStreamWordCountä¸è¾å
¥ä¸æç»è®¡ä¸åºæ¥ï¼è¯·é®è¿ä¸ªæä¹è§£å³ï¼æçæµåºè¯¥æ¯éè¦ä¿®æ¹ä¸ä¸ä»£ç ï¼åºè¯¥æ¯è¿ä¸ªä¾åé»è®¤ç»è®¡è±æ
93ã Flink åºç¨ç¨åºæ¬å° ide éé¢è¿è¡çæ¶å并è¡åº¦æ¯æä¹ç®çï¼
94ã 请é®ä¸flinkä¸å¯¹äºçªå£çå
¨éèåæapplyåprocessä¸¤ç§ ä»ä»¬æå¥åºå«å¢
95ãä¸ç¥é大大çæHbaseä¸ï¼ææ³ç´æ¥å¨Hbaseä¸æ¥è¯¢æä¸åæ°æ®ï¼å 为æéå¤æ°æ®ï¼æ以æ³ä½¿ç¨distinctç»è®¡å®é
æ°æ®éï¼è¯·é®Hbaseä¸æ没æ类似äºsqlçdistinctå
³é®åãå¦æ没æï¼æ³å®ç°è¿ç§å¯ä»¥ä¸ï¼
96ã æ¥åæä¸ä¸ç°å¨Flink,Kafkaæ¹é¢çå°±ä¸å½¢å¿ï¼ä»¥ååå¤å°±ä¸è¯¥å¦ä½åå¤çè¿æ¹é¢å
容å¢ï¼
97ã 大佬ç¥éflinkçdataStreamå¯ä»¥è½¬æ¢ä¸ºdataSetåï¼å 为æ°æ®éè¦11åéä¸ä¸ªæ¹æ¬¡è®¡ç®äºå
个ææ ï¼å¹¶ä¸æ¶å好å æ¥reduceï¼è®¡ç®çææ ä¹é´æèç³»ï¼ç¨Streamå¡ä½äºã
98ã1.å¦ä½å¨åä¸çªå£å
å®ç°å¤æ¬¡çèåï¼æ¯å¦åsparkä¸çè¿æ ·2.å¤ä¸ªå®æ¶æµçjionå¯ä»¥ç¨windowæ¥å¤çä¸æ¹æ¬¡çæ°æ®åï¼
99ãåçæ¹å¤ççåè½ï¼ç°å¨æ¬æºè·æ¯æ²¡é®é¢çï¼å°±æ¯å¨linuxé群ä¸åºç°äºé®é¢ï¼å°±æ¯ä¸ç¥éå¦æéè¿æ¬å°è°ç¨è¿ç¨jarå
ç¶åä¼ åæ°åæ¿å°ç»æåæ°è¿åæ¬æº
100ãæç¨standaloneå¼å¯ä¸ä¸ªflinké群ï¼ä¸ä¼ flinkå®æ¹ç¨ä¾Socket Window WordCountåæµè¯ï¼å¼å¯ä¸¤ä¸ªparallelismè½æ£å¸¸è¿è¡ï¼ä½æ¯å¼å¯4个parallelismååºç°é误
101ã æ使ç¨AssignerWithPunctuatedWatermarks çæ¡ä¾Demoåï¼ç½ä¸æ¾äºé½æ¯AssignerWithPeriodicWatermarksçï¼ä¸ç¥éå
·ä½æä¹ä½¿ç¨ï¼
102ã æä¸ä¸ªdatastream(ä»æ件读åç)ï¼ç¶åæç¨flink sqlè¿è¡è®¡ç®ï¼è¿ä¸ªsqlæ¯ä¸ä¸ªå æ»çè¿ç®ï¼ç¶åéè¿retractStreamTableSinkå¯ä»¥ææ件åsqlçç»æè¾åºå°æ件åï¼è¿ä¸ªè¾åºå°æ件çæ¥å£æ¯ç¨ä»ä¹å¢ï¼
103ã 为å¥splitè¿ä¸ªæµè®¾ç½®ä¸ºè¿æç
104ã éè¦ä½¿ç¨flink tableçæ°´å°æºå¶æ§å¶æ¶é´çä¹±åºé®é¢ï¼è¿ç§åºæ¯ä¸æ就使ç¨æ°´å°+çªå£äºï¼æç°å¨åçdemoéå°äºé®é¢ï¼å°±æ¯å¨æ触å计ç®ççªå£tableï¼WindowedTableï¼è½¬æ¢ætableè¿è¡sqlæä½æ¶åç°çªå£ä¸çæ°æ®è¿æ¯ä¹±åºçï¼æ¯ä¸æ¯flink tableçWindowedTableä¸æ¯ææ°´å°çªå£è½¬table-sqlçåè½
105ã Flink 对 SQL çéè§æ§
106ã flink jobæå¼äºcheckpointï¼ä»»å¡è·äºå 个å°æ¶åå°±åºç°ä¸é¢çéï¼æªå¾æ¯æåºæ¥çæ¥å¿ï¼æ个OOMï¼åéå°è¿ç没ï¼
107ã æ¬å°æµè¯æ¯ææ°æ®çï¼ä¹å该任å¡æ¾å¨é群ä¹æ¯ææ°æ®çï¼å¯è½æ交è¿å¤æ¬¡ï¼ç°å¨è¯»ä¸å°æ°æ®äº group id ä¹æ¢è¿äºï¼ åªè½éå¯é群解å³ä¹ï¼
108ã使ç¨flinkæ¸
æ´æ°æ®åå°esä¸ï¼ç´æ¥å¨flatmapä¸å¯¹å¤çåºæ¥çæ°æ®ç¨esèªå·±çClientInterfaceç±»ç´æ¥å°æ°æ®åå
¥eså½ä¸ï¼ä¸èµ°sinkï¼è¿æ ·çå¤çé»è¾æ¯ä¸æ¯ä¼æé®é¢ã
108ã flinkä»kafkaæ¿æ°æ®ï¼å³å¢éæ°æ®ï¼ä¸åéæ°æ®è¿è¡å
åèåçéæ±ï¼ç°å¨æä¸ä¸ªæ¹æ¡å°±æ¯ç¨åºå¯å¨çæ¶åå
ç¨flink tableå°åéæ°æ®å è½½å°å
åä¸å建tableä¸ï¼ç¶åå°streamçå¢éæ°æ®ä¸tableçæ°æ®è¿è¡å
³èèååè¾åºç»æï¼ä¸ç¥éè¿ç§æ¹æ¡å¯è¡ä¹ãç®å个人认为æ两个主è¦é®é¢ï¼1æ¯å¢éæ°æ®stream转åæappend tableåä¸ç¥éè½ä¸åéçtableå
³èèåä¸ï¼2æ¯èååè¾åºçç»ææ°æ®æ¯å¦è¿äºé¢ç¹é æç½ç»ä¼ è¾ååè¿å¤§
109ã 设置æ¶é´æ¶é´ç¹æ§æä»ä¹åºå«å¢, åå«å¨ä»ä¹åºæ¯ä¸ä½¿ç¨å¢?两ç§è®¾ç½®æ¶é´å»¶è¿æä»ä¹åºå«å¢ , åå«å¨ä»ä¹åºæ¯ä¸ä½¿ç¨
110ã flinkä»rabbitmqä¸è¯»åæ°æ®ï¼è®¾ç½®äºrabbitmqçCorrelationDataIdåcheckpoint为EXACTLY_ONCEï¼å¦æflinkå®æä¸æ¬¡checkpointåï¼å¨è¿æ¬¡checkpointä¹åæ¶è´¹çæ°æ®é½ä¼ä»mqä¸å é¤ãå¦ææ次flinkåæºæ´æ°ï¼é£å°±ä¼åºç°mqä¸çä¸äºæ°æ®æ¶è´¹ä½æ¯å¤äºUnackedç¶æãå¨flinkåéæ°å¼å¯åè¿æ¹æ°æ®åä¼éæ°æ¶è´¹ãé£è¿æ ·æ¯ä¸æ¯å°±ä¸è½ä¿è¯EXACTLY_ONCEäº
111ã1. å¨Flink checkpoint ä¸, å operatorçç¶æä¿¡æ¯ æ¯å¨è®¾ç½®äºcheckpoint ä¹åèªå¨çè¿è¡å¿«ç
§å ?2. ä¸é¢è¿ä¸ªåæ们æå¨åå¨ç Keyed State è¿è¡å¿«ç
§(è¿ä¸ªåºè¯¥æ¯å¢éå¿«ç
§)
112ãç°å¨æ个å®æ¶ååæ°ï¼äº¤æé¢è¿ç§ç»è®¡éæ±ï¼æç®ç¨ flinkä»kafka读åbinglogæ¥å¿è¿è¡è®¡ç®ï¼ä½binglogæ¶åå°insertåupdateè¿ç§æä½æ¶ æä¹å¤çæè½ç»è®¡åç¡®ï¼é¿å
é£ç§éå¤è®¡ç®çé®é¢ï¼
113ãæè¿è¾¹ç¨flinkåå®æ¶çæ§ï¼åè½å¾ç®åï¼å°±æ¯æ¯æ¡æ¶æ¯åkeybyç¶åä¸åéçªå£ï¼ç¶ååäºå»éæä½ï¼è§¦åéå¼åæ¥è¦ï¼ç°å¨é®é¢æ¯åä¸ä¸ªæ¶é´çªå£åä¸ä¸ªäººçåè¦ä¼è§¦å两次ï¼é群æ¯ä¸å°æºå¨ï¼standalone clusterï¼åæ¥ç»ææ¯ä¸ä¸ªç®åéæ两个æ¶å°äºåæ ·çæ°æ®
114ãå¨ä½¿ç¨WaterMarkçæ¶åï¼é»è®¤æ¯æ¯200mså»è®¾ç½®ä¸æ¬¡watermarkï¼é£ä¹æ¯ä¸ªtaskmanagerä¹é´ï¼ç±äºå¾å°çæ°æ®ä¸åï¼æ以å¾å¾äº§ççæ大çwatermarkä¸åã é£ä¹è¿ä¸ªæ¶åï¼æ¯å个taskmanager广æè¿ä¸ªwatermarkï¼å¾å°å
¨å±çæ大çwatermarkï¼è¿æ¯è¯´å个taskmanageré½åèªç¨èªå·±çwatermarkã主è¦æ²¡çå°å¹¿æwatermarkçæºç ãä¸ç¥éæ¯èªå·±è§å¯ä¸ä»ç»è¿æ¯å°±æ¯æ²¡æ广æè¿ä¸ªåéã
115ãç°å¨éå°ä¸ä¸ªéæ±ï¼éè¦å¨jobå
é¨å®æ¶å»è¯»åredisçä¿¡æ¯ï¼æ³è¯·æflinkè½å®ç°åæ®éç¨åºé£æ ·çå®æ¶ä»»å¡åï¼
116ãæ个触åäºä»¶å¼å§èåï¼çå°æ°é足å¤ï¼æè
è¶
æ¶åsinkæ¨mq ç¯å¢ flink 1.6 ç¨äºmapState è®°å½è§¦åäºä»¶ 1 æ°æ®è¶³å¤è¿ä¸ªOK 2 è¶
æ¶state ttl 1.6æ¯æï¼ä½æ¯é®é¢æ¥äºï¼å¦ä½å¨è¶
æ¶æ¶åå¢å èªå®ä¹å¤çï¼
117ã请é®impalaè¿ç§mppæ¶æçsqlå¼æï¼ä¸ºä»ä¹ç¨³å®æ§æ¯è¾å·®å¢ï¼
118ãwatermarkè·å¹¶è¡åº¦ç¸å
³ä¸æ¯ï¼è¿äºå
¨å±äºï¼æææ¯keybyä¹ååé对æ¯ä¸ªkeyed stream æwatermarkï¼è¿ä¸ªæä»ä¹å¥½çå®è·µå¢ï¼
119ã请é®å¦ææä¸ä¸ªæ件çå
容读åædatastreamådatasetï¼æä»ä¹åºå«åï¼ï¼ä»ä»¬é½æ¯ä¸æ¡æ°æ®ä¸æ¡æ°æ®ç被读ååï¼
120ãæ没ækylinç¸å
³çèµæï¼æè
è°ä¼çç»éªï¼
121ãflinkå
ä»jdbc读åé
置表å°æµä¸ï¼å¦å¤ä»kafkaä¸æ°å¢æè
ä¿®æ¹è¿ä¸ªé
ç½®ï¼è¿ä¸ªåºæ¯æä¹æ两个æµä¸ä»½é
ç½®æµï¼æç¨çconnect,æ¥çåä¸æ广æåéï¼ååå®ä½æµå并ï¼ä½å¨å并æ¶æ¥Exception in thread "main" java.lang.IllegalArgumentException
122ãFlink exactly-onceï¼kafkaçæ¬ä¸º0.11.0 ï¼sinkåºäºFlinkKafkaProducer æ¯äºåéä¸æ¬¡checkpointï¼ä½æ¯checkpointå¼å§åç³»ç»ç´æ¥å¡æ»ï¼at-lease-once ä¸åéè½å®æçcheckpointï¼ ç°å¨ååéæ æ³å®æ没è¿åº¦è¿æ¯0ï¼ ä¸ç¥éåªéå¡ä½äº
123ãflinkçç¶ææ¯é»è®¤åå¨äºå
åç(ä¹å¯ä»¥è®¾ç½®ä¸ºrocksdbæhdfs)ï¼ècheckpointéé¢æ¯å®æ¶åæ¾æ个æ¶å»çç¶æä¿¡æ¯ï¼å¯ä»¥è®¾ç½®hdfsærocksdbæ¯è¿æ ·ç解çåï¼
124ãFlinkå¼æ¥IOä¸ï¼ä¸å¾è¿ä¸¤ç§æä»ä¹åºå«ï¼ä¸ºå¥è¦å CompletableFuture.supplyAsyncï¼ä¸å¤ªæç½ï¼
125ãflinkçç¶ææ¯é»è®¤åå¨äºå
åç(ä¹å¯ä»¥è®¾ç½®ä¸ºrocksdbæhdfs)ï¼ècheckpointéé¢æ¯å®æ¶åæ¾æ个æ¶å»çç¶æä¿¡æ¯ï¼å¯ä»¥è®¾ç½®hdfsærocksdbæ¯è¿æ ·ç解çåï¼
126ãæ个计ç®åºæ¯ï¼ä»kafkaæ¶è´¹ä¸¤ä¸ªæ°æ®æºï¼ä¸¤ä¸ªæ°æ®ç»æé½ææ¶é´æ®µæ¦å¿µï¼è®¡ç®éè¦åçæ¯å¹é
两个æ¶é´æ®µï¼å¹é
å°äºï¼å°±çæä¸æ¡æ°çè®°å½ã请é®ä½¿ç¨åªä¸ªå·¥å
·æ´åéï¼flink tableè¿æ¯cepï¼è¯·å¤§ç¥æç¹ä¸ä¸ æè¿è¾¹ä¹åçåæ³ï¼å°ä¸¤ä¸ªæ°æ®æµè½¬ä¸ºtable.两个table over windowåjoinææ°ç表ãç»æjobè·ä¸ä¼å°±oom.
127ãä¸ä¸ªäºèç½å
¬å¸ï¼æè
ä¸ä¸ªä¸å¡ç³»ç»ï¼å¦ææ³åä¸ä¸ªå
¨é¢ççæ§è¦æä¹åï¼æä»ä¹æççæ¹æ¡å¯ä»¥åè交æµåï¼æä»ä¹æä»ä¹åº¦éææ åï¼
128ãæä¹æ·±å
¥å¦ä¹ flink,æè
å
¶ä»å¤§æ°æ®ç»ä»¶ï¼è½ä¸ºæªæ¥ç§ææ¾ä¸ä»½å¤§æ°æ®ç¸å
³ï¼è®¡ç®æ¹åï¼çå·¥ä½å¢å èªå·±çç«äºåï¼
129ãoppoçå®æ¶æ°ä»ï¼å
¶ä¸æç»å±åæ±æ»å±é½å¨kafkaä¸ï¼ä»ä»¬çå
³ç³»åºçå®æ¶æ°æ®ä¹æ½åå°kafkaçodsï¼é£ä¹å¨æ建æ°ä»çï¼éè¦join ä¸å个大ä¸å¡è¡¨ï¼ä¸å¡è¡¨ä¼ååï¼é£ä¹æ¯å¤§çä¸å¡è¡¨æ¯ä»kafkaçods读ååï¼å®æ¶æ°ä»ï¼å¤ä¸ªå¤§è¡¨joinå¯ä»¥å
130ãTupleç±»åæä»ä¹æ¹æ³è½¬æ¢æjsonå符串åï¼ç°å¨çåºæ¯æ¯ï¼ç»æå¨åå¨å°sinkä¸æ¶å¸æåçæ¯jsonå符串ï¼è¿æ ·åºç¨ç¨åºè·åæ°æ®æ¯è¾å¥½è½¬æ¢ä¸ç¹ãå¦æTupleä¸å¥½è½¬æ¢jsonå符串ï¼é£ä¹åºè¯¥ä»¥ä»ä¹æ°æ®æ ¼å¼åå¨å°sinkä¸
140ã端å°ç«¯çæ°æ®ä¿è¯ï¼æ¯å¦æå³çä¸é´å¤çç¨åºä¸æï¼ä¹ä¸ä¼é æ该æ¹æ¬¡å¤ç失败çæ¶æ¯ä¸¢å¤±ï¼å¤çç¨åºéæ°å¯å¨ä¹åï¼ä¼å次å¤çä¸æ¬¡æªå¤ççæ¶æ¯
141ãå
³äºflink datastream windowç¸å
³çãæ¯å¦æç°å¨ä½¿ç¨æ»å¨çªå£ï¼ç»è®¡ä¸å¨å
å»éç¨æ·ææ ï¼æç
§æ£å¸¸watermark触å计ç®ï¼éè¦çå°å½åå¨çwindowå°è¾¾windowçendtimeæ¶ï¼æä¼è§¦åï¼è¿æ ·ææ ä¸å¨åæè½äº§åºç»æãæè½ä¸è½å®ç°ä¸å°æ¶è§¦åä¸æ¬¡è®¡ç®ï¼æ¯æ¬¡ç»è®¡æªæ¢å°å½åæ¶é´ï¼windowä¸ææå°è¾¾å
ç´ çå»éæ°éã
142ãFLIP-16 Loop Fault Tolerance æ¯è®²ç°å¨çcheckpointæºå¶æ æ³å¨stream loopçæ¶å容éåï¼ç°å¨è¿ä¸ªé®é¢è§£å³äºæ²¡æåï¼
143ãç°å¨çéæ±æ¯ï¼ç»è®¡å个keyçä»æ¥ç´¯è®¡å¼ï¼ä¸åéè¾åºä¸æ¬¡ãå¦ï¼å个ç¨æ·ä»æ¥ç´¯è®¡ç¹å»æ¬¡æ°ãè¿ç§éæ±ç¨datastreamè¿æ¯table APIæ¹ä¾¿ç¹ï¼
144ãæ¬å°ideaå¯ä»¥è·çå·¥ç¨ï¼æ¾å¨standaloneé群ä¸ï¼æ»æ¥éï¼æ¥éæªå¾å¦ä¸ï¼å¤§ä½¬è¯·é®è¿æ¯å¥åå
145ãæ¯å¦ç°å¨ç¨k8sèµ·äºä¸ä¸ªflinké群ï¼è¿æ¶åæ°æ®æºkafkaæè
hdfsä¼å¨åä¸ä¸ªé群ä¸åï¼è¿æ¯ä¼åç¬åèµ·ä¸ä¸ªhdfs/kafkaé群
146ãflink kafka sink çFlinkFixedPartitioner åé
çç¥ï¼å¨å¹¶è¡åº¦å°äºtopicçpartitionsæ¶ï¼ä¸ä¸ªå¹¶è¡å®ä¾åºå®çåæ¶æ¯å°åºå®çä¸ä¸ªpartitionï¼é£ä¹å°±æä¸äºpartition没æ°æ®åè¿å»ï¼
147ãåºäºäºä»¶æ¶é´ï¼æ¯äºåéä¸ä¸ªçªå£ï¼äºç§éæ»å¨ä¸æ¬¡ï¼åæ¶watermarkçæ¶é´åæ ·æ¯åºäºäºä»¶äºä»¶æ¶é´çï¼å»¶è¿è®¾ä¸º1åéï¼åå¦æ°æ®æµä»12ï¼00å¼å§ï¼å¦æ12ï¼07-12ï¼09æé´æ²¡æ产çä»»ä½ä¸æ¡æ°æ®ï¼å³å¨12ï¼07-12ï¼09è¿æ®µé´çæ°æ®æµæ
åµä¸ºÂ·Â·Â·Â· ï¼12ï¼07:00ï¼xxxï¼,(12:09:00,xxx)······ï¼é£ä¹çªå£[12:02:05-12:07:05]ï¼[12:02:10-12:07:10]çå 个çªå£ç计ç®æ¯å¦æå³çåªæçå°ï¼12ï¼09ï¼00çæ°æ®å°è¾¾ä¹åæä¼è§¦å
148ã使ç¨flink1.7ï¼å½æ¶è´¹å°ææ¡æ¶æ¯(protobufæ ¼å¼)ï¼æ¥Caused by: org.apache.kafka.common.KafkaException: Record batch for partition Notify-18 at offset 1803009 is invalid, cause: Record is corrupt è¿ä¸ªå¼å¸¸ã å¦ä½è®¾ç½®è·³è¿å·²æåçæ¶æ¯ç»§ç»æ¶è´¹ä¸ä¸æ¡æ¥ä¿è¯ä¸å¡ä¸ç»æï¼ æçäºå®ç½kafka connectorsé£éï¼è¯´å¨DeserializationSchema.deserialize(...)æ¹æ³ä¸è¿ånullï¼flinkå°±ä¼è·³è¿è¿æ¡æ¶æ¯ï¼ç¶èä¾æ§æ¥è¿ä¸ªå¼å¸¸
149ãæ¯å¦å¯ä»¥æ½ç©ºæ»ç»ä¸ç¯Flink ç watermark çåçæ¡ä¾ï¼ä¸ç´æ²¡ææç½åºäºäºä»¶æ¶é´å¤çæ¶çæ°æ®ä¹±åºåæ°æ®è¿å°åºååäº
150ãflinkä¸rpcéä¿¡çåçï¼ä¸å 个类ç讲解ï¼æ没æç³»ç»è¯¦ç»çæç« æ ·ï¼å¦ææ±å享ï¼è°¢è°¢
151ãFlinkä¸å¦ä½ä½¿ç¨åºäºäºä»¶æ¶é´å¤çï¼ä½æ¯åä¸ä½¿ç¨Watermarks? æå¨ä¼è¯çªå£ä¸ä½¿ç¨éå°ä¸äºé®é¢ï¼å¾ä¸æ¯åºäºå¤çæ¶é´çï¼æµè¯ç»æsessionæ¯åºäºkeyby(ç¨æ·)çï¼å¾äºæ¯åºäºäºä»¶æ¶é´çï¼ä¸ç¥éæ¯æç¨æ³ä¸å¯¹è¿æ¯æä¹çï¼æµè¯ç»æåç°å¹¶ä¸æ¯åºäºkeyby(ç¨æ·ç)ï¼èæ¯å
¨å±çsessionãä¸ç¥éæä¹ä¿®æ¹ï¼
152ãflinkå®æ¶è®¡ç®å¹³å°ï¼yarn模å¼æ¥å¿æ¶éæä¹åï¼ä¸ºä»ä¹ä¼checkpoint失败ï¼æ¥è¦å¤çï¼åéè¦åä»ä¹åï¼jobçæ§æä¹å
153ãæflinkä¸jstormçå¨ä¸ååºç¨åºæ¯ä¸, æ§è½æ¯è¾çæ°æ®å? ä»ç½ç»ä¸è½æ¾å¤§é¨åé½æ¯flinkä¸stormçæ¯è¾. å¨jstormå®ç½ä¸æä¸ä»½æ¯è¾çå¾è¡¨, æè§åèæä¹ä¸å¤§, åºè¯¥æ¯æ¯è¾æ©çflinkçæ¬.
154ã为ä»ä¹ä½¿ç¨SessionWindows.withGapçªå£çè¯ï¼Stateåä¸äºä¸è¥¿åï¼æ¯æ¬¡å 1 ï¼æ¿åºæ¥é½æ¯null, ææ¢æ TimeWindow就没é®é¢ã
155ã请é®ä¸ä¸ï¼flink datastreamæµå¤çæä¹ç»è®¡å»éææ ï¼ å®æ¹ææ¡£ä¸åªçå°æ¹å¤çædistinctæ¦å¿µã
156ã好å
¨çä¸ç¯æç« ï¼å¯¹æ¯åæ Flinkï¼Spark Streamingï¼Storm æ¡æ¶
157ãå
³äº structured_streaming ç paper
158ãzookeeperé群åæ¢é¢å¯¼äºï¼flinké群项ç®éå¯äºå°±æ²¡ææ°æ®çè¾å
¥åè¾åºäºï¼è¿ä¸ªè¯¥ä»åªæ¹é¢å
¥æ解å³ï¼
159ãææ³è¯·æä¸datastreamæä¹åéææ°æ®joinå¢
160ãæ¶éé®é¢å¯¼è´æ¶å°äºæ天çæ°æ®ï¼è¿æ¶åæä»ä¹æ¯è¾å¥½çå¤çæ¹æ³ï¼çå°æ人设置ä¸ä¸ªæ大çè·³è·éå¼ï¼å¦æå½åæ°æ®æ¶é´ - åå²æ大æ¶é´ è¶
è¿éå¼å°±ä¸æ´æ°ãå¦ä½åçç设计水å°ï¼æ没æä¸äºç»éªå¢ï¼
161ã大佬们flinkæä¹å®æ¶æ¥è¯¢æ°æ®åºï¼
162ãç°å¨æ们å
¬å¸æ个æ³æ³ï¼å°±æ¯æä¾ä¸ä¸ªé¡µé¢ï¼å¨é¡µé¢ä¸éæ©source sink å¡«åä¸sqlè¯å¥ï¼ç¶ååå°çæä¸ä¸ªflinkçä½ä¸ï¼ç¶åæ交å°é群ãåè½æç¹ç±»ä¼¼äºå为çæ°æ®ä¸å°ï¼å°±æ¯é¡µé¢å»çå¼æä½ãåå°è½èªå¨æ ¹æ®ç¸åºé
ç½®å¾å°ç»æã请é®æä½ çäºè§£ï¼å¯ä»¥å®ç°åï¼å¦ä½å®ç°ï¼æä»ä¹å¥½çæè·¯ãç°å¨ææ ä»ä¸æ
163ã请æä¸ä¸ flink on yarn ç haæºå¶
164ãå¨ä¸è¬çæµå¤ç以åcep, é½å¯ä»¥å¯¹äºeventtime设置watermark, ææ¶å¯è½éè¦è®¾ç½®ç¸å¯¹å¤§ä¸ç¹çå¼, è¿å
åååå°±æ¯è¾å¤§, æ没æåæ³ä¸åºç¨jvmä¸çå
å, èç¨å å¤å
å, æè
å
¶ä»ç¼å, æ好æcacheæºå¶, è¿æ ·å¯ä»¥åºå¯¹å¤§æµéçå³°å¼.
165ã请æä¸ä¸ªflink sqlçé®é¢ãææ两个èååçæµè¡¨AåBï¼AåBjoinå¾å°C表ãå¨è®¾ç½®state TTL çæ¶åæ¯ç´æ¥å¯¹C表设置è¿æ¯ï¼å¯¹A表åB表设置æ¯è¾å¥½ï¼
166ãsparkæ¹å为flinkï¼ä¼ä¸ä¼å¾å¤æï¼è¿æè¿ä¸¤è
å¨SQLæ¹é¢çæ¯æå·®å«å¤§åï¼
167ã请é®flink allowedLateness导è´çªå£è¢«å¤æ¬¡fireï¼æç»æ°æ®éå¤æ¶è´¹ï¼è¿ç§é®é¢æä¹å¤çï¼æ°æ®æ¯åå°esä¸
168ã设置taskmanager.numberOfTaskSlots: 4çæ¶å没æé®é¢ï¼ä½æ¯cpu没æåä¸å»ï¼åªç¨äº30%å·¦å³ï¼äºæ¯è®¾ç½®äºtaskmanager.numberOfTaskSlots: 8ï¼ä½æ¯å°±æ¥é误æ¾ä¸å°å
¶ä¸ä¸ä¸ªèªå®ä¹çç±»ï¼ç¶åkafkaæ°æ®å°±ä¸æ¶è´¹äºã为ä»ä¹ï¼cpuå°å¤å°åéï¼slotæ¯ä¸æ¯åcpuæ°éä¸è´æ¯æä½³é
ç½®ï¼kafkaååºæ°å¤å°åéï¼æ¯ä¸æ¯åslot,parallesimä¸è´æä½³ï¼
169ãéæ±æ¯æ ¹æ®æ¯æ¡æ¥å¿åååºéè¦9个å段ï¼æäºä¸ªææ åæ ¹æ®9个å段çä¸åç»åå»å计ç®ã 第ä¸ä¸ªæ¹æ³æ¯ï¼æç®ååæ³æ¯ååç9个å段å¼5åé大å°1åé计ç®ä¸æ¬¡çæ»å¨çªå£çªå£ï¼è¿è¡ä¸æ¬¡reduceå»éï¼ç¶ååmapååºéè¦çå段ï¼ç¶åè¿æ»¤åå¼5åé大å°1åé计ç®ä¸æ¬¡çæ»å¨çªå£çªå£è¿è¡è®¡ç®ä¿åç»æï¼è¿ä¸ªæè·¯éå°çé®é¢æ¯ä¸ä¸ä¸ªæ»å¨çªå£ä¼æ¯ä¸åéä¼è®¡ç®5åéæ°æ®ï¼å°ç¬¬äºä¸ªçªå£åå®ç5åéèå´çæ°æ®ä¼æ好å¤éå¤ï¼è¿ä¸ªæè·¯ä¼é ææ°æ®éå¤ã 第äºä¸ªæ¹æ³æ¯ï¼ååç9个å段å¼5åé大å°1åé计ç®ä¸æ¬¡çæ»å¨çªå£çªå£ï¼åprossæ¹æ³éå®æææçè¿æ»¤ï¼èå计ç®ï¼ä½æ¯åé«å³°ææ¯åé400ä¸æ¡æ°æ®ï¼è¿ä¸ªæè·¯æ
å¿å¨é«å³°æflink计ç®ä¸è¿æ¥
170ãa,b,cä¸ä¸ªè¡¨ï¼aåcæeventtimeï¼aåcç´æ¥joinå¯ä»¥ï¼aåb joinåååc join å°±ä¼æ¥éï¼è¿æ¯æä¹åäºå¢
171ãèªå®ä¹çsourceæ¯è¿æ ·çï¼å¾ä¸æç¤ºï¼ ä½¿ç¨çæ¶åæ¯è¿æ ·çï¼å¾äºæ示ï¼ï¼ä¸ºä»ä¹æ 论 sum.print().setParallelism(2)ï¼å¾2æ示ï¼ç并è¡åº¦è®¾ç½®æå æåç»æé½æ¯è¿æ ·ç
172ãåæ¥è§¦flinkï¼å¦æé®çä¸åéçå°æ¹ï¼è¯·è§è°
ã 1ã为ä»ä¹è¯´flinkæ¯æç¶æç计ç®ï¼ 2ãè¿ä¸ªç¶ææ¯ä»ä¹ï¼3ãç¶æåå¨åªé
173ãè¿è¾¹ç¨flink 1.8.1ççæ¬ï¼éç¨flink on yarnï¼hadoopçæ¬2.6.0ã代ç æ¯ä¸ä¸ªç®åçæ»å¨çªå£ç»è®¡å½æ°ï¼ä½å¯å¨çæ¶åæ¥éï¼å¦ä¸å¾çã ï¼2ï¼ç¶åææflinkçæ¬æ¢æ1.7.1ï¼éæ°æ交å°2.6.0çyarnå¹³å°ï¼å°±è½æ£å¸¸è¿è¡äºã ï¼3ï¼æ们æµè¯é群hadoopçæ¬æ¯3.0ï¼æç¨flink 1.8.1çæ¬å°è¿ä¸ªç¨åºå次æå
ï¼æ交å°3.0çæ¬çyarnå¹³å°ï¼ä¹è½æ£å¸¸è¿è¡ã è²ä¼¼æ¯flink 1.8.1çæ¬ä¸yarn 2.6.0çæ¬ä¸å
¼å®¹é æçè¿ä¸ªé®é¢
174ãStateBackendæ使ç¨çæ¯MemoryStateBackendï¼ Stateæ¯æä¹éæ¾å
åçï¼ä¾å¦æå¨å½æ°ä¸ç¨ValueStateåå¨äºåå²ç¶æä¿¡æ¯ãä½æ¯åå²ç¶ææ°æ®æ没ææå¨éæ¾ï¼é£ä¹ç¨åºä¼èªå¨éæ¾ä¹ï¼è¿æ¯ä¸ç´é©»çå¨å
åä¸
175ã请é®èå¸æ¯å¦å¯ä»¥æä¾ä¸äºApachebeamçå¦ä¹ èµæ 谢谢
176ãflink ç DataSetæè
DataStreamæ¯æç´¢å¼æ¥è¯¢ä»¥åå é¤åï¼åspark rddï¼å¦æä¸æ¯æçè¯ï¼è¯¥è½¬æ¢æä»ä¹
177ãå
³äºflinkçç¶æï¼è½å¦æå®å½åæ°æ®åºä½¿ç¨ï¼ç±»ä¼¼äºå
åæ°æ®åºï¼å¨å¤çè¿ç¨ä¸åä¸å¡æ°æ®ãå¦ææ¯æ°æ®åºå¯ä»¥ç®æ¯åå¸å¼æ°æ®åºå?æ¯ä¸æ¯ä½¿ç¨rocksdbè¿ç§åå¨æ¹å¼æç®æ¯?æ¯æçååºå¤§å°æ¯ä¸æ¯åªæ¯è·æ¬å°æºå¨çç£ç大å°ç¸å
³?å¦æ使ç¨ç¡¬çåå¨ä¼ä¸ä¼æçæ§è½æå½±å
178ãæè¿è¾¹åäºä¸ªhttp sinkï¼æ³è¦æ¹éåéæ°æ®ï¼ä¸è¿ç°å¨åªè½ç¨æ°éæ§å¶åéï¼ä½æåçå 个记å½æ²¡æ³è§¦ååéå¨ä½ï¼æ³é®ä¸æ没æä»ä¹åæ³
179ã请é®ä¸å¦ä½åå®æ¶å»é计æ°ï¼å°±æ¯æ ¹æ®æ¶é´åçªå£ï¼çªå£å
æ ¹æ®idå»é计æ°å¾åºç»æï¼å¤è°¢ãè¯äºä¸å°åæ³ï¼æ²¡æç®åç´æ¥åæ³
180ãææ个job使ç¨äºelastic search sink. 设置äºæ¹é5000ä¸åå
¥ï¼ä½æ¯çesçæ§æ¾ç¤ºæ¯ç§åªè½æå
¥500æ¡ãæ¯ä¸æ¯bulkprocessorçcurrentrequest为0æå
³
181ãædockeré¨ç½²flinkçèµæå
182ãå¨è¯´æKeyByçStreamGraphæ§è¡è¿ç¨æ¶ï¼keyByçID为å¥æ¯6ï¼ æ ¹æ®åé¢è¯´ï¼IDæ¯ä¸ä¸ªéæåéï¼æ¯åä¸æ¬¡å°±éå¢1ï¼æè§å¾åºè¯¥æ¯3åï¼æ¯æç解éäºå
183ãæ没计ååºExecution Graphçè¿ç 解æ
184ãå¯ä»¥å享ä¸ç©çæ§è¡å¾ææ ·ååtaskï¼ä»¥åtaskå¦ä½æ§è¡ï¼è¿æä»ä»¬ä¹é´æ°æ®å¦ä½ä¼ éè¿å代ç åï¼
185ãFlinkæºç åè¿ä¸ªå¦ä¹ 项ç®çç»æå¾
186ã请é®flink1.8ï¼å¦ä½åå°å¨æå è½½å¤é¨udf-jarå
å¢ï¼
187ãåä¸ä¸ªTask Managerä¸ä¸åçSlotæ¯æä¹äº¤äºçï¼æ¯å¦ï¼sourceå¤çå®è¦ä¼ éç»mapçæ¶åï¼å¦æå¨ä¸åçSlotä¸ï¼ä»ä»¬çå
åæ¯ç¸äºé离ï¼æ¯æä¹äº¤äºçå¢ï¼ æçæ¯éè¿åºåååååºåå对象ï¼å¹¶ä¸éè¿ç½ç»æ¥è¿è¡äº¤äºç
188ãä½ ä»¬æ没æè¿ç§ä¸å¡åºæ¯ãflinkä»kafkaéé¢åæ°æ®ï¼æ¯ä¸æ¡æ°æ®éé¢æmongdb表Açid,è¿æ¶æä¼å¨mapçæ¶åéç¨flinkçå¼æ¥IOè¿æ¥A表ï¼ç¶åæ¥è¯¢åºA表çå段1ï¼åæ ¹æ®è¯¥å段1åéè¦å¼æ¥IOå»B表æ¥è¯¢å段2ï¼ç¶ååæ ¹æ®å段2å»C表æ¥è¯¢å段3.....åè¿æ ·çä¸å¡åºæ¯ï¼å¦æå¤æ¥å ç§é»è¾ï¼æåºè¯¥ç¨ä»ä¹æ¹æ¡æ好å¢
189ãä»å¤©æ¬å°è¿è¡flinkç¨åºï¼æ¶è´¹socketä¸çæ°æ®ï¼è¿ç»åªè½æ¶è´¹ä¸¤æ¡ï¼ç¬¬ä¸æ¡flinkå°±æ¶è´¹ä¸äºäº
190ãæºæ°æ®ç»è¿è¿æ»¤ååæäºä¸¤æ¡æµï¼ç¶åååå«æåäºä»¶æ¶é´åæ°´å°ï¼åæ¶é´çªå£ï¼ææµè¯æ¶ä¸æ¡æµæ²¡ææ°æ®ï¼å¦ä¸æ¡çæ°æ®çæ¥å¿å°äºçªå£æä½é£è¾¹å°±æ²¡èµ°ä¸å»ï¼è²ä¼¼çªå£ä¸ç´æ²¡æçå°è§¦å
191ãæåflink cepçåï¼æèµæ没ï¼
192ã麻ç¦é®ä¸ä¸ BucketingSinkè·¨é群åï¼å¦æä»»å¡è¿è¡å¨hadoop Aé群ï¼ä»kafka读åæ°æ®å¤çååå°Hadoo Bé群ï¼å³ä½¿æcore-site.xmlåhdfs-site.xmlæ·è´å°ä»£ç resourcesä¸ï¼è·¯å¾ä½¿ç¨hdfs://hadoopB/xxxï¼ä¼æ示ava.lang.RuntimeException: Error while creating FileSystem when initializing the state of the BucketingSink.ï¼è·¨é群åè¿ä¸ªé®é¢ flinkä¸æ¯æåï¼
193ãæ³å¨è¯¢ä¸ï¼å¦ä½å¯¹flinkä¸çdatastreamådatasetè¿è¡æ°æ®éæ ·
194ãä¸ä¸ªflinkä½ä¸ç»å¸¸åçoomï¼å¯è½æ¯ä»ä¹åå 导è´çã å¤çæµç¨åªæ15+å段ç解æï¼redisæ°æ®è¯»åçæä½ï¼TMé
ç½®10gã ä¸å¡ä¼å¨å¤é´å·æ°æ®ï¼qpsè½æå°2500å·¦å³~
195ãæçå°flink 1.8çç¶æè¿æä»
æ¯æProcessing Timeï¼é£ä¹å¦ææ使ç¨çæ¯Event timeé£ä¹ç¶æå°±ä¸ä¼è¿æå
196ã请é®ææ³æ¯éä¸å°æ¶ç»è®¡ä¸ä¸ªå±æ§ä»å½å¤©é¶ç¹å°å½åæ¶é´çå¹³åå¼ï¼è¿æ ·çæ¶é´çªè¯¥å¦ä½å®ä¹ï¼
197ãflinkä»»å¡éé¢ååºååä¸ä¸ªç±»ï¼æ¥ClassNotFoundExceptionï¼å¯æ¯å
éé¢æ¯æè¿ä¸ªç±»çï¼æéå°è¿ç§æ
åµåï¼
198ãå¨æé StreamGraphï¼ç±»ä¼¼PartitionTransformmation è¿ç§ç±»åç transformï¼ä¸ºä»ä¹è¦æ·»å æä¸ä¸ªèæèç¹ï¼èä¸æ¯ä¸ä¸ªå®é
çç©çèç¹å¢ï¼
199ãflinkæ¶è´¹kafkaçæ°æ®åå
¥å°hdfsä¸ï¼æéç¨äºBucketingSink è¿ä¸ªsinkå°operatoråºæ¥çæ°æ®åå
¥å°hdfsæ件ä¸ï¼å¹¶éè¿å¨hiveä¸å»ºå¤é¨è¡¨æ¥æ¥è¯¢è¿ä¸ªãä½ç°å¨æ个é®é¢ï¼å¤äºin-progressçæ件ï¼hiveæ¯æ æ³è¯å«åºæ¥è¯¥æ件ä¸çæ°æ®ï¼å¯ææ³è½å¨hiveä¸å®æ¶æ¥è¯¢è¿æ¥çæ°æ®ï¼ä¸ä¸æ³äº§çå¾å¤çå°æ件ï¼è¿ä¸ªè¯¥å¦ä½å¤çå¢
200ãéç¨Flinkåæºé群模å¼ä¸ä¸ªjobmanagerå两个taskmanagerï¼æºå¨æ¯åæºæ¯24æ ¸ï¼ç°å¨å个ç®åçåè½ä»kafkaçä¸ä¸ªtopic转满足æ¡ä»¶çæ¶æ¯å°å¦ä¸ä¸ªtopicï¼topicçååºæ¯30ï¼æ设置äºç¨åºé»è®¤å¹¶å为30ï¼ç°å¨æ¯ç§æ¶è´¹2wå¤æ°æ®ï¼ä¸å¤å¿«ï¼è¯·é®å¯ä»¥æä¹æé«jobçæ§è½å¢ï¼
201ãFlink Metric æºç åæ
202ã请é®æä¹ç解å®ç½çè¿æ®µè¯ï¼æå®ç½çä¾åï¼é¾éåªkeybyä¹åæækeyed stateï¼æè½æ管Flinkåå¨ç¶æä¹ï¼sourceåmapå¦æ没æèªå®ä¹operator stateçè¯ï¼ç¶ææ¯ä¸ä¼è¢«ä¿åçï¼
203ãæ³ç¨Flinkåä¸å¡çæ§åè¦ï¼å¹¶è¦è½å¤æ¯æå¨ææ·»å CEPè§åï¼é®ä¸å¯ä»¥ç´æ¥ä½¿ç¨Flink CEPè¿æ¯siddhi CEP? æ没æç¸å
³çèµæå¦ä¹ ä¸ï¼è°¢è°¢ï¼
204ã请é®ä¸ä¸ï¼æ没æå
³äºæ°´å°ï¼è§¦åå¨çJavaæ¹é¢çdemoå
205ãèå¸ï¼æè¿æ们线ä¸å¶å°åºç°è¿ç§æ
åµï¼å°±æ¯40个并è¡åº¦ï¼å
¶ä»æä¸ä¸ªå¹¶è¡åº¦CheckPointä¸ç´å¤±è´¥ï¼å
¶ä»39个并è¡åº¦é½æ¯æ¯«ç§çº§å«å°±å¯ä»¥CheckPointæåï¼è¿ä¸ªæä¹å®ä½é®é¢å¢ï¼è¿æ个é®é¢ CheckPointçæ¶é´å为ä¸é¨å Checkpoint Duration (Asyncï¼å Checkpoint Duration (Syncï¼ï¼è¿æ个 end to end åå»åæ¥åå¼æ¥çæ¶é´ï¼è¿ä¸é¨å åå«æ代åªåï¼å¦æåç°è¿ä¸è
ä¸çä»»æä¸ä¸ªæ¥éª¤æ¶é´é¿ï¼è¯¥æä¹å»ä¼å
206ãæè¿è¾¹æ个åºæ¯å¾ä¾èµæ¶è´¹åºæ¥çæ°æ®ç顺åºãå¨æºå¤´ä¾§åäºå¾å¤å¤çï¼å°kafkaä¿®æ¹æä¸ä¸ªååºççå¾å¤å°è¯ï¼æåæ¶è´¹åºæ¥çè¿æ¯ä¹±åºçãè½ä¸è½å¨flinkæ¶è´¹çæ¶ååå¤çï¼æ¥ä¿è¯å¤ççæ°æ®ç顺åºã
207ãæä¸ä¸ªç±»ä¼¼äºå®æ¶è®¡ç®ä»å¤©çpvï¼uvéæ±ï¼éç¨source->keyby->window->trigger->processåï¼å¨processééç¨ValueState计ç®uv ,é®é¢æ¯ è¿ä¸ªwindowå
ä¸å¤©çæææ°æ®æ¯é½ä¼ç¼åå°flinkåï¼ ä¸å¤©çæ°æ®éå¦æ大ç¹ï¼è¿æ ·å®ç°å°±æé®é¢äºï¼ è¿ä¸ªæå
¶ä»çå®ç°æè·¯åï¼
208ãFlink 注解æºç 解æ
209ãå¦ä½çæ§ Flink ç TaskManager å JobManager
210ãé®ä¸ï¼å¨çå®æµè®¡ç®è¿ç¨ä¸ï¼å¹¶è¡åº¦ç设置ï¼æ¯ä¸ kafka topicçpartitionæ°ä¸æ ·çåï¼
211ãFlinkçæ¥å¿ å¦æèªå·±åå¹³å°å°è£
å¨èªå·±ççé¢ä¸ 请é®job Manger å taskManger è¿æç¨æ·èªå·±çç¨åºæ¥å¿ æä¹è·åå¢ æapiè¿æ¯èªå·±éè¦å©ç¨flume ééå°ELKï¼
212ãææ³é®ä¸ä¸è¬ç¨Flinkç»è®¡pv uvæ¯æä¹åçï¼uvåå°redis? æ¯ä¸ªuvé½åå°redisï¼ä¼ä¸ä¼æçï¼
213ãFlinkçCheckpoint æºå¶ï¼å¨æå¤ä¸ªsourceçæ¶åï¼barrier n çæµå°è¢«ææ¶æç½®ï¼ä»å
¶ä»æµæ¥æ¶çè®°å½å°ä¸ä¼è¢«å¤çï¼ä½æ¯ä¼æ¾è¿ä¸ä¸ªè¾å
¥ç¼åinput bufferãå¦æ被ç¼åçrecord大å°è¶
åºäºinput bufferä¼æä¹æ ·ï¼ä¸å¯è½ä¸ç´ç¼åä¸å»å§ï¼å¦æå
¶ä¸æä¸æ¡å°±ä¸ç´æ²¡æ°æ®çè¯ï¼æ´ä¸ªè¿ç¨å²ä¸æ¯å¡æ»äºï¼
214ãå
¬å¸æ³å®æ¶å±ç¤ºè®¢åæ°æ®ï¼æ±æ»éé¢ï¼å¹¶éè¦åå端交äºï¼å®æ¶çææ°æ®éè¦åè¯å端ï¼å±ç¤ºææ线å¾ï¼è¿ç§åºæ¯çææ¯éåæ¯å¦ä½å¢ï¼å
æ¬æ°æ®çåå¨ï¼ä¸´æ¶æ±æ»æ°æ®çåå¨ï¼ä½ç§å½¢å¼åè¯å端
215ã请é®ä¸checkpointä¸åå¨äºåªäºä¸è¥¿ï¼
216ãæè¿è¾¹æ个éæ±æ¯å®æ¶è®¡ç®å½å车è¾ä¸å车è·ç¦»ï¼ç¨ç»çº¬åº¦æ±è·ç¦»ã大æ¦6000å°è½¦ï¼10ç§ä¸æ¡ç»çº¬åº¦æ°æ®ãgpsæµä¸èªå·±joinçå°æ¹å¨è¿è¡checkpointçæ¶åç¹å«ç¼ï¼æ¯æ¬¡è¦å¥½å åéãcheckpoint ç¶æå端æ¯rocksDBãæä»ä¹æ¯è¾å¥½çæ¹æ¡åï¼èªå·±å®ç°ä¸ä¸ªç±»ä¼¼last_valueçå½æ°å车è¾ææ°çç»çº¬åjoinï¼æè
å¼ä¸ª10ç§çæ»å¨çªå£è¾åºè½¦è¾ææ°çç»çº¬åº¦åè¿è¡joinï¼è¿æ ·å¯è¡åï¼
217ãflinkå¨å¯å¨çæ¶åè½ä¸è½æå®ä¸ä¸ªæ¶é´ç¹ä»kafkaéé¢æ¢å¤æ°æ®å¢
218ãæ们线ä¸æ个é®é¢ï¼å¾å¤ä¸å¡é½å»è¯»æ个hive表ï¼ä½æ¯å½è¿ä¸ªhive表æ£å¨åæ°æ®çæ¶åï¼å¶å°åºç°è¿ 读å°è¡¨éæ°æ®ä¸ºç©ºçæ
åµï¼è¿ä¸ªé®é¢æä¹è§£å³å¢ï¼
219ãä½¿ç¨ InfluxDB å Grafana æ建çæ§ Flink çå¹³å°
220ãflinkæ¶è´¹kafka两个ä¸åçtopic,ç¶åè¿è¡joinæä½ï¼å¦æ使ç¨äºä»¶æ¶é´ï¼ä¸¤ä¸ªtopicé½è¦è®¾ç½®watermakeråï¼å¦æåªè®¾ç½®äºtopic Açwatermaker,topic Bçä¸è®¾ç½®ä¼æä»ä¹å½±ååï¼
221ã请æä¸ä¸ªé®é¢ï¼æçFlinkç¨åºè¿è¡ä¸æ®µæ¶é´å°±ä¼æ¥è¿ä¸ªé误ï¼å®ä½å¥½å¤å¤©é½æ²¡æå®ä½å°ãcheckpoint æ¶é´æ¯5ç§ï¼20ç§é½ä¸è¡ãCaused by: java.io.IOException: Could not flush and close the file system output stream to hdfs://HDFSaaaa/flink/PointWideTable_OffTest_Test2/1eb66edcfccce6124c3b2d6ae402ec39/chk-355/1005127c-cee3-4099-8b61-aef819d72404 in order to obtain the stream state handle
222ãFlinkçååæºå¶ç¸æ¯äºStormçååæºå¶æä»ä¹ä¼å¿å¢ï¼é®é¢2: Flinkçæä¸ä¸ªèç¹åçæ
éï¼æ¯å¦ä¼å½±åå
¶ä»èç¹çæ£å¸¸å·¥ä½ï¼è¿æ¯ä¼éè¿Checkpoint容éæºå¶åæä»»å¡è½¬ç§»å°å
¶ä»èç¹å»è¿è¡å¢ï¼
223ãæå¨éªè¯checkpointçæ¶åéå°ç»é®é¢ï¼ä¸ç®¡æ¯key state è¿æ¯operator stateï¼é»è®¤åæå®uidæ¯å¯ä»¥çæ¢å¤stateæ°æ®çï¼å½æå®uidHashæ¶åæ æ³æ¢å¤stateæ°æ®ï¼éº»ç¦å¤§å®¶ç»è§£çä¸æ ·ãææä½stateæ¯å®ç°äºCheckpointedFunctionæ¥å£ï¼è¦åsnapshotStateåinitializeStateï¼åè¿ä¸¤ä¸ªæ¹æ³éæä½çï¼ç¶å让ç¨åºå®æ¶æåºå¼å¸¸ï¼è§å¯åç°æå®uidHashåsnapshotState()æ¹æ³écontext.isRestored()为falseï¼ä¸å¤ªæç½å
·ä½æ¯ä»ä¹åå
224ãkafka ä¸çæ¯æ¡æ°æ®éè¦å es ä¸çæææ°æ®(å¨æå¢å )å
³èï¼å
³èä¹åä¼åä¸äºé¢å¤çæä½ï¼è¿ä¸ªæä»ä¹æ¯è¾å¯è¡çæ¹æ¡ï¼
225ãflinkæ¶è´¹kafkaæ°æ®ï¼è®¾ç½®1åécheckpointä¸æ¬¡ï¼åå¦ç¬¬ä¸æ¬¡checkpointå®æ以åï¼è¿æ²¡çå°ä¸ä¸æ¬¡checkpointï¼ç¨åºå°±æäºï¼kafka offsetè¿æ¯ç¬¬ä¸æ¬¡checkpointè®°å½çoffset,é£ä¹ä¸æ¬¡éæ°å¯å¨ç¨åºï¼å²ä¸æ¯å¤æ¶è´¹æ°æ®äºï¼é£flinkç exactly oneæ¶è´¹è¯ä¹æ¯æä¹æ ·çï¼
226ãç¨åºé¢ç¹åçHeartbeat of TaskManager with id container_e36_1564049750010_5829_01_000024 timed out. å¿è·³è¶
æ¶ï¼ä¸å¤©å¤§æ¦10次左å³ãæ¯å
å没ç»å¤åï¼è¿æ¯ç½ç»æ³¢å¨å¼èµ·ç
227ãæ没ææ§è½ä¼åæ¹é¢çæ导æç« ï¼
228ãflinkæ¶è´¹kafkaæ¯å¦ä½çæ§æ¶è´¹æ¯å¦æ£å¸¸çï¼æå¥å¥½åæ³ï¼
229ãææç
§å®æ¹çwordcountæ¡ä¾åäºä¸ä¸ªä¾åï¼ç¶åå¨mainå½æ°ä¸èµ·äºä¸ä¸ªçº¿ç¨ï¼åæ¬æ¯åå¤å®æ¶å»æ´æ°æäºé
ç½®ï¼åå¤æµè¯ä¸ä¸æ¯å¦å¯è¡ï¼æ以ç´æ¥å¨çº¿ç¨å½æ°ä¸æå°ä¸æ¡è¯å¥æµè¯æ¯å¦å¯è¡ãç°å¨æµè¯çç»ææ¯ä¸å¯è¡ï¼è²ä¼¼è¿ä¸ªçº¿ç¨æ ¹æ¬å°±æ²¡ææ§è¡ï¼è¯·é®è¿æ¯ä»ä¹åå å¢ï¼ æç
§ç解ï¼JobClientä¸ä¸æ¯åå°ç±»æ§è¡mainå½æ°åï¼ æ§è¡mainå½æ°çæ¶å为ä»ä¹æ²¡ææ§è¡è¿ä¸ªçº¿ç¨çæå°å½æ°å¢ï¼
230ã请é®ææ³ä¿çæè¿å¤ä¸ªå®æçcheckpointæ°æ®ï¼æ¯éè¿è®¾ç½® state.checkpoints.num-retained åï¼è¦æä¹ä½¿ç¨ï¼
231ãæ没æetlå®æ¶æ°ä»ç¸å
³æ¡ä¾ä¹ï¼æ¯å¦äºåå¼ äºå®è¡¨æµjoin
232ã为ä»ä¹ææå°flink çstream jobï¼ç«å»å°±finished
233ãæ没æå¨flinkä¸æºå¨å¦ä¹ ç®æ³çä¸äºä¾ååï¼é¤äºå®ç½æä¾çflink exampkeéçåflink mléå·²æç
234ãå¦æææ³æ©å±sqlçå
³é®è¯ï¼æ¯å¦æ·»å ä¸äºæ°æ®æ¯æï¼æä»ä¹æè·¯ï¼ç°å¨æ³çæè§é½è¦æ¹calciteï¼å碰flinkæè§é¾åº¦å¤ªå¤§äºï¼
235ãææ³å®ç°ç»è®¡æ¯5ç§ä¸æ¯ä¸ªç±»åç次æ°ï¼è¿ä¸ªç°å¨ä¸è¾åºï¼é®é¢åºå¨åªå¿å
236ãæç¨flinkå¾hbaseéåæ°æ®ï¼æé£ç§ç´æ¥æ¹éåhfileçæ¹å¼çdemo没
237ã请é®æä¹çæ§Kafkaæ¶è´¹æ¯å¦å»¶è¿ï¼æ¯å¦åºç°æ¶æ¯ç§¯åï¼ä½ ædemoåï¼è¿ç§æ¯ç¨Springbootèªå·±åä¸ä¸ªçæ§ï¼è¿æ¯åæ´åï¼
238ã请é®æ计ç®pv uvçä¾åå
239ãéè¿æ§å¶æµå¨æä¿®æ¹windowç®åçªå£ç±»ååé¿åº¦è¦æä¹å
240ãflinkçè¿ç¨è°è¯è½åºä¸çä¹ï¼ç½ä¸èµæåçå¤
241ãä¼ä¸éï¼Flinkå¼åï¼javaç¨å¾å¤ï¼è¿æ¯scalaç¨å¾å¤ï¼
242ãflinkçä»»å¡è¿è¡å¨yarnçç¯å¢ä¸ï¼å¨yarnçresourcemanagerå¨è¿è¡ä¸»å¤åæ¢æ¶ï¼ææçflinkä»»å¡é½å¤±è´¥äºï¼èMRçä»»å¡å¯ä»¥æ£å¸¸è¿è¡ãæ¥éä¿¡æ¯å¦ä¸ï¼AM is not registered for known application attempt: appattempt_1565306391442_89321_000001 or RM had restarted after AM registered . AM should re-register
请é®è¿æ¯ä»ä¹åå ï¼è¯¥å¦ä½å¤çå¢ï¼
243ã请æä¸ä¸ªåå¸å¼é®é¢ï¼æ¯å¦å¨Flinkçå¤ä¸ªTaskManagerä¸ç»è®¡ææ countï¼TM1æ两æ¡æ°æ®ï¼TM2æä¸æ¡æ°æ®ï¼ç¨åºæ¯æä¹è®¡ç®åºæ¥æ¯3å¢ï¼åçæ¯æä¹æ ·ç
244ãç°å¨å
¬å¸é¨åsqlæ¥è¯¢oracleæ°æ®ç¹å«çæ
¢ï¼å 为æ¥è¯¢æ¡ä»¶å¾å¤æ³é®ä¸ä¸æä»ä¹æ¹æ³ï¼ä¾å¦åºäºå¤§æ°æ®ç»ä»¶å¯ä»¥å å¿«æ¥è¯¢é度çåï¼
245ãæ³å¨è¯¢ä¸æ没æåè¿flinkåæ¥é
ç½®åèªå®ä¹è®¡ç®çç³»ç»ï¼æè
æ没æä»ä¹å¥½ç建议ï¼ä¸å¡è¯æ±æ¯å¸æä¸å¡ç¨æ·å¯ä»¥èªå©é
置计ç®è§ååæµå¼è®¡ç®
246ãæè¿è¾¹æ个å®æ¶åæ¥æ°æ®çä»»å¡ï¼ç½å¤©è¿è¡çæ¶åä¸ç´æ¯æ£å¸¸çï¼ä¸å°åæ¨2ç¹å¤ä¹å就没ææ°æ®sinkè¿mysqlãæä¸ä¼æä¸äºç¦»çº¿ä»»å¡åä¸äºdataXä»»å¡åæ¥æ°æ®å°mysqlãä½æ¯ä»»å¡ä¸åé½æ¯æ£å¸¸çï¼ckä¹å¾å¿«20msï¼æ°æ®ä¹æ¯æ£å¸¸æ¶è´¹ãçäºyarnä¸çæ¥å¿ï¼æ²¡æä»»ä½errorãèªå®ä¹çsinkéé¢ä¹è®¾ç½®äºæ¥å¿æå°ï¼ä½æ¯logé没æãè¿ç§å¦ä½å¿«éå®ä½é®é¢ã
247ãæ没æflinkå¤çå¼å¸¸æ°æ®çæ¡ä¾èµæ
248ãflinkä¸å¦ä½ä¼ éä¸ä¸ªå
¨å±åé
249ãå°4æ ¸16GçFlink taskmanageré
ä¸ä¸ªåç¬çYarnéè¦ä¸å°å¥æ ·çæå¡å¨ï¼å
¶ä»åè½é½ä¸éè¦å°±ä¸ä¸ªè°åº¦çä¸è¥¿ï¼
250ãside-output çå享
251ãä½¿ç¨ InfluxDB + Grafana çæ§flinkè½å¦é
ç½®åè¦ãæ¯ä¸æ¯prometheusæ´å¼ºå¤§ç¹ï¼
252ãæ们线ä¸éå°ä¸ä¸ªé®é¢ï¼å¸¦ç¶æçç®å没ææå® uidï¼ç°å¨ä»£ç å¿
é¡»æ¹ï¼é£ä¸ªå¸¦ç¶æçç®å ä¸è½æ£å¸¸æ¢å¤äºï¼æ解åï¼éè¿æç§æ¹å¼è½è·åå°ç³»ç»ä¹åèªå¨çæçuidåï¼
253ãtableEnv.registerDataStream("Orders", ds, "user, product, amount, proctime.proctime, rowtime.rowtime");请é®åè¿æ ·ææµæ³¨åæ表çæ¶åï¼è¿ä¸¤ä¸ªrowtimeåå«æ¯ä»ä¹ææ
254ãææ³é®ä¸ä¸ flink on yarn session 模å¼ä¸æ交任å¡å®ç½ç»çä¾åæ¯ flink run -c xxx.MainClass job.jar è¿éæ¯æä¹ç¥é yarn ä¸çåªä¸ªæ¯ flink ç appid å¢ï¼
255ãFlink Netty Connector è¿ä¸ªæ详ç»ç使ç¨ä¾åï¼ éè¿Netty建ç«çsourceè½ç´æ¥åå¤æ¶æ¯åï¼è¿æ¯åªè½è¢«å¨æ¥åæ¶æ¯ï¼
256ã请é®flink sqlclient æ交çä½ä¸å¯ä»¥ç¨äºç产ç¯å¢åï¼
257ãflinkæ¹å¤çååmysqlæ¯å¦æ²¡æ³ç¨tableEnv.sqlUpdate("insert into t2 select * from t1")ï¼ä½ä¸ºsink表çt2è¦å¦ä½æ³¨åï¼æ¥è·jdbcç¸å
³ç就两个TableSinkï¼JDBCAppendTableSinkç¨äºBatchTableSinkï¼JDBCUpertTablSinkç¨äºStreamTableSinkãåè
åªæ¥åinsert into valuesè¯æ³ãæ以ææ¯å
éè¿select fromæ¥è¯¢è·åå°DataSetåJDBCAppendTableSink.emitDataSet(ds)å®ç°çï¼ä½è¿æ ·è¾¾ä¸å°sql rule anyç®æ
258ã请é®å¨stream模å¼ä¸ï¼flinkç计ç®ç»æå¨ä¸è½åºçæ
åµä¸ï¼å¯ä»¥éè¿ä»ä¹restful apiè·å计ç®ç»æå
259ãç°å¨ææåºæ¯ï¼éè¦æä¸å®çæ¶æ¯åéç»kafka topicæå®çpartitionï¼è¯¥æä¹æï¼
260ã请é®æçjobä½ä¸å¨ideaä¸è¿è¡æ£å¸¸ æ交å°ç产é群éæ示Caused by: java.lang.NoSuchMethodError: org.apache.flink.api.java.ClosureCleaner.clean(Ljava/lang/Object;Z)V请é®å¦ä½è§£å³
261ãéå°ä¸ä¸ªå¾å¥æªçé®é¢ï¼å¨ä½¿ç¨streamingSQLæ¶ï¼åç°timestampå¨datastreamçæ¶åè¿æ¯æ£å¸¸çï¼å¨æ³¨åæ表printåºæ¥çæ¶åå°±å°äºå
«å°æ¶ï¼å¤§ä½¬ç¥éæ¯ä»ä¹åå ä¹ï¼
262ã请é®å°flinkç产ççä¸äºè®°å½æ¥å¿å¼æ¥å°kafkaä¸ï¼éè¦å¦ä½é
ç½®ï¼é
ç½®åå¿
é¡»è¦éå¯é群æä¼çæå
263ãæä¸»ä½ å¥½ï¼é®ä¸flink1.9对维表joinçæ¯ææä¹æ ·äºï¼æææ¡£å
264ã请é®ä¸ flink slqï¼ SELECT city_name as city_name, count(1) as total, max(create_time) as create_time FROM * ã代ç éé¢è®¾ç½®çªå£ä¸ºï¼ retractStream.timeWindowAll(Time.minutes(5))ä¸ä¸ªglobalçªå£ï¼æ°æ®åå
¥hdfs ç»ææ°æ®éå¤ ï¼åå¨ä¸¤æ¡å®å
¨éå¤çæ°æ®å¦ä¸ 常å·ã2283ã 1566230703ï¼ï¼è¯·é®è¿æ¯ä¸ºä»ä¹
265ãæç¨rocksdbåå¨checkpointï¼çº¿ä¸è¿è¡ä¸æ®µæ¶é´åå±checkpointå ç¨ç©ºé´è¶æ¥è¶å¤§ï¼ææ¯ç´æ¥åæ¬å°ç£çä¸çï¼æä¹æ ·è½è®©å®èªå¨æ¸
çå¢ï¼
266ãflinkåºè¯¥å¨åªä¸ªç¨æ·ä¸å¯å¨å¢ï¼æ¯rootçè¿æ¯å¨å
¶ä»çç¨æ·å¢
267ãlinkå¯ä»¥è¯»ålzoçæ件å
268ãæä¹å¿«éä»eséé¢ä¾¿å©æ°æ®ï¼æ们å
¬å¸ç°å¨ææçæ°æ®é½åå¨Eséé¢ç;æåç°æ¯æ¬¡ä»éé¢scanæ°æ®çæ¶åç¹å«æ
¢;ä½ é£æ没æä»ä¹å¥½çåæ³ï¼
269ãå¦ææ³è®©æ°æ®æç
§å
¶ä¸ä¸ä¸ªåå¦f0è¿è¡ååºï¼ç¶åæ¯ä¸ä¸ªååºåå¤ççæ¶å并è¡åº¦é½æ¯1æä¹è®¾ç½®å¢
270ãè¿å¨åç®åçè¿ç¨ä¸,使ç¨scalaè¯è¨åflinkæ¯è¾å¿«,èä¸å¨processç®åä¸å®ç°ontimeæ¹å¼æ¶,å¯ä»¥ä½¿ç¨scalaä¸çlistbuffæ¥è¾åºä¸ä¸ªtop3çè®°å½;é£ä¹å°äºjavaä¸,åªè½ç¨ArrayListå°flinkä¸çListState使ç¨get()æ¹æ³ååºä¹åæ¾å¨ArrayListå?
271ã请é®èå¸è½å¦åºä¸äº1.9çæ¬ç»´è¡¨joinçä¾å å
æ¬asyncå维表ç¼åï¼
272ãflink kaka source设置为ä»ç»å
æ¶è´¹ï¼æ个é®é¢æ¯ç¬¬ä¸æ¬¡å¯å¨ä»»å¡ï¼æåç°kafkaä¸çåå²æ°æ®ä¸ä¼è¢«æ¶è´¹ï¼èæ¯ä»å½åçæ°æ®å¼å§æ¶è´¹ï¼è第äºæ¬¡å¯å¨çæ¶åæä¼ä»ç»çoffsetå¼å§æ¶è´¹ï¼æä»ä¹åæ³å¯ä»¥è®©ç¬¬ä¸æ¬¡å¯å¨ä»»å¡çæ¶åå¯ä»¥æ¶è´¹kafkaä¸çåå²æ°æ®å
273ã1.使ç¨flinkå®æ¶å¤ç离线æ°æ®ï¼ææ¶é´æ³å段ï¼å¦ä½æ±åºæ¯åéçæ大å¼ï¼ç±»ä¼¼äºæµå¤ççªå£é£æ ·ï¼2å¦ææ³èªå·±å®ç°æ¹æµç»ä¸ï¼æä»ä¹å¥½çå并æ¹ååï¼æ¯å¦æ³è®©æµå¤ç使ç¨æ¹å¤ççä¸ä¸ªç®åã
274ãflinkæä¹å®ç°æµå¼æ°æ®æ¹é对å¾
ï¼æµçæ°æ®æ¯èªå®ä¹çsourceï¼è¯»åçrediså¤ä¸ªHash表ï¼éè¦æ§å¶æ¹æ¬¡çæ¦å¿µ
275ãæ人说ä¸æ¨èå¨ä¸ä¸ªtaskä¸å¼å¤ä¸ªçº¿ç¨ï¼è¿ä¸ªä½ æä¹çï¼
276ãæ³åä¸ä¸ªè¿è¡å¨hbase+esæ¶æä¸çsqlæ¥è¯¢æ¹æ¡ï¼flink sqlè½ååï¼æè
æ没æå
¶ä»ç解å³æ¹æ¡æè
æè·¯ï¼
277ãæ£å¨ç´§æ¥å第ä¸ä¸ªç¨å°Flinkç项ç®ï¼å¨è¯¢ä¸ä¸ï¼Flink 1.8.1åå
¥ES7å°±æ¯ç¨èªå¸¦çSinkåï¼æ没æä¾åå享ä¸ä¸ï¼ææå°çé½æ¯åES6çãè¿ç§è¦æ±æç¥éä¸éåæï¼ä¸»è¦æ¯æ¥ï¼èªå·±è¯å ä¸æ²¡æåãT T
278ãæå¨åæ¢ä»»å¡åï¼å·²ç»ä¿åäºæè¿ä¸æ¬¡ä¿åç¹ï¼ä»»å¡éæ°å¯å¨åï¼å¦ä½ä½¿ç¨ä¸ä¸æ¬¡æ£æ¥ç¹ï¼
279ãæ¹å¤ç使ç¨æµç¯å¢ï¼ä¸ºäºä½¿ç¨çªå£ï¼ï¼é£å¦ä½ç¡®å®æ¹å¤çç»æï¼å°±æ¯æçä»»å¡å¯ä»¥ç¥éæ¹æ件读åå®äºï¼å¹¶ä¸å¤çå®æ°æ®åå
³éä»»å¡ï¼å¦æä¸è½ï¼é£æ¹å¤çå¦ä½å®ç°çªå£åè½
280ãå¦æéå¶åªè½å¨window å
è¿è¡å»éï¼æ°æ®éè¿æ¯è¾å¤§ï¼æä»ä¹å¥½çæ¹æ³åï¼
281ã端å°ç«¯exactly onceæ没æåºæç«
282ãæµæä¹å¨æå ï¼ï¼æµæä¹å¨æå é¤ï¼ï¼åæ°æä¹å¨æä¿®æ¹ ï¼å¹¿æ
283ãèªå®ä¹çsourceæ°æ®æºå®ç°äºææ¹æ¬¡çæ¦å¿µï¼ç¶åFlinkå°è¿ä¸ªä¸ä¸ªæ¹æ¬¡æµæ³¨å为å¤ä¸ªè¡¨joinæä½ï¼æåæ³ç¥éè¿ä¸ªsqlä»ä¹æ¶å计ç®å®æäºï¼
284ãç¼è¯ Flink æ¥éï¼ç¾¤ä¸»éå°è¿æ²¡ï¼ä»ä¹åå
285ãæç°å¨æ¯flink on yarnç¨zookeeperåHAç°å¨å¨zkéæ¥çæ£æ¥ç¹ä¿¡æ¯ï¼ä¸ºä»ä¹éé¢çæ件æ¯ipï¼èä¸æ¯è·¯å¾å¢ï¼æ该å¦ä½æ¿å°é£ä¸ªè·¯å¾ã
- æé¤rest api æ¹å¼è·åï¼å 为任å¡å
³äºrestapi就没äº
-æé¤history serverï¼æç¹ä¸å¥½ç¨
286ãå¨ä½¿ç¨streamfilesinkæ¶è´¹kafkaä¹åè¿è¡hdfsåå
¥çæ¶åï¼å½ç´æ¥å
³éflinkç¨åºçæ¶åï¼ä¸æ¬¡åå¯å¨ç¨åºæ¶è´¹åå
¥hdfsçæ¶åï¼æ件åæ¯ä»part-0-0å¼å§ï¼è¿æ ·å°±è·åæ¥åå
¥çå²çªäºï¼è¯¥æ件就ä¸ç´å¤äºingressç¶æã
287ãç°å¨æä¸ä¸ªå®æ¶æ°æ®åæçéæ±ï¼æ°æ®éä¸å¤§ï¼ä½è¦æ±sinkå°mysqlï¼å 为æ¯å®æ¶æ´æ°çï¼æç°å¨è½æ³å°çå¤çæ¹æ³å°±æ¯æ¯æ¬¡æå
¥ä¸æ¡æ°æ®çæ¶åï¼å
ä»mysql读æ°æ®ï¼å¦ææè¿æ¡ï¼å°±æ§è¡updateï¼æ²¡æçè¯å°±insertï¼ä½æ¯è¿æ ·çè¯æ¯åä¸æ¡æ°æ®å°±æ两次交äºäºãæ³é®ä¸ä¸èå¸æ没ææ´å¥½çåæ³ï¼æè
flinkæ没æå
ç½®çapiå¯ä»¥æ§è¡è¿ç§ä¸ç¡®å®æ¯æ´æ°è¿æ¯æå
¥çæä½
288ãFlink设置äºcheckpointï¼job manageä¼å®æå é¤check pointæ°æ®ï¼ä½æ¯task manageä¸å é¤ï¼è¿ä¸ªæ¯ä»ä¹åå
289ã请æä¸ä¸ä½¿ç¨rocksdbä½ä¸ºstatebackend ï¼å¨åªéå¯ä»¥çæ§rocksdb io å
åææ å¢
290ãç¶æç使ç¨åºæ¯ï¼ä»¥åç¨æ³è½åºä¸ªæç« ä¸ï¼è¿åä¸å¤ªäºè§£
291ã请é®ä¸ä¸ Flink 1.9 SQL APIä¸distinct count æ¯å¦ä½å®ç°é«æçæµå¼å»éçï¼
292ãå¨ç®åå
å¦ä½è·åå½åç®å并è¡åº¦ä»¥åå½åæ¯ç¬¬å 个task
293ãæ没æflink1.9ç»åhiveçdemoãkafkaå°hive
294ãè½ç»è®²è®²apache calciteå
295ã请é®ä¸ä¸åè¿ç§çªå£æä½ï¼æä¹ä¿è¯ç¨åºå¼å¸¸éå¯åä¿ææ°æ®çç¶æå¢ï¼
296ã请é®ä¸ä¸ï¼æå¨ä½¿ç¨kafkasourceçæ¶åï¼ææ¥è¿æ¥çJsonstr转åæèªå®ä¹çä¸ä¸ªç±»åï¼ç¨çæ¯gson. fromJsonï¼jsonstr,classOf[Entity]ï¼æ¥å¾çä¸çé误äºï¼ä¸ç¥éæä¹è§£å³ï¼å¨ä¸è½¬ç´æ¥æå°çæ
åµä¸æ¯æ²¡é®é¢ç
297ãDataStream读æ°æ®åºç表ï¼åå¤è¡¨joinï¼è½è®¾ç½®æ¶é´çªå£ä¹ï¼ä¸å¤©å»å·ä¸æ¬¡ãæµç¨åºä¼ä¸ç´ææ°æ®ï¼æ°æ®åºæä¸ä½äº
298ã请é®ä¸ä¸flinkæ¯æå¤è·¯å¾éé
读ååï¼ä¾å¦è·¯å¾ï¼s3n://pekdc2-deeplink-01/Kinesis/firehose/2019/07/03// ï¼éé
读åæ¾ä¸å°è·¯å¾ãæ¯å¦éè¦ç¹æ®è®¾ç½®
299ãflink yarnç¯å¢é¨ç½² ä½æ¯æ容å¨çurlå°åå é¤ãå°±ä¼è·³è½¬å°çhadoopçé¦é¡µãæä¹å±è½hadoopçyarné¦é¡µå°åå¢ï¼è¦ä¸æ´é²è¿ä¸ªå°åç¨æ·è½çå°ææä»»å¡å¾å±é©
300ãflink sqlæä¹åä¸ä¸ªæµï¼æ¯ç§è¾åºå½åæ¶é´å¢
301ãå 为æ³éè¿sqlå¼ä¸ä¸ªæ°æ®æµãåå å¦å¤æ³é®ä¸ä¸ªé®é¢ï¼ææå
¨å±è®¾ç½®ä¸ºæ ¹æ®å¤çæ¶é´çæ¶é´çªå£ï¼é£ä¹æå¨processAllWindowFunctionéé¢è¦æä¹ç¥éè¿æ¥çæ¯ä¸ªå
ç´ çå¤çæ¶é´æ¯å¤å°å¢ï¼è¿ä¸ªå
ç´ è¿å
¥è¿ä¸ªæ¶é´çªå£çä¾æ®æ¯ä»ä¹
302ãå¦ä½å®ç°ä¸ä¸ªè®¾å¤ä¸æ¥çæ°æ®åå¨å°åä¸ä¸ªhdfsæ件ä¸ï¼
303ãæèªå·±åçkafkaç产è
æµè¯ï¼æ°æ®æ ¼å¼ååç®åï¼key,iï¼keyæ¯ä¸ä¸ªåºå®çä¸åçå符串ï¼iæ¯èªå¢çï¼flink consumerè¿è¾¹æå¼äºcheckpoint. 并ä¸æ¯exactly onceï¼ç¶åç¨åºå¾ç®åï¼å°±æ¯flink读åkafkaçæ°æ®ç¶åç´æ¥æå°åºæ¥ï¼æåç°æ¯å¦æçå°æå°å°keyï¼10çæ¶åæç´æ¥å
³æç¨åºï¼ç¶åéæ°å¯å¨ç¨åºï¼æçæ¥è¯´åºå½æ¯ä»ä¸æ¬¡çoffset继ç»æ¶è´¹ï¼ä¹å°±æ¯key,11ï¼ä½å®é
ä¸æçå°çå¯è½æ¯ä»keyï¼9å¼å§ï¼ç¶åä¾æ¬¡éå¢ï¼è¿æ¯æ¯ä¸æ¯è¯´ææ¯éå¤æ¶è´¹äºï¼é£exactly oneéè¦æä¹æ ·å»ä¿éï¼
304ãå设æä¸ä¸ªæ°æ®æºå¨æºæºä¸æç产çæ°æ®ï¼å°Flinkçååæ¥å°source端çæ¶åï¼ç±äºFlinkå¤çæ°æ®çé度è·ä¸ä¸æ°æ®æºäº§çæ°æ®çé度ï¼
é®é¢1: è¿ä¸ªæ¶åå¨Flinkçsource端ä¼æä¹å¤çå¢ï¼æ¯å°å¤çä¸å®çæ°æ®ä¸¢å¼è¿æ¯è¿è¡ç¼åå¢ï¼
é®é¢2: å¦ææ¯ç¼åï¼æä¹è¿è¡ç¼åå¢ï¼
305ãä¸ä¸ªstream å¨sinkå¤ä¸ªæ¶ï¼è¿å¤ä¸ªsinkæ¯ä¸²è¡ è¿æ¯å¹¶è¡çã
306ãææ³å¨æµä¸åä¸ä¸ªçªå£ï¼è§¦åçªå£çæ¡ä»¶æ¯åºå®çæ¶é´é´éæè
æ°æ®éè¾¾å°é¢åå¼ï¼ä¸¤ä¸ªæ¡ä»¶åªè¦æä¸ä¸ªæ»¡è¶³å°±è§¦åï¼é¤äºéåtriggerå¨ï¼è¿æä»ä¹å«çæ¹æ³åï¼
307ã使ç¨rocksdbä½ä¸ºç¶æå端ï¼å¯¹äºä½¿ç¨sqlæ¹å¼å¯¹æ¶é´å段è¿è¡group byï¼ä»¥è¾¾å°å»çªå£åï¼ä½æ¯è¿æ ·æ²¡åæ³å¯¹ä¹åçæ°æ®æ¸
çï¼å¯¼è´ç£ç空é´å¾å¤§ï¼å¯¹äºè¿ç§éç¼ç æ¹å¼ï¼æä»ä¹åæ³è®¾ç½®ttlï¼æ¸
ç以åçæ°æ®å
308ã请é®ä»ä¹æ¶é´çªä¸ºä»ä¹ä¼æTimeWindow{start=362160000, end=362220000}
å TimeWindow{start=1568025300000, end=1568025360000}è¿ä¸¤ç§å½¢å¼ï¼æé½ç¨çæ¯ä¸åéçTumblingEventTimeWindowsï¼ä¸ºä»ä¹ä¼åºç°ä¸åçæ
åµï¼
309ãæ¯å¦æç»è®¡ä¸å¤©ç订åéãä½æ¯æ个æ°æ®å»¶è¿ä¸å¤©æå°è¾¾ãæ¯å¦2019.08.01è¿ä¸å¤©è®¢åéåºè¯¥æ¯1000ï¼ä½æ¯æ个100çåæ®è¿å°äºï¼å¨2019.08.02æå°è¾¾ï¼é£ä¹å¯¼è´2019.08.01è¿ä¸å¤©ç»è®¡çæ¯900.åé¢æä¹çº æ£è¿ä¸ªé误çç»æå¢
310ãflink streaming 模å¼ä¸åªä½¿ç¨å å
å
åä¹
311ãå¦æèèå°é群çè¿ç§»ï¼ç¶æè½è¿ç§»å
312ãæ们ç°å¨æä¸ä¸ªä¸å¡åºæ¯ï¼æ°æ®ä¸æ¥çå¼æ¯è¿æ ·çæ ¼å¼ï¼æ¶é´ï¼ç´¯å å¼ï¼ï¼æ们éè¦è¿æ ·çæ ¼å¼æ°æ®ï¼æ¶é´ï¼å½åå¼ï¼ãå½åå¼=ç´¯å å¼-åä¸ä¸ªæ°æ®çç´¯å å¼ãflinkå¦ä½åå°å¢ï¼æèèè¿stateæºå¶ï¼ä½æ¯æå¡å®æºåï¼state就被æ¸
空äº
313ãFlink On k8s ä¸ Flink on Yarnç¸æ¯çä¼ç¼ºç¹æ¯ä»ä¹ï¼é£ä¸ªæ´éåå¨ç产ç¯å¢ä¸ä½¿ç¨å¢
314ãæ没ædatahubé¾æ¥flinkç è¿æ¥å¨å
315ãåç¹resourcemanager æäºï¼å¯¹ä»»å¡ä¼äº§çä»ä¹å½±åå¢
316ãflinkçæ§binlog,è·å¦ä¸å¼ 维表åjoinåï¼sinkå°MySQLçæç»è¡¨ã对äºæç»è¡¨çå¢å æ¹æä½ï¼éè¦å®ä¹ä¸åçsinkä¹ï¼
317ã请é®çªå£æ¯å¨ä»ä¹æ¶åå并çå¢ï¼ä¾å¦ï¼æ°æ®è¿å
¥windowoperatorçprocessElementï¼å¦æä¸æ¯sessionwindowï¼æ¯å¦ä¼è¿è¡çªå£å并å¢ï¼
318ãFlinkä¸ä¸æ¡æµè½åä¸å¤è·¯è®¡ç®ï¼å¹¶å¤å¤è¾åºåï¼ä»ä»¬ä¹åä¼ä¸ä¼ç¸äºå½±åï¼
319ãkeyByç®åå®ä¹æ¯å°ä¸ä¸ªæµæåæä¸ç¸äº¤çååºï¼æ¯ä¸ªååºå
å«å
·æç¸åçkeyçå
ç´ ãæä¸æç½çå°æ¹æ¯: keyByæä¹è®¾ç½®ååºæ°ï¼æ¯ç»è¿ä¸ªç®å设置并è¡åº¦åï¼ ååºæ°åslotæ°éæ¯ä»ä¹å
³ç³»ï¼
320ãå¨æcep-patternï¼è½å¦è¯¦ç»è¯´ä¸ï¼æ»´æ»´æ¹æ¡æªå
¬å¸ï¼æ¨è´´åºæ¥çå å¼ å¾çæ¯åºäº1.7çãæè
æä»ä¹æ³æ³ä¹å¯ä»¥è®²è§£ä¸ï¼è°¢è°¢äº
321ãé®é¢1ï¼ä½¿ç¨å¸¸é©»åsession ./bin/yarn-session.sh -n 10 -s 3 -då¯å¨ï¼è¿ä¸ªæ¶ååé
çèµæºæ¯yarn éåéé¢ç, flinkæäº¤ä»»å¡ flink run xx.jar, å
¶ä½æºå¨æ¯ææ ·è·åå°flinkéè¦è¿è¡æ¶çç¯å¢çï¼å 为æåªå¨é群çä¸å°æºå¨ä¸æflink å®è£
å
ã
322ãflink task managerä¸sloté´çå
åé离ï¼cpué离æ¯æä¹å®ç°çï¼flink 设计slotçæ¦å¿µæä»ä¹æä¹ï¼ä¸ºä»ä¹ä¸åspark executoré£æ ·ï¼å
é¨æ²¡æåé离ï¼
323ãsparkåkafkaéæï¼direct模å¼ï¼sparkçä¸ä¸ªååºå¯¹åºkafkaçä¸ä¸ªä¸»é¢çä¸ä¸ªååºãé£flinkåkafkaéæçæ¶åï¼æä¹æ¶è´¹kafkaçæ°æ®ï¼å设kafkaæ个主é¢5个partition
324ã./bin/flink run -m yarn-cluster æ§è¡çflink job ï¼ä½ä¸èªå·±æå°çæ¥å¿éè¿yarn applicationçlogæ¥çä¸äºï¼åªæé群èªèº«çæ¥å¿ï¼ç¨åºä¸logger.infoæå°æ¥å¿åæ¾å¨åªï¼è¿æ¯ææå
çæ¹å¼é®é¢ï¼ææ¥å¿ç¨çæ¯slf4jã
325ãå¨ç©èç½å¹³å°ä¸ï¼éè¦å¯¹æ¯ä¸ªkeyä¸çæ°æ®åè¶éå¤æï¼ç±äºæ¯ä¸ªkeyçè¶éå¼æ¯ä¸åçï¼è¶éå¼é
ç½®å¨å®æ¶æ°æ®åºä¸ã
è¥å°è¶éå¼å è½½å°stateä¸ï¼ç±äºkeyçéå¾å¤§ï¼å¤§æ¦3亿左å³ï¼ï¼ä¼å¯¼è´state太大ï¼å¯è½é æå
å溢åºãè¥å¨å¤çæ°æ®æ¶ä»å®æ¶æ°æ®åºä¸è¯»åè¶éå¼ï¼ç±äºç½ç»IOå¼éï¼å¯è½é æå®æ¶æ§ä¸éã请é®è¯¥å¦ä½å¤çï¼è°¢è°¢
326ãå¦ææä¸ä¸ªflinkç¨åºæå¤ä¸ªwindowæä½ï¼æ¶é´æ³åwatermarkæ¯ä¸æ¯æ¯ä¸ªwindowé½éè¦åé
ï¼è¿æå°±æ¯äºä»¶æ¶é´æ¯ä¸æ¯ä¸å®è¦å¨æ°æ®æºä¸å°±åå¨æ个å段
327ãæ没æflink1.9åæ¯æçç¨ddlé¾æ¥kafka并åå
¥hbaseçèµæï¼æ们å
¬å¸æ³æ离线çæ°ä»éæ¸è½¬æå®æ¶çï¼åsql对äºæ们æ¥è¯´ä¸ææ´å¿«ä¸äºï¼å°±æ³æ¾ä¸äºè¿æ¹é¢çèµæå¦ä¹ ä¸ä¸ã
328ãflink1.9 è¿è¡äºæ°æ®ç±»åç转åæ¶åçäºä¸å¹é
çé®é¢ï¼ ç®å使ç¨çType被å¼ç¨ï¼æ¨è使ç¨æ¯datatypes ç±»åï¼ä½æ¯ä¹å使ç¨çTypeç±»åçæ¹æ³ 对åºçschema typeinformation ç®åè·datatypesçè¿åå¼ä¸å¯¹åºï¼è¯·é®ä¸ 该æä¹å»è°æ´éé
ï¼
329ãlinkä¸å¤çæ°æ®å
¶ä¸ä¸æ¡åºäºå¼å¸¸é½ä¼å¯¼è´æ´ä¸ªjobææ?æ没ææ¹æ³(é¤äºå¼å¸¸æè·)让è¿æ¡æ°æ®è®°å½é误æ¥å¿å°±è¡ ä¸é¢çæ°æ®æ¥çå¤çå¢? ç²ç¥çè¿ä¸äºå®¹éå¤çï¼æ¯å
³äºç¨åº¦æäºéå¯åä»æ£æ¥ç¹æåæ°æ®ï¼ä½æ¯å¦æè¿æ¡æ°æ®æ¬èº«å°±é®æ(ç¹å«ç产ä¸ï¼è¿æ ·å°±å¯¼è´jobç´æ¥æäºï¼å½±åæç¹å¤§)ï¼é£åºè¯¥æä¹è¿æ»¤æè¿æ¡é®é¢æ°æ®å¢(å¼å¸¸æè·æ¯æåçæ¹æ³
330ãæå¨ä¸ä¸ªåæ¥æ¥çç»è®¡ä¸ä½¿ç¨rabbitmqåæ°æ®æºï¼ä¸ºä»ä¹rabbitmqä¸çæ°æ®ä¸ç´å¤äºunackedç¶æï¼æ¯åé触åä¸æ¬¡çªå£è®¡ç®ï¼å¹¶é©±é计ç®è¿çå
ç´ ï¼æå¨æµè¯ç¯å¢æ°æ®é½è½ack,ä½æ¯ä¸å°ç产ç¯å¢å°±ä¸è¡äºï¼ä¹æ²¡ææ¥éï¼æå¯è½æ¯åªéåºäºé®é¢å
331ãæ们ç®åæ°æ®æµåæ¯è¿æ ·çï¼kafka source ï¼etlï¼redis sink ãè¿æ ·chk æ¯å¦å¯ä»¥ä¿è¯ç«¯å°ç«¯è¯ä¹å¢ï¼
332ã1.å¨éè¿ yarn-session æ交 flink job çæ¶åãflink-core, flink-clients, flink-scala, flink-streaming-scala, scala-library, flink-connector-kafka-0.10 é£äºåºè¯¥å provided scopeï¼é£äºåºè¯¥å compile scopeï¼ææ¯æ£ç¡®ãé¿å
ä¾èµå²çªç姿å¿ï¼
2.flink-dist_2.11-1.8.0.jar 究ç«å
å«äºåªäºä¾èµï¼ï¼è¿ä¸ªæ件æå
æ¹å¼ä¸åäº springbootï¼æ æ³æ¸
æ¥çå°æåªäº jar ä¾èµï¼
333ãFlink ä¸ä½¿ç¨ count window ä¼æè¿æ ·çé®é¢å°±æ¯ï¼æåæé¨åæ°æ®ä¸ç´æ²¡æè¾¾å° count çå¼ï¼ç¶åçªå£å°±ä¸ç´ä¸è§¦åï¼è¿éçå°ä¸ªæè·¯ï¼å¯ä»¥å° time window + count window ç»åèµ·æ¥
334ãflinkæµå¤çæ¶ï¼æ³¨åä¸ä¸ªæµæ°æ®ä¸ºTableåï¼è¯¥æµçåå²æ°æ®ä¹ä¼ä¸ç´å¨Tableéé¢ä¹ï¼ä¸ºä»ä¹æ¯æ¬¡æ¥æ°æ°æ®ï¼åå²å¤çè¿å¾æ°æ®ä¼éæ°è¢«æ§è¡ï¼
335ãavailableæ¯ååæ°æ®ï¼é¤äºææ°çæ°æ®è¢«æå
¥æ°æ®åºï¼ä¹åå¤çè¿æ°æ®åéæ°æ§è¡äºå 次
336ãè¿é两天å¨ç 究flinkç广æåéï¼åç°ä¸ä¸ªé®é¢ï¼DataSetæ°æ®éä¸è·å广æåéï¼è·åçå
åå°åæ¯ä¸æ ·çï¼ä¸å°æºå¨ç»´æ¤ä¸ä¸ªå¹¿ææ°æ®éï¼ãå¨DataStreamä¸è·å广æåéå°±æäºä¸ä¸ªtaskç»´æ¤ä¸ä¸ªæ°æ®éãï¼å¯è½æ¯æ使ç¨æ¹å¼æé®é¢ï¼ æ以æ³è¯·æä¸æ主ï¼DataStreamä¸è·åä¸ä¸ªç»é¢åéå¯ä»¥å¦DataSetä¸ä¸å°æºå¨ç»´æ¤ä¸ä¸ªæ°æ®åï¼
337ãFlinkç¨åºå¼å¯checkpoint æºå¶åï¼ç¨yarnå½ä»¤å¤æ¬¡killed以åï¼ckeckpointç®å½ä¸æå¤ä¸ªjob idï¼å次å¼è¾èµæºéæ°å¯å¨ç¨åºï¼ç¨åºå¦ä½æ¾å°ä¸ä¸æ¬¡jobidç®å½ä¸ï¼èä¸æ¯æ¾å°å
¶ä»çjobidç®å½ä¸ï¼é»è®¤æ¯æåä¸ä¸ªè¿æ¯éè¦å¶å®ç¹å®çjobidï¼
338ãåå±æ¨å¤©çæ°æ®éå¤æå
¥é®é¢ï¼æ¯ækafkaéè¿æ¥çæ°æ®æµregisterDataStream注å为Tableåjoinæ¶ï¼æå°è¡¨çé¿åº¦åç°ï¼æ°æ®ä¼ä¸ç´å¾è¡¨é追å ï¼ææ ·æè½æ¥ä¸æ¡å¤çä¸æ¡ï¼ä¸å¾ä¸è¿½å å
339ãflink1.9 sql æ没æ类似ååºè¡¨é£æ ·çå¤çæ¹å¼å¢ï¼æ们ç°å¨æä¸ä¸ªä¸å¡æ¯1个sourceï¼ä½æ¯è¦åå«è®¡ç®5åéï¼10åéï¼15åéçæ°æ®ã
340ãæåå¼äºä¸ªæå¡å¨ï¼å¨å¯å¨åºç¡çå½ä»¤æ¶ååç°task没æå¯å¨èµ·æ¥ï¼å¯¼è´web页æ¯ä¸ä¸ª0ï¼æçäºlogä¹æ²¡ææ¥éä¿¡æ¯ï¼è¯·é®æ¨ç¥éå¯è½æ¯ä»ä¹é®é¢åï¼
241ãæèªå®ä¹äºä¸ª Sink extends RichSinkFunctionï¼æäº fieldï¼ private transient Object lock;
è¿ä¸ª lock æç´æ¥åå§å private transient Object lock = new Object(); å°±ä¸è¡ï¼å¨ invoke é 使ç¨lockæ¶ç©ºæéï¼å¦ælockå¨ èªå®ä¹ Sink ç æé å¨åå§åä¹ä¸è¡ãä½æ¯å¨ open æ¹æ³éåå§åå°±å¯ä»¥ï¼ä¸ºä»ä¹ï¼è½è§£éä¸ä¸ æ§è¡åçåï¼å¦æä¸ä¸ªslot è¿è¡ç5个 sinkå®ä¾ï¼é£ä¹ è¿ä¸ªsink对象ä¼new 5个è¿æ¯1个ï¼
342ã请é®Kafkaçbroker 个æ°æä¹ä¼°ç®ï¼
343ãflink on yarnå¦ä½è¿ç¨è°è¯
344ãç®åæ个éæ±ï¼å°±æ¯æºæ°æ®æ¯dataAãdataBãDataCéè¿kafkaä¸ä¸ªtopicè·åï¼ç¶åè¿è¡å并ã
ä½æ¯ææå 个é®é¢ï¼ç®åä¸ç¥éæä¹è§£å³ï¼
dataA="id:10001,info:,date:2019-08-01 12:23:33,entry1:1,entryInfo1:"
dataB="id:10001,org:,entry:1" dataC="id:10001,location:"
(1) å¦ä½å°ä¸ä¸ªæµåå¹¶ï¼ (1) æ°æ®ä¸dataAæ¯ææ¶é´çï¼ä½æ¯dataBådataCä¸é½æ²¡ææ¶é´æ³ï¼é£ä¹å¦ä½è§£å³eventTimeåè¿å°ä¹±åºçé®é¢ï¼å¸®å¿çä¸ï¼è°¢è°¢
345ãæflinkä»kafka读jsonæ°æ®ï¼å¨ååºåååä¸æé¨ååæäºä¸ä¸²é®å·ï¼è¯·é®å¦ä½åæè½ä½¿ä¸ææ£å¸¸
346ãææ好å 个Flinkç¨åºï¼ç¬ç«jarï¼ï¼å¨çº¿ä¸å¡æ°æ®åææ¶é½ä¼ç¨å°åæ ·çä¸æ¹MySQLä¸çé
ç½®æ°æ®(5åå¤æ¡)ï¼ç°å¨çå®ç°æ¹æ³æ¯æ¯ä¸ä¸ªç¨åºé½æ¯ç¬ç«æè¿äºé
ç½®æ°æ®è£
å°å
åä¸ï¼ä¾¿äºå¿«é使ç¨ï¼ä½ç°å¨æè§æäºæµªè´¹èµæºåç»æä¸å¤ç¾è§ï¼è¯·é®è¿ç±»æ
åµæä»ä¹å
¶ä»ç解å³æ¹æ¡åï¼è°¢è°¢
347ãFlink checkpoint é RocksDBStateBackend è¿æ¯ FsStatebackEnd ï¼æ们ç®åæ¯ä»»å¡æ§è¡ä¸æ®µæ¶é´ä¹å ä»»å¡å°±ä¼è¢«å¡æ»ã
348ãflink on k8sçé«å¯ç¨ãæ©ç¼©å®¹è¿åç®åè¿æåªäºé®é¢ï¼
349ãæ个é®é¢é®ä¸ä¸ï¼æ¯è¿æ ·çç°å¨Kafka4个ååºæ¯ç§éç产4000å¤å°5000æ¡æ¥å¿æ°æ®ï¼ä½æ¯å¨æ¶è´¹è
FLINKè¿è¾¹æ¥æ¶æåªå¼äº4个soltæ¥æ¶ï¼è¿è¾¹åªæ¯æ¥æ¶åååååå¨ï¼ç°å¨åºç°äºå»¶è¿ç°è±¡ï¼æä¸æ¸
æ¥æ¯æè¿è¾¹å¤ååæ
¢äºè¿æ¯Flinkæ¥æ¶kafkaçæ°æ®æ
¢äºï¼Flink UIçé¢æ¾ç¤ºè¿ä¸¤ä¸ªèåé«
350ãæ³è¯·é®ä¸ä¸ï¼å¨flinké群模å¼ä¸ï¼è½ä¸è½æå®æ个èç¹æ¥æ§è¡ä¸ä¸ªtask?
-
请é®ä¸ä¸aggrefunction çmergeæ¹æ³ä»ä¹æ¶åä¼ç¨å°å¢ï¼googleä¸æçæ¡è¯´å并ç¸åçkeyï¼ ä½ç¸åçkeyåºè¯¥æ¯è¢«hashç¸åçtaskä¸äº?è¿åä¸æ¯å¾ç解
-
请é®flinkéå°è¿ç§é®é¢æä¹è§£å³ï¼1. eventAåèµ·äºä»¶ï¼eventBååºäºä»¶ï¼æ¯åéç»è®¡äºä»¶çååºçæåçã说æï¼eventAåeventBæç¸åçcommitIdå
³èï¼eventAå°flinkçæ¶é´æ©äºeventBçæ¶é´ï¼ä½eventBå°è¾¾çæ¶é´ä¹æå¯è½æ©äºeventAãè¦æ±æ¯ï¼eventAæA,B,C,D,Eäºæ¡æ°æ®ï¼å¦æeventBæA',B',C',X',Y'äºæ¡æ°æ®ï¼æåçæ¯3/5.2. æ¯åéç»è®¡ä¸æ¬¡eventCæåç(ç¶æ0ã1)ãä½è¯¥äºä»¶æ¥å¿ä¼éå¤æ¥ï¼åªç»è®¡eventTimeææ©çä¸æ¡ãä¸ä¸åéç»è®¡å°è¿çï¼ä¸ä¸åéä¸åç»è®¡
-
Flinkå½åçæ¬ä¸Yarn,k8s,standaloneçHA设计æ¹æ¡ä¸æºç 解æ请é®å¯ä»¥ç³»ç»æ§è®²è®²ä¹
-
æä¹ç¨javaAPIæ交job以yarn-cluster模å¼è¿è¡
-
æ人éå°è¿æµæåçé®é¢ä¹ï¼ä¸ç¥éæä¹çæ解å³ï¼
-
ä»è¿ä¸ªæ¥å¿è½çåºä»ä¹å¼å¸¸çåå åï¼ææ¥çäºkafkaï¼yarnï¼zookeeperãè¿ä¸ä¸ªç»ä»¶é½æ²¡æä»»ä½å¼å¸¸
-
为å¥flinkå
é¨ç»´æ¤ä¸¤å¥éä¿¡æ¡æ¶ï¼clientä¸jobmanageråjobmanagerä¸taskmanageræ¯akkaéä¿¡ï¼ç¶ètakmanagerä¹é´æ¯nettyéä¿¡ï¼
-
é®åä½çåä¸ä¸ªå°é®é¢ï¼flink ç wordcount ï¼è¾åºå¨æ§å¶å°çæ¶åï¼åé¢æ个æ°å > æ¯ä»ä¹ææ
-
ä»kafkaçtopicA读æ°æ®ï¼è½¬æ¢ååå
¥topicBï¼å¼å¯äºcheckpointï¼ä»»å¡å¯å¨åæ£å¸¸è¿è¡ï¼æ°çtopicä¹ææ°æ®åå
¥ï¼ä½æ¯æ³çæ§ä¸ä¸æ¶è´¹topicAæ没æ延è¿ï¼ä½¿ç¨kafka客æ·ç«¯æä¾çèæ¬æ¥çgroupidç¸å
³ä¿¡æ¯ï¼æ示没æ该groupid
-
å°flinkåæµä¹åï¼åè¿è¡çªå£è®¡ç®ï¼å¦ä½å°å¤ä¸ªçªå£è®¡ç®çç»ææ±æ»èµ·æ¥ ä½ä¸ºä¸ä¸ªsinkï¼å®æ¶è¾åº?
ææ³å°å¤ä¸ªæµè®¡ç®çä¸åå®æ¶ç»è®¡ææ ï¼æ¯å¦æ¯1min对å¤ä¸ªææ è¿è¡ç»è®¡ï¼å¤ä¸ªææ åå¸å¨ä¸åçæµéé¢ï¼ï¼ç¶åå°å¤ä¸ªææ ä½ä¸ºä¸æ¡å
ç»åå
¥mysqlä¸?
-
Flinkæç»å¦ä½è¾åºå°æ°æ®å¤§å±ä¸å»ã
-
为ä»ä¹ækeyby ä¹åï¼ä¸åkeyçæ°æ®ä¼è¿å
¥åä¸ä¸ªAggregateFunctionä¸åï¼ è¿æ¯è¯´ä¸åkeyç¨çAggregateFunctionå®åæ¯åä¸ä¸ªå¢ï¼æå¨AggregateFunctionä¸ç»ä¸ä¸ªå¯¹è±¡èµå¼ä¹åï¼åç°å
¶ä»keyçæ°æ®ä¼æä¹åçæ°æ®è¦çï¼è¿æ¯æä¹åäºåï¼
-
flinkçªå£è®¡ç®çç»ææä¹åä¹åçç»æèåå¨ä¸èµ·
-
flink on yarn çä»»å¡è¯¥å¦ä½çæ§å¢ï¼ä¹åèªå¸¦ influxdb metrics 好åæ æ³ééå°flink on yarn çææ
-
link1.9.0æ¶è´¹kafka0.10.1.1æ°æ®æ¶ï¼éè¿uiçæ§æ¥çåç°é¨åååºçcurrent offsetåcommit offsetä¸ç´æ¾ç¤ºä¸ºè´æ°ï¼éçç¨åºè¿è¡ä¹å§ç»ä¸åï¼éº»ç¦é®ä¸è¿æ¯æä¹åäºï¼
-
flink 1.9 使ç¨rankçæ¶åæ¥ï¼org.apache.flink.table.api.TableException: RANK() on streaming table is not supported currently
-
Flinkä»»å¡è½ä¸è½å¨æçåæ´sourceæºkafkaçtopicï¼ä½æ¯åä¸ç¨éå¯ä»»å¡
-
1ãkeyed state åopeater state åºåç¹æ¯å¥ï¼æ¯å¦è¿è¡äºshuffleæµç¨ï¼ï¼
2ãCheckpointedFunction è¿ä¸ªæ¥å£çä½ç¨æ¯å¥ï¼
3ãä½æ¶è°ç¨è¿ä¸ªsnapshotStateè¿ä¸ªæ¹æ³ï¼
-
请æä¸ä¸åä½å¤§ä½¬ï¼æ¥å¿ä¸è¬é½æä¹æ¶éï¼task managerè²ä¼¼æä¸åjobçæ¥å¿é½æå°å¨ä¸èµ·ï¼ææ¨æåå¼æå°çåæ³ï¼
-
æè¿æ¥å°ä¸ä¸ªéæ±ï¼ç»è®¡ä»å¤©ç´¯è®¡å¨çº¿äººæ°å¹¶ä¸è¦å»éï¼æ¯5ç§æ¾ç¤ºä¸æ¬¡ç»æï¼è¯·é®å¦ä½åè¿ä¸ªéæ±ï¼
-
ç®åæ¯flinkæ¶è´¹kafkaçä¸ä¸ªé®é¢ãkafka使ç¨çæ¯é¿éäºçkafkaï¼å¯ä»¥ç³è¯·consumerãç®åå¨åä¸ä¸ªA-testçtopicä¸ï¼ä½¿ç¨A1çconsumerç»è¿è¡æ¶è´¹ï¼ä½æ¯å¨ä¸¤ä¸ªç¨åºéï¼source端å¾å°çæ°æ®éå·®å«å¾å¤§ï¼å¾ä¸æ¯ç®åæ¶è´¹kafkaåå
¥å°å¦ä¸ä¸ªkafkaçtopicä¸ï¼ç®åå·²ç¥åªæ100æ¡ï¼å¾äºæ¯æ¶è´¹kafkaï¼åå
¥å°hdfsä¸ã两次æ¶è´¹èµ·å§å移éä¸è´ï¼æ¶è´¹åï¼æ¢å¤å移éå°æååæ¶è´¹ï¼æç
§æ¶é´ä»¥å设置ä»å¤´å¼å§æ¶è´¹ççç¥ä¹é½è¿æ¯åªæ100æ¡ï¼åé¢æækafkaçoffsetæ交å°checkpointé项å
³æäºï¼ä¹è¿æ¯åªæ100æ¡ãå¾å¥æªï¼æ以æ³é®ä¸ä¸ï¼ç®åè¿ä¸ªé®é¢æ¯è¦ä»stateæ¥åºå解å³
-
é®ä¸ä¸ grafanaçdashboard æ没ææ¨èçï¼æ们ç°å¨ç¨æ¯prometheus pushgateway reporteræ¥æ¶émetricãä½æ¯ç®åæ¥è¯´ï¼å°åºåªäºææ æ¯è¦éç¹å
³æ³¨çè¿æ¯ä¸å¤ªæ¸
æ¥
-
on yarn 1. session 模å¼æ交æ¯ä¸æ¯æå³ç å¤ä¸ªflinkä»»å¡ä¼ç±åä¸ä¸ª jobManager 管ç 2. per-job æ¨¡å¼ ä¼å¯å¨åèªå¤ä¸ªjobManager
-
æ¨å¨flinkéé¢ä½¿ç¨è¿lettuceè¿æ¥redis clusteråï¼æè¿é使ç¨æ¶æ¥éï¼Cannot retrieve initial cluster partitions from initial URIs
-
zhishengä½ å¥½ï¼æå¨ä½¿ç¨flinkæ»å¨çªå£æ¶ï¼æ¯10åéä¼åredisåå
¥å¤§éçå
容ï¼å½±åäºçº¿ä¸æ§è½ï¼è¿ä¸ªæä»ä¹åæ³å¯ä»¥æ§å¶åredisçé度åï¼
-
flink standalone模å¼ï¼å¯å¨æå¡çå½ä»¤ä¸ºï¼flink run -c ç±»å jarå
ã对åºçSlotsæä¹è½åååå¸å¢ï¼ç®åéå°é®é¢ï¼ä¸ç´ä½¿ç¨ä¸ä¸ªæºå¨çSlotsï¼ä»»å¡å¤äºåç´æ¥ä¼ætaskjobææãæ¥éä¿¡æ¯å¦äºå¾
-
zhishengä½ å¥½ï¼åstandaloneä¸yarné群ï¼å
¶masterä¸workersç¸äºéä¿¡é½ä¾èµäºsshåè®®ï¼è¯·é®æåªç§ä¸ä¾èµäºsshåè®®çæ建æ¹å¼åï¼
-
å®ç½ä¸ï¼è¿ä¸¤ç§å¨ææ§watermakerç产çåå«éç¨ä»ä¹åºæ¯å¢ï¼
-
å¨ææ§çwatermarke 设置å®æ¶äº§çï¼ ExecutionConfig.setAutoWatermarkIntervalï¼â¦ï¼ï¼è¿ä¸ªå®æ¶çæ¶é´ä¸è¬ææ ·å»è¯ä¼°å¢ï¼
-
æ³é®ä¸ä¸è½å¦å¾å°flinkåé
èµæºçæ¶é´ï¼
-
é®ä¸flinkåkafkaç产æ°æ®ææ¶åæ¥éï¼This server does not host this topic-partition
-
flink yarn 模å¼å¯å¨ï¼log4j. propertiesé
置信æ¯è§å¾çï¼yarnå¯å¨é¡µé¢çtaskmanagerè½çå°æ¥å¿è¾åºå°stdoutï¼ä½æ¯å¨æå®çæ¥å¿æ件夹ä¸å°±æ¯æ²¡ææ¥å¿æ件çæãï¼æ¬å°è¿è¡ææ¥å¿æ件ç
-
æä¸ä¸ªé®é¢ãflink2hbase å¦ä½æ ¹æ®hbaseä¸çæ¥æå段ï¼å¨ææ天建表å¢ï¼æèªå®ä¹äºhbase sinkï¼å¨invokeæ¹æ³ä¸æ ¹æ®æ°æ®çæ¶é´å»ºè¡¨ï¼ä½æ¯å¸¦æ¥äºä¸ä¸ªé®é¢ï¼æ¯æ¡æ°æ®é½è¦å»check表æ¯å¦åå¨ï¼è¿æ ·ä¼äº§ç大éçrpc请æ±ã请é®æ主大大ï¼é对ä¸è¿°è¿ç§æ
åµï¼æä»ä¹å¥½ç解å³åæ³åï¼
-
ä½ å¥½ï¼æå
³äºTM,slots,å
åï¼çº¿ç¨æ°ï¼è¿ç¨æ°ï¼cpuï¼è°åº¦ç¸å
³çèµæåï¼æ¯å¦ä¸ä¸ªslotèµ·å¤å°çº¿ç¨ï¼ä¸ºä»ä¹ï¼å¦ä½èµ·çï¼taskæ¯å¦ä½è°åº¦çä¹ç±»çãç½ä¸æ²¡æ¾å°æ³è¦çï¼ä¹¦ä¸åçä¹ä¸å¤ç»ãæºç çè¯åå¼å§çä¸å¤ªæï¼æ以æ³å
æ¾æ¾èµæçç
-
è½å¦å¨flinkä¸åªæ°å»ºä¸ä¸ªFlinkKafkaConsumer读åå¤ä¸ªkafkaçtopics ï¼è¿äºtopicsçå¤çé»è¾é½æ¯ä¸æ ·ç æç»å°æ°æ®åå
¥æ¯ä¸ªtopic对åºçes表 请é®è¿ä¸ªå®ç°é»è¾æ¯ææ ·ç
-
è½ä¸è½æè¿°ä¸ä¸å¨çªå£ä¸ï¼ä¾å¦æ»å¨çªå£ï¼å¤ä¸ªäºä»¶è¿çªå£åï¼äºä»¶å¨å
åä¸ä¿åçå½¢å¼æ¯æä¹æ ·çï¼ä¼åæä¸ä¸ªstateï¼è¿æ¯å¤ä¸ªäºä»¶åæä¸ä¸ªstateï¼äºä»¶è·stateçå
³ç³»ï¼äºä»¶æ¶é´è¿äºå¨çªå£æ¯æä¹æ¸
çäºä»¶çï¼å¦æstate backendsç¨çæ¯RocksDBStateBackendï¼å¢écheckpointï¼æä¹æ¸
çå·²ä¿åè¿æçäºä»¶å§ï¼
-
请é®ä¸ä¸ Flinkççæ§æ¯å¦ä½åçï¼æ¯å¦jobæäºè½åè¦éç¥ãç®åæ¯æ³ç¨Prometheusæ¥åçæ§ï¼ä½æ¯åç°ä¸æ¥çææ 没æå¾ç¬¦åçæéæ±ãæè¿è¾¹ç¨yarn-sessionå¯å¨çjobï¼ä¸ä¸ªjobMangerä¼ç®¡çå¤ä¸ªjobãPrometheusè¿æ¯åäºè§£é¶æ®µå¯è½éæ¼äºä¸äºä¸æ¥ææ ï¼ç主大大æ没æ好ç建议ã
-
ProcessTimeåEventTimeæ¯å¦å¯ä»¥ä¸èµ·ä½¿ç¨ï¼å½ä»»å¡æåºå¼å¸¸å¤±è´¥çæ¶åï¼å¦æé
ç½®äºéå¯çç¥ï¼éå¯æ¶æ¯ä¸æ¯ä»æè¿çcheckpoint继ç»ï¼éå°äºä¸ä¸ªæ°æ®åºä¸»é®å²çªçé®é¢ï¼æ¥çkafkaæ°æ®æºåç°è¯¥ä¸»é®çæ¶æ¯åªæä¸æ¡ï¼æ¥çæ¥å¿åç°Redisè¿æ¥æ± æäºå¼å¸¸(å½æ¶Rediså¨éå¯)导è´ä»»å¡å¤±è´¥éè¯ï¼å½æ¶ç¨çProcessTime
-
flink-kafka èªå®ä¹ååºååä¸å¦ä½æ´å¥½çå¤çæ°æ®å¼å¸¸å¢ï¼æç¿»å°åé¢ä¸ç¯æé®ï¼å¦æä½¿ç¨ try-catch æè·å°å¼å¸¸ï¼æ¯æåºå¼å¸¸æ´å¥½å¢ï¼è¿æ¯return null æ´å¥½å¢
-
ç°å¨å¨ç¨flinkåä¸ä¸æ¸¸æ°æ®çæ¯å¯¹ï¼ç°å¨éå°äºæ§è½ç¶é¢ï¼ä¸ä¸ªèç¹ç°å¨æå¤åªè½æ¶è´¹50æ¡æ°æ®ãè§å¯taskmanageræ¥å¿çgcæ¥å¿åç°æ大å å
åæ2.7gï¼ä½æ¯æ°ç代æ大åªæ300mãè½ä¸è½è®¾ç½®flinkçjvmåæ°ï¼flink on yarnå¯å¨æ¨¡å¼
-
请æä¸ä¸ªåçæ§çé®é¢ï¼side out putåç´æ¥æä¸ä¸ªæµç¨ä¸¤ç§æ¹å¼å¤çæå¥æ¬è´¨åºå«ï¼æè¯äºä¸ï¼æä¸ä¸ªæµä¸è¾¹åç¼åï¼ä¸è¾¹å
¥æ°æ®åºï¼ä¸¤è¾¹ä¹é½æ¯å
¨éæ°æ®
-
å¦ä½å®ä¹ä¸ä¸ªflink windowå¤çæ¹å¼ï¼1ç§éå¤ç500æ¡ï¼1ï¼kafkaä¸æ10000æ¡æ°æ®æ¶ï¼ä»æ§1ç§éå¤ç500æ¡ï¼2ï¼kafkaä¸æ20æ¡ï¼æ¯é1ç§å¤çä¸æ¬¡ã
-
é®ä¸ä¸å¤§ä½¬ï¼ç½é¡µUIå¯ä»¥è¿è¡savepointçä¿åä¹ï¼è¿æ¯åªè½ä»savepointå¯å¨ï¼
-
è½å¦æå®Kafkaæäºååºæ¶è´¹æåæ¶æ¯ï¼å
¶ä»ååºä¸æåæ¶æ¯ãç°å¨ææå¾å¤åºæ¯ï¼ä¸ä¸ªtopicä¸ç¾ä¸ªååºï¼ä½æ¯æåªéè¦å
¶ä¸å 个ååºçæ°æ®
-
ææ³è¿æ»¤kafka 读å°çæäºæ°æ®ï¼è¿æ»¤æ¡ä»¶ä»redisä¸æ¿å°ï¼ä¸ç¨æ·çé
ç½®ç¸å
³ï¼æ以éè¦å®æ¶æ´æ°ï¼ï¼æ»è§å¾æªæªçï¼è¯·é®ææ´å¥½çæ¹æ¡åï¼å 为ä¸æä¾redisçsourceï¼å æ¤ææ¯ç¨jedis客æ·ç«¯æ¥è¯»åredisæ°æ®çï¼æ°æ®ä¹è·åä¸å°ï¼è¯·é®æ主ï¼flink代ç å¨ç¼åçæ¶åï¼ä¸è¬æ¯å¦ä½è°è¯çå¢
-
flink使ç¨rocksdbç¶ææ£æ¥ç¹åå¨HDFSä¸ï¼æçä»»å¡ç¶æå¾å°ä½æ¯HDFSä¸ä¸ªæ件æå°128Mæ以ç£ç空é´å¾å¿«å°±æ»¡äºï¼æ没æå¥é
ç½®å¯ä»¥èªå¨æ¸
çæ£æ¥ç¹å¢
-
è¿æ¯å®æ¶å»éçé®é¢ã
举个ä¾åï¼å½åç订å交æçæ¶åï¼ä¸å¡ä¸å°ä¼æ该æ¯è®¢åæ¶æ¯åéå°kafkaï¼ç¶åflinkæ¶è´¹ï¼ç»è®¡æ»éé¢ãå¦æå 为ä¸å¡ä¸å°è¯¯æä½ï¼åéäºå¤æ¬¡ç¸åç订åè¿æ¥ï¼è®¢åidç¸åï¼ï¼é£ä¹ç»è®¡ç»æå°±ä¼å¤æ¬¡ç´¯å ï¼é æç»è®¡çæ»éé¢æ¯å®é
交æéé¢æ´å¤ãæéè¦èªå®ä¹å¨sourceééè¿operate stateå»éï¼ä½æ¯operate stateæ¯åæ¯ä¸ªsourceå®ä¾ç»å®ï¼ä¼é æéå¤ç订åå¯è½åéå°ä¸åçsourceå®ä¾ï¼è¿æ ·ååºæ¥çstateéé¢å°±å¯è½æ²¡æä¸ä¸æ¬¡å·²ç»è®°å½ç订åidï¼é£ä¹å°±ä¼å°è¿æ¡éå¤ç订åéé¢ç»è®¡å°æåç»æä¸ï¼
-
åæµjoinçæ¶åï¼æä¹è½ä¿è¯ä¸¤è¾¹æ¥çæ°æ®æ¯å¯¹åºçï¼ä¸¾ä¸ªä¾åï¼è®¢åæ¶æ¯ååºåæ¶æ¯ï¼æé»è¾æ¥è¯´ï¼åç订åçæ¶åï¼åºåä¹ä¼åï¼è¿ä¸¤ä¸ªtopicé½ä¼åæ¶åèªåä¸æ¡æ¶æ¯ç»æï¼ææ¿å°è¿ä¸¤æ¡æ¶æ¯ä¼æ ¹æ®è®¢åidåjoinæä½ãé®é¢æ¯é£å¦æåºåæ¶æ¯å»¶è¿äº5ç§æè
10ç§ï¼è®¢åæ¶æ¯æ¥çæ¶åå°±joinä¸å°åºåæ¶æ¯ï¼è¿æ¶å该æä¹åï¼
-
æè¿æä¸ä¸ªæ¯å¯¹ç¨åºç¨çæ¯flinkï¼æ°æ®æºç¨çæ¯flink-kafkaï¼ä¸å¡æ°æ®å为ä¸ä¸æ¸¸ï¼éè¦æ ¹æ®æ个å段åç»ï¼ç¸åçkeyä¸ä¸æ¸¸æ°æ®æ¾ä¸èµ·æ¯å¯¹ãä¸ä¸æ¸¸æ°æ®è¿æ¥çæ¶é´ä¸ä¸æ ·ï¼å æ¤æç¨äºä¸ä¸ªå¯ä»¥è¿ä»£ççªå£å¤§å°ä¸º5åéwindowè¿è¡æ¯å¯¹å¤çï¼æ大è¿ä»£æ¬¡æ°ä¸º3次ãstatebackendç¨çæ¯fsstatebackendãéè¿çæ§åç°å½ç¨åºæ¯åéæ°æ®éè¶
è¿2ä¸æ¡çæ¶åï¼ç¨åºå°±ä¸æ¶è´¹æ°æ®äºï¼è½ç¶webuiä¸æ¾ç¤ºæ£å¸¸ï¼èä¸jobmanageråtaskmanagerçstdout没æå¼å¸¸æ¥å¿ï¼ä½æ¯ç¨åºå°±æ¯ä¸æ¶è´¹æ°æ®äºã
-
å¼æ¥ioéé¢æ个容éï¼æ¯æåæ¶å¤å°ä¸ªå¹¶åè¿æ¯ï¼åå¦ææ¯ä¸ªtaskmanageræ ¸æ°è®¾ç½®10个ï¼å
±10个taskmanagerï¼é£æè¿ä¸ªæ°éåªè½è®¾ç½®100å¢
-
æ个æ§è½é®é¢æ³é®ä¸æ没æç¸å
³çç»éªï¼ä¸ä¸ªjobä»kafkaé读ä¸ä¸ªtopicæ°æ®ï¼ç¶åè¿è¡åæµï¼ä½¿ç¨sideoutåå¼ä¹åç´æ¥å¤çï¼æ§è½å½±å大åï¼æ¯å¦åå¼ä»¥åæä¸ç¾å¤åä»»å¡ãè¿æå
¶ä»ä»ä¹å¥½çæ¹æ¡è¿è¡åæµåï¼
-
线ä¸æ个ä½ä¸æåºäºä¸ä¸å¼å¸¸ï¼ä½æ¯è¿è½æ£å¸¸è¿è¡ï¼è¿ä¸ªæä¹ææ¥ï¼è½å¦æä¾ä¸ä¸æè·¯
çççï¼è¿æå¾å¤ï¼å¤å¶ç²è´´çææç´¯å ð
å¦å¤éé¢è¿ä¼åæ¶å享 Flink çä¸äºææ°çèµæï¼å
æ¬æ°æ®ãè§é¢ãPPTãä¼ç§å客ï¼æç»æ´æ°ï¼ä¿è¯å
¨ç½æå
¨ï¼å 为æç¥é Flink ç®åçèµæè¿ä¸å¤ï¼
å
³äºèªå·±å¯¹ Flink å¦ä¹ çä¸äºæ³æ³å建议
Flink å
¨ç½æå
¨èµæè·åï¼æç»æ´æ°ï¼ç¹å»å¯ä»¥è·å
åå°±æ¯æçç¨æ·ç»ææçä¸ç¹è¦æ±ï¼ä¸å®æå享ä¸äºèªå·±éå°ç Flink 项ç®çå®æï¼ç产项ç®éå°çé®é¢ï¼æ¯å¦ä½è§£å³ççç»éªä¹è°ï¼
1ãå¦ä½æ¥çèªå·±ç Job æ§è¡è®¡å并è·åæ§è¡è®¡åå¾
2ãå½å®æ¶åè¦éå° Kafka åä¸æ°æ®éå 积该ååï¼
3ãå¦ä½å¨æµæ°æ®ä¸æ¯ä¸¤ä¸ªæ°æ®ç大å°ï¼å¤ç§è§£å³æ¹æ³
4ãkafka ç³»åæç«
5ãFlinkç¯å¢é¨ç½²ãåºç¨é
ç½®åè¿è¡åºç¨ç¨åº
6ãçæ§å¹³å°è¯¥ææ¶ææ¯é¿è¿æ ·åç
7ãã大æ°æ®âéç£
ç¸å¼¹âââå®æ¶è®¡ç®æ¡æ¶ Flinkãä¸æ ç³»åæç« ç®å½å¤§çº²
8ãã大æ°æ®âéç£
ç¸å¼¹âââå®æ¶è®¡ç®æ¡æ¶ FlinkãChat ä»è´¹æç«
9ãApache Flink æ¯å¦ä½ç®¡ç好å
åçï¼
10ãFlink On K8s
11ãFlink-metrics-core
12ãFlink-metrics-datadog
13ãFlink-metrics-dropwizard
14ãFlink-metrics-graphite
15ãFlink-metrics-influxdb
16ãFlink-metrics-jmx
17ãFlink-metrics-slf4j
18ãFlink-metrics-statsd
19ãFlink-metrics-prometheus
20ãFlink 注解æºç 解æ
21ãä½¿ç¨ InfluxDB å Grafana æ建çæ§ Flink çå¹³å°
22ãä¸æææFlinkå
é¨çExactly OnceåAt Least Once
23ãä¸æè®©ä½ å½»åºäºè§£å¤§æ°æ®å®æ¶è®¡ç®æ¡æ¶ Flink
å½ç¶ï¼é¤äºæ´æ° Flink ç¸å
³çä¸è¥¿å¤ï¼æè¿ä¼æ´æ°ä¸äºå¤§æ°æ®ç¸å
³çä¸è¥¿ï¼å 为æ个人ä¹åä¸æ¯å¤§æ°æ®å¼åï¼æ以ç°å¨ä¹è¦çè¡¥äºç¥è¯ï¼æ»ä¹ï¼å¸æè¿æ¥çç«¥é们ä¸èµ·å
±åè¿æ¥ï¼
1ãJava æ ¸å¿ç¥è¯ç¹æ´ç.pdf
2ãåå¦ææ¯é¢è¯å®ï¼æä¼é®ä½ è¿äºé®é¢
3ãKafka ç³»åæç« åå¦ä¹ è§é¢
4ãéæ°å®ä¹ Flink 第äºæ pdf
5ãGitChat Flink æç« ççè®°å½
6ãJava 并å课ç¨è¦ææ¡çç¥è¯ç¹
7ãLightweight Asynchronous Snapshots for Distributed Dataflows
8ãApache Flinkâ¢- Stream and Batch Processing in a Single Engine
9ãFlinkç¶æ管çä¸å®¹éæºå¶
10ãFlink æµæ¹ä¸ä½çææ¯æ¶æ以åå¨é¿éçå®è·µ
11ãFlink Checkpoint-è½»é级åå¸å¼å¿«ç
§
12ãFlink æµæ¹ä¸ä½çææ¯æ¶æ以åå¨é¿éçå®è·µ
13ãStream Processing with Apache Flink pdf
14ãFlink ç»åæºå¨å¦ä¹ ç®æ³ççæ§å¹³å°å®è·µ
15ãã大æ°æ®éç£
ç¸å¼¹-å®æ¶è®¡ç®Flinkãé¢å¤ç¯ââ大æ°æ®å®æ¶è®¡ç®ä»ç»åå
¶å¸¸ç¨ä½¿ç¨åºæ¯ pdf åè§é¢
16ãã大æ°æ®éç£
ç¸å¼¹-å®æ¶è®¡ç®Flinkãå¼ç¯è¯ pdf åè§é¢
17ãåæ¬ Flink 书
18ãæµå¤çç³»ç» çç¸å
³ paper
19ãApache Flink 1.9 ç¹æ§è§£è¯»
20ãæé åºäºFlink Table APIçæºå¨å¦ä¹ çæ
21ãåºäºFlink on Kubernetesç大æ°æ®å¹³å°
22ãåºäºApache Flinkçé«æ§è½æºå¨å¦ä¹ ç®æ³åº
23ãApache Flinkå¨å¿«æçåºç¨ä¸å®è·µ
24ãApache Flink-1.9ä¸Hiveçå
¼å®¹æ§
25ãæé åºäºFlink Table APIçæºå¨å¦ä¹ çæ
26ãæµå¤çç³»ç»çç¸å
³ paper