-
Notifications
You must be signed in to change notification settings - Fork 0
/
3576d730.f1567e18.js
1 lines (1 loc) · 47.1 KB
/
3576d730.f1567e18.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{111:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return c})),a.d(t,"metadata",(function(){return r})),a.d(t,"rightToc",(function(){return b})),a.d(t,"default",(function(){return o}));var n=a(2),l=a(6),i=(a(0),a(130)),c={id:"flink-ali-src",title:"Flink\u6280\u672f\u6e90\u7801\u89e3\u6790\uff08\u4e00\uff09\uff1aFlink\u6982\u8ff0\u4e0e\u6e90\u7801\u7814\u8bfb\u51c6\u5907",author:"binggozhan",author_title:"\u641c\u7d22\u63a8\u8350\u5de5\u7a0b\u5e08 @ \u963f\u91cc\u53e3\u7891",author_url:"https://yq.aliyun.com/users/h34rcygfetceq?spm=a2c4e.11153940.0.0.3055286bED1kYa",author_image_url:"https://ucc.alicdn.com/avatar/img_b31506cca41b90c5502b38e742c21c3e.jpeg",tags:["flink","debug"]},r={permalink:"/blog/flink-ali-src",editUrl:"https://github.com/flink-lab/home-page/edit/master/blog/blog/2018-06-06-flink-ali-src.md",source:"@site/blog/2018-06-06-flink-ali-src.md",description:"\u4e00\u3001\u524d\u8a00",date:"2018-06-06T00:00:00.000Z",tags:[{label:"flink",permalink:"/blog/tags/flink"},{label:"debug",permalink:"/blog/tags/debug"}],title:"Flink\u6280\u672f\u6e90\u7801\u89e3\u6790\uff08\u4e00\uff09\uff1aFlink\u6982\u8ff0\u4e0e\u6e90\u7801\u7814\u8bfb\u51c6\u5907",readingTime:2.3,truncated:!0,prevItem:{title:"Advanced Apache Flink Tutorial 1 - Analysis of Runtime Core Mechanism",permalink:"/blog/flink-tutorial"}},b=[{value:"\u4e00\u3001\u524d\u8a00",id:"\u4e00\u3001\u524d\u8a00",children:[]},{value:"\u4e8c\u3001Flink\u6982\u8ff0\u63d0\u8981",id:"\u4e8c\u3001flink\u6982\u8ff0\u63d0\u8981",children:[{value:"2.1 \u4e3b\u8981\u7279\u6027\u4e0e\u7ec4\u6210",id:"21-\u4e3b\u8981\u7279\u6027\u4e0e\u7ec4\u6210",children:[]},{value:"2.2 \u7f16\u7a0b\u6a21\u578b",id:"22-\u7f16\u7a0b\u6a21\u578b",children:[]},{value:"2.3 \u5206\u5e03\u5f0fruntime",id:"23-\u5206\u5e03\u5f0fruntime",children:[]},{value:"2.4 API&\u5e93",id:"24-api\u5e93",children:[]},{value:"2.5 Flink\u76d1\u63a7",id:"25-flink\u76d1\u63a7",children:[]}]},{value:"\u4e09\u3001Job\u5f00\u53d1",id:"\u4e09\u3001job\u5f00\u53d1",children:[]},{value:"\u56db\u3001Flink\u6e90\u7801\u7814\u8bfb\u51c6\u5907",id:"\u56db\u3001flink\u6e90\u7801\u7814\u8bfb\u51c6\u5907",children:[{value:"4.1 \u811a\u672c\u5206\u6790",id:"41-\u811a\u672c\u5206\u6790",children:[]},{value:"4.2 \u6e90\u7801debug\u65b9\u6cd5",id:"42-\u6e90\u7801debug\u65b9\u6cd5",children:[]}]}],p={rightToc:b};function o(e){var t=e.components,a=Object(l.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},p,a,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h2",{id:"\u4e00\u3001\u524d\u8a00"},"\u4e00\u3001\u524d\u8a00"),Object(i.b)("p",null,"Apache Flink\u4f5c\u4e3a\u4e00\u6b3e\u9ad8\u541e\u5410\u91cf\u3001\u4f4e\u5ef6\u8fdf\u7684\u9488\u5bf9\u6d41\u6570\u636e\u548c\u6279\u6570\u636e\u7684\u5206\u5e03\u5f0f\u5b9e\u65f6\u5904\u7406\u5f15\u64ce\uff0c\u662f\u5f53\u524d\u5b9e\u65f6\u5904\u7406\u9886\u57df\u7684\u4e00\u9897\u7099\u624b\u53ef\u70ed\u7684\u65b0\u661f\u3002\u5173\u4e8eFlink\u4e0e\u5176\u5b83\u4e3b\u6d41\u5b9e\u65f6\u5927\u6570\u636e\u5904\u7406\u5f15\u64ceStorm\u3001Spark Streaming\u7684\u4e0d\u540c\u4e0e\u4f18\u52bf\uff0c\u53ef\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://blog.csdn.net/cm_chenmin/article/details/53072498%E3%80%82"}),"https://blog.csdn.net/cm_chenmin/article/details/53072498\u3002")),Object(i.b)("p",null,"\u51fa\u4e8e\u6280\u672f\u4eba\u5bf9\u6280\u672f\u672c\u80fd\u7684\u597d\u5947\u4e0e\u51b2\u52a8\uff0c\u9042\u5229\u7528\u4e1a\u4f59\u65f6\u95f4\u5bf9Flink\u8fdb\u884c\u5b66\u4e60\u7814\u7a76\u3002Flink\u6e90\u7801\u5f88\u5e9e\u5927\uff0c\u8981\u68b3\u7406\u660e\u767d\u9700\u8981\u6295\u5165\u7684\u65f6\u95f4\u5fc3\u529b\u5de8\u5927\uff0c\u6240\u4ee5\u7b14\u8005\u53ea\u662f\u9488\u5bf9\u81ea\u5df1\u6240\u611f\u5174\u8da3\u7684\u82e5\u5e72\u8bdd\u9898\u5c55\u5f00\u7814\u7a76\uff0c\u6c34\u5e73\u6709\u9650\u5982\u6709\u9519\u8bef\u8bf7\u6307\u6b63\u3002"),Object(i.b)("h2",{id:"\u4e8c\u3001flink\u6982\u8ff0\u63d0\u8981"},"\u4e8c\u3001Flink\u6982\u8ff0\u63d0\u8981"),Object(i.b)("h3",{id:"21-\u4e3b\u8981\u7279\u6027\u4e0e\u7ec4\u6210"},"2.1 \u4e3b\u8981\u7279\u6027\u4e0e\u7ec4\u6210"),Object(i.b)("p",null,"Flink\u662f\u4e00\u4e2a\u7528\u4e8e\u6d41\u5904\u7406\u548c\u6279\u5904\u7406\u7684\u5f00\u6e90\u5206\u5e03\u5f0f\u5e73\u53f0\uff0c\u5b83\u7684\u6838\u5fc3\u662f\u6d41\u5904\u7406\u5f15\u64ce\uff08streaming dataflow engine\uff09\u3002"),Object(i.b)("p",null,"batch dataset\u53ef\u4ee5\u89c6\u4f5cstreaming dataset\u7684\u4e00\u79cd\u7279\u4f8b\uff0c\u6240\u4ee5Flink\u53ef\u901a\u8fc7\u6d41\u5904\u7406\u5f15\u64ce\u540c\u65f6\u5904\u7406batch\u3001streaming\u4e24\u79cd\u7c7b\u578b\u7684\u6570\u636e\u3002\u8fd9\u548cspark streaming\u521a\u597d\u76f8\u53cd\uff0cspark streaming\u662f\u901a\u8fc7micro batch\u5b9e\u73b0\u5bf9streaming\u5904\u7406\u7684\u652f\u6301\u3002"),Object(i.b)("h4",{id:"flink\u7684\u529f\u80fd\u7279\u6027\uff1a"},"Flink\u7684\u529f\u80fd\u7279\u6027\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u53ef\u63d0\u4f9b\u51c6\u786e\u7684\u7ed3\u679c\u4ea7\u51fa\uff0c\u5373\u4f7f\u9047\u5230\u4e71\u5e8f\u6570\u636e\u3001\u8fdf\u5230\u6570\u636e\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u6709\u72b6\u6001\u53ef\u5bb9\u9519\uff08\u8f7b\u91cf\u7ea7\uff09\uff0c\u53ef\u4ee5\u65e0\u611f\u77e5\u5730\u4ece\u5931\u8d25\u4e2d\u6062\u590d\u5e76\u4fdd\u6301exactly-once\u7684\u8bed\u4e49\uff08\u4e5f\u53ef\u4ee5\u964d\u7ea7\u4e3aat-least-once\u8fdb\u4e00\u6b65\u964d\u4f4e\u6d88\u606f\u5904\u7406\u5ef6\u65f6\uff09\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u53ef\u4ee5\u5927\u89c4\u6a21\u5730\u8fd0\u884c\u5728\u6210\u5343\u4e0a\u4e07\u4e2a\u8282\u70b9\u4e0a\u5e76\u4fdd\u6301\u9ad8\u541e\u5410\u3001\u4f4e\u5ef6\u8fdf\uff0c\u53ef\u4ee5standalone\u6a21\u5f0f\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u5728YARN\u548cMesos\u7b49\u8d44\u6e90\u7ba1\u7406\u5e73\u53f0\u4e0a\u8fd0\u884c\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u7075\u6d3b\u5730\u652f\u6301\u591a\u79cd\u57fa\u4e8e\u65f6\u95f4\u3001\u6570\u91cf\u3001\u4f1a\u8bdd\u7684\u7a97\u53e3\uff1b"),Object(i.b)("li",{parentName:"ul"},"savepoint\u63d0\u4f9b\u4e86\u72b6\u6001\u7ba1\u7406\u673a\u5236\uff1b")),Object(i.b)("h4",{id:"flink\u81ea\u4e0b\u800c\u4e0a\u7684\u5168\u5c40\u7ec4\u6210\u7ed3\u6784\u56fe\uff1a"},"Flink\u81ea\u4e0b\u800c\u4e0a\u7684\u5168\u5c40\u7ec4\u6210\u7ed3\u6784\u56fe\uff1a"),Object(i.b)("p",null,Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/9FLlwL.png",alt:"img"}))),Object(i.b)("h3",{id:"22-\u7f16\u7a0b\u6a21\u578b"},"2.2 \u7f16\u7a0b\u6a21\u578b"),Object(i.b)("h4",{id:"221-flink\u63d0\u4f9b\u7684api"},"2.2.1 Flink\u63d0\u4f9b\u7684API"),Object(i.b)("p",null,"Flink\u63d0\u4f9b\u4e86\u4e0d\u540c\u5c42\u6b21\u7684API\u7528\u4e8estreaming/batch\u5e94\u7528\u7684\u5f00\u53d1\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("p",null,Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/HyBa73.png",alt:"img"}))),Object(i.b)("p",null,"\u6700\u5e95\u5c42\u7684\u62bd\u8c61\u4ec5\u63d0\u4f9b\u72b6\u6001\u6d41\uff08stateful streaming\uff09\uff0c\u5b83\u901a\u8fc7\u5904\u7406\u51fd\u6570\u5d4c\u5165\u5230DataStream API\u4e2d\u3002"),Object(i.b)("p",null,"\u5b9e\u8df5\u4e2d\u7528Core API\u6bd4\u8f83\u591a\uff0c\u8fd9\u4e9b\u6d41\u5f0f\u7684API\u63d0\u4f9b\u4e86\u901a\u7528\u7684\u6784\u5efa\u5165\u53e3\u7528\u4e8e\u6570\u636e\u5904\u7406\uff0c\u50cf\u5404\u79cd\u7528\u6237\u81ea\u5b9a\u4e49\u7684transformation\u3001join\u3001aggregation\u3001window\u3001state\u7b49\u3002"),Object(i.b)("p",null,"Table API\u662f\u4ee5\u8868\u4e3a\u4e2d\u5fc3\u7684\u58f0\u660e\u5f0fDSL\uff08\u9886\u57df\u7279\u5b9a\u8bed\u8a00\uff09\uff0c\u5f53\u8fd9\u4e9bTable\u8868\u793a\u7684\u662fstream\u65f6\uff0cTable\u662f\u52a8\u6001\u53d8\u5316\u7684\u3002Table API\u9075\u5faa\u6269\u5c55\u7684\u5173\u7cfb\u6a21\u578b\uff0c\u63d0\u4f9b\u4e86\u5305\u62ecselect\u3001project\u3001join\u3001group-by\u3001aggregate\u7b49\u64cd\u4f5c\u3002"),Object(i.b)("p",null,"Flink\u63d0\u4f9b\u7684\u6700\u9ad8\u5c42\u7ea7\u7684API\u662fSQL\uff0c\u5b83\u5728\u8bed\u4e49\u548c\u8868\u8fbe\u80fd\u529b\u4e0a\u4e0eTable API\u662f\u7c7b\u4f3c\u7684\u3002"),Object(i.b)("h4",{id:"222-flink\u7a0b\u5e8f\u4e0estreaming-dataflow"},"2.2.2 Flink\u7a0b\u5e8f\u4e0eStreaming Dataflow"),Object(i.b)("p",null,"Flink\u7a0b\u5e8f\u7684\u57fa\u672c\u5143\u7d20\u5305\u62ec\uff1a"),Object(i.b)("p",null,"Stream\uff1a\u7531\u8fde\u7eed\u4e0d\u65ad\u7684data record\u7ec4\u6210\u7684\u6570\u636e\u6d41\u3002\ntransformation\uff1a\u662f\u4e00\u79cd\u8f6c\u6362\u64cd\u4f5c\uff0c\u4f5c\u7528\u5728\u4e00\u4e2a\u6216\u591a\u4e2astream\u4e0a\uff0c\u8f93\u51fa\u4e00\u4e2a\u6216\u591a\u4e2astream\u3002\n\u6bcf\u4e2aFlink\u7a0b\u5e8f\u53ef\u4ee5\u6620\u5c04\u4e3a\u4e00\u4e2astreaming dataflow\uff0c\u8fd9\u4e2adataflow\u7531stream\u548ctransformation operator\u7ec4\u6210\u3002\u6bcf\u4e2adataflow\u662f\u4e00\u4e2aDAG\uff0c\u4ece\u4e00\u4e2a\u6216\u591a\u4e2asource\u5f00\u59cb\uff0c\u7ed3\u675f\u4e8e\u4e00\u4e2a\u6216\u591a\u4e2asink\u3002"),Object(i.b)("p",null,"Flink\u7a0b\u5e8fStreaming dataflow\u7684\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("p",null,Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/mZqapX.png",alt:"img"}))),Object(i.b)("p",null,"\u4e00\u4e2a\u6807\u51c6Flink\u7a0b\u5e8f\u7684\u7ec4\u6210\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u83b7\u53d6\u4e00\u4e2a\u6267\u884c\u73af\u5883\uff08StreamExecutionEnvironment\u7528\u4e8e\u6d41\u5904\u7406\uff0cExecutionEnvironment\u7528\u4e8e\u6279\u5904\u7406\uff09\uff0c\u6267\u884c\u73af\u5883\u53ef\u4ee5\u51b3\u5b9a\u5c06\u4e0b\u9762\u7684\u8ba1\u7b97\u653e\u5728\u672c\u5730jvm\u8fd0\u884c\u8fd8\u662f\u63d0\u4ea4\u5230Flink\u96c6\u7fa4\u4e2d\u8fd0\u884c\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u52a0\u8f7d\u521d\u59cb\u6570\u636e\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u5728\u6570\u636e\u4e0a\u6307\u5b9a\u9700\u8981\u6267\u884c\u7684transformation\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u6307\u5b9a\u5c06\u8ba1\u7b97\u7ed3\u679c\u5199\u5230\u54ea\u91cc\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u89e6\u53d1\u7a0b\u5e8f\u6267\u884c\uff1b")),Object(i.b)("h4",{id:"223-\u5e76\u884c\u7684dataflow"},"2.2.3 \u5e76\u884c\u7684dataflow"),Object(i.b)("p",null,"Flink\u7a0b\u5e8f\u5728\u5b9e\u9645\u8fd0\u884c\u4e2d\u662f\u5e76\u884c\u7684\u3001\u5206\u5e03\u5f0f\u7684\uff1a"),Object(i.b)("p",null,"\u4e00\u4e2astream\u4f1a\u88ab\u62c6\u5206\u4e3a\u4e00\u4e2a\u6216\u591a\u4e2astream partitions\u3002"),Object(i.b)("p",null,"\u4e00\u4e2atransformation operator\u53ef\u4ee5\u62c6\u5206\u4e3a\u4e00\u4e2a\u6216\u591a\u4e2aoperator subtask\uff08subtask\u7684\u6570\u91cf\u79f0\u4e3a\u8fd9\u4e2aoperator\u7684\u5e76\u884c\u5ea6\uff09\u3002\u6bcf\u4e2aoperator subtask\u548c\u5176\u5b83\u7684operator subtask\u76f8\u4e92\u72ec\u7acb\uff0c\u5e76\u8fd0\u884c\u5728\u4e0d\u540c\u7684\u7ebf\u7a0b\u4e2d\uff08\u751a\u81f3\u5728\u4e0d\u540c\u7684\u673a\u5668\u4e0a\uff09Flink\u7a0b\u5e8f\u4e2d\u7684source\u3001sink\u4e5f\u90fd\u5c5e\u4e8etransformation operator\u3002"),Object(i.b)("p",null,"\u4e00\u4e2atransformation operator\u4e2d\u7684operator subtask\u4e2a\u6570\u5c31\u662f\u8fd9\u4e2aoperator\u7684\u5e76\u884c\u5ea6\uff1b\u4e00\u4e2astream\u7684\u5e76\u884c\u5ea6\u4e3a\u5bf9\u5e94\u7684producing operator\uff08\u4ece\u6570\u636e\u6e90\u8bfb\u6570\u636e\u7684operator\uff09\u7684\u4e2a\u6570\u3002\u4e00\u4e2a\u7a0b\u5e8f\u4e2d\u7684\u4e0d\u540coperator\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\u7684\u5e76\u884c\u5ea6\u3002"),Object(i.b)("p",null,"\u4e00\u4e2adataflow\u7684\u8fd0\u884c\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("p",null," ",Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/9JtCM6.png",alt:"img"}))),Object(i.b)("p",null,"\u6d41\u4e2d\u7684\u6570\u636e\u5728\u4e0d\u540coperator\u4e4b\u95f4\u7684\u4f20\u9012\u65b9\u5f0f\u6709\u4e24\u79cd\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"one-to-one\uff1a\u50cf\u4e0a\u56fe\u7684Source","[1]"," -> map","[1]","\u3002")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"redistributing\uff1a\u50cf\u4e0a\u56fe\u7684map","[1]"," -> keyBy()/window()/apply() ","[1]","\u548c","[2]","\u3002"))),Object(i.b)("h4",{id:"224-window"},"2.2.4 Window"),Object(i.b)("p",null,"\u5728streams\u4e0a\u5bf9event\u8fdb\u884c\u805a\u5408\uff08\u5982count\u3001sum\uff09\u4e0e\u6279\u5904\u7406\u4e0d\u540c\uff0c\u9700\u8981\u901a\u8fc7window\u9650\u5b9a\u805a\u5408\u7684event\u8303\u56f4\uff0c\u5982\u7edf\u8ba1\u6700\u8fd15\u5206\u949f\u7684event\u6570\u91cf\u3002stream\u4e0a\u7684window\u53ef\u4ee5\u662f\u65f6\u95f4\u9a71\u52a8\uff08\u5982\u6bcf30\u79d2\uff09\uff0c\u4e5f\u53ef\u4ee5\u662f\u6570\u636e\u9a71\u52a8\uff08\u5982\u6bcf100\u4e2a\u5143\u7d20\uff09\u3002"),Object(i.b)("p",null,"window\u7c7b\u578b\u7684\u5178\u578b\u5212\u5206\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"tumbling windows\uff1a\u4e0d\u540cwindow\u4e4b\u95f4\u7684\u5143\u7d20\u4e0d\u91cd\u53e0\u3002"),Object(i.b)("li",{parentName:"ul"},"sliding window\uff1a\u4e0d\u540cwindow\u4e4b\u95f4\u7684\u5143\u7d20\u53ef\u91cd\u53e0\u3002"),Object(i.b)("li",{parentName:"ul"},"session window\uff1a\u5373\u901a\u8fc7\u4f1a\u8bdd\u6765\u533a\u5206window\u3002")),Object(i.b)("p",null,"\u4e00\u4e2astream\u4e0a\u53ef\u4ee5\u540c\u65f6\u6709\u591a\u4e2awindow\uff1a"),Object(i.b)("p",null," ",Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/6QMI6n.png",alt:"img"}))),Object(i.b)("h4",{id:"225-\u6709\u72b6\u6001\u7684operation"},"2.2.5 \u6709\u72b6\u6001\u7684Operation"),Object(i.b)("p",null,"dataflow\u4e2d\u5f88\u591aoperator\u5728\u4e00\u4e2a\u65f6\u95f4\u70b9\u901a\u5e38\u53ea\u5173\u6ce8\u4e00\u4e2aevent\uff0c\u662f\u65e0\u72b6\u6001\u7684\uff1b\u800c\u6709\u4e9boperator\u4f1a\u9700\u8981\u8bb0\u5fc6\u8de8\u591a\u4e2aevent\u7684\u4fe1\u606f\uff0c\u8fd9\u4e9boperator\u5c31\u662f\u6709\u72b6\u6001\u7684\u3002"),Object(i.b)("p",null,"\u6709\u72b6\u6001\u7684operator\u7684\u72b6\u6001\u4ee5key/value\u7684\u5f62\u5f0f\u5b58\u50a8\uff08\u5728\u5185\u5b58\u3001HDFS\u6216RocksDB\u4e2d\uff09\uff0c\u5e76\u4e0estream\u4e00\u8d77\u88ab\u5206\u5272\u5206\u5e03\u5f0f\u5b58\u50a8\u3002"),Object(i.b)("h4",{id:"226-checkpoint\u4e0e\u5bb9\u9519"},"2.2.6 Checkpoint\u4e0e\u5bb9\u9519"),Object(i.b)("p",null,"Flink\u901a\u8fc7\u6d41\u91cd\u653e\uff08stream replay\uff09\u3001\u68c0\u67e5\u70b9\uff08checkpointing\uff09\u6765\u5b9e\u73b0\u5bb9\u9519\u3002"),Object(i.b)("p",null,"checkpoint\u5b58\u50a8\u7684\u4fe1\u606f\u5305\u62ec\u67d0\u4e2a\u7279\u5b9aevent\u5728stream\u4e2d\u7684\u504f\u79fb\u91cf\u3001dataflow\u4e2d\u76f8\u5173operator\u5904\u7406\u5230\u8fd9\u4e2aevent\u65f6\u7684\u72b6\u6001\u3002"),Object(i.b)("p",null,"\u4e00\u4e2astream dataflow\u53ef\u4ee5\u4ece\u4e00\u4e2a\u4efb\u610f\u6307\u5b9a\u7684checkpoint\u6062\u590d\uff08\u52a0\u8f7dcheckpoint\u4e2d\u5404operator\u7684\u72b6\u6001\uff0c\u7136\u540e\u4ecestream\u4e2d\u6307\u5b9aevent\u4f4d\u7f6e\u5f00\u59cb\u91cd\u653e\uff09\uff0c\u540c\u65f6\u4fdd\u8bc1exactly-once\u8bed\u4e49\u3002"),Object(i.b)("p",null,"\u5bf9flink\u7684checkpoint\u65f6\u95f4\u95f4\u9694\uff0c\u5982\u679c\u8bbe\u7f6e\u7684\u8f83\u957f\uff0c\u5219\u5bb9\u9519\u5f00\u9500\u5c0f\uff0c\u4f46\u662f\u4ececheckpoint\u6062\u590d\u65f6\u95f4\u957f\uff08\u56e0\u4e3a\u9700\u8981\u91cd\u653e\u5f88\u591a\u7684event\uff09\uff1b\u5982\u679c\u8bbe\u7f6e\u7684\u8f83\u77ed\uff0c\u5219\u6062\u590d\u5f88\u5feb\uff0c\u4f46\u662f\u5bb9\u9519\u5f00\u9500\u5927\uff08\u5b58\u50a8\u4e86\u5f88\u591acheckpoints\uff09\u3002"),Object(i.b)("p",null,"\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0cFlink\u5c06\u6279\u5904\u7406\u770b\u505a\u6d41\u5904\u7406\u7684\u4e00\u79cd\u7279\u6b8a\u60c5\u5f62\uff08\u5373stream\u662f\u6709\u754c\u7684\u60c5\u5f62\uff09\u3002Flink\u5bf9\u6279\u5904\u7406\u5e76\u4e0d\u7528checkpoint\uff0c\u56e0\u4e3a\u8003\u8651\u5230batch data\u662f\u6709\u9650\u7684\uff0c\u5f53\u5904\u7406\u6570\u636e\u5931\u8d25\u4e86\u628a\u6240\u6709\u6570\u636e\u91cd\u653e\u4e00\u904d\u5373\u53ef\u3002\u56e0\u800c\u6279\u5904\u7406\u4e2d\u5904\u7406event\u4f1a\u66f4\u5feb\uff08\u56e0\u4e3a\u907f\u514d\u4e86checkpoint\uff09\u3002"),Object(i.b)("h4",{id:"227-watermark"},"2.2.7 WaterMark"),Object(i.b)("p",null,"WaterMark\uff08\u5305\u542b\u4e00\u4e2a\u65f6\u95f4\u6233\uff09\u53ef\u4ee5\u50cf\u6b63\u5e38\u7684element\u4e00\u6837\u63d2\u5165\u5230stream\u4e2d\uff0c\u7528\u4e8e\u544a\u8bc9operator\u4e0d\u4f1a\u6709\u6bd4\u5b83\u81ea\u5df1\u66f4\u665a\u7684element\u5230\u6765\u3002WaterMark\u5728source\u4e2d\u53d1\u5c04\uff0c\u5e76\u901a\u8fc7operator\u5728stream\u4e2d\u5411\u4e0b\u4f20\u64ad\u3002"),Object(i.b)("p",null,"watermark\u53ea\u662f\u542f\u53d1\u5f0f\u7684\uff0c\u5982\u679c\u6709\u6bd4watermark\u7684event time\u65e9\u7684element\u5728watermark\u4e4b\u540e\u5230\uff0coperator\u4ecd\u7136\u9700\u8981\u652f\u6301\u5904\u7406\uff08\u629b\u5f03\u6216\u66f4\u65b0\u7ed3\u679c\uff09\u3002\u5f53source\u53d1\u4e86\u4e00\u4e2a\u6700\u7ec8\u7684watermark\uff08\u65f6\u95f4\u6233\u4e3aLong.MAX_VALUE\uff09\uff0c\u6536\u5230\u5b83\u7684operator\u5c31\u77e5\u9053\u4e0d\u4f1a\u6709\u66f4\u591a\u7684\u8f93\u5165\u4e86\u3002"),Object(i.b)("h3",{id:"23-\u5206\u5e03\u5f0fruntime"},"2.3 \u5206\u5e03\u5f0fruntime"),Object(i.b)("h4",{id:"231-\u4efb\u52a1\u94fe\u4e0eoprator\u94fe"},"2.3.1 \u4efb\u52a1\u94fe\u4e0eOprator\u94fe"),Object(i.b)("p",null,"\u4e3a\u4e86\u80fd\u591f\u5206\u5e03\u5f0f\u6267\u884c\uff0cFlink\u5c06operator subtask\u94fe\u5f0f\u62fc\u63a5\u4e3a\u4e00\u4e2atask\uff0c\u6bcf\u4e2atask\u7531\u4e00\u4e2a\u7ebf\u7a0b\u6765\u6267\u884c\u3002\u8fd9\u662f\u4e00\u4e2a\u5f88\u6709\u7528\u7684\u4f18\u5316\uff0c\u5b83\u53ef\u4ee5\u964d\u4f4e\u7ebf\u7a0b\u4e4b\u95f4\u7684\u5207\u6362\u5f00\u9500\uff0c\u589e\u52a0Flink\u7684\u541e\u5410\u91cf\uff0c\u5e76\u964d\u4f4e\u5904\u7406\u5ef6\u65f6\u3002"),Object(i.b)("p",null,"\u4e0b\u56fe\u5c55\u793a\u7684\u662f\u4e00\u4e2adataflow\uff0c\u5176\u4e2d\u6d89\u53ca\u5230source\u3001map()\u3001keyBy()/window()/apply()\u3001sink\u7b49operator\u3002"),Object(i.b)("p",null,"source\u548cmap\u5206\u522b\u90fd\u88ab\u62c6\u5206\u4e3a\u4e24\u4e2aoperator subtask\u5e76\u5404\u5206\u914d\u4e00\u4e2a\u7ebf\u7a0b\uff0c\u5176\u4e2d\u8003\u8651\u5230event\u5728source\u3001map\u4e2d\u7684\u4f20\u8f93\u65b9\u5f0f\u662fone-to-one\u6240\u4ee5\u5c06source\u548cmap\u94fe\u63a5\u5728\u540c\u4e00\u4e2a\u7ebf\u7a0b\u91cc\uff1b\nkeyBy()/window()/apply()\u4e5f\u88ab\u62c6\u5206\u4e3a\u4e24\u4e2aoperator subtask\u5e76\u5404\u5360\u4e00\u4e2a\u7ebf\u7a0b\uff1b"),Object(i.b)("p",null,Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/OfYBo3.png",alt:"img"}))),Object(i.b)("h4",{id:"232-jobmanagertaskmanagerclient"},"2.3.2 JobManager/TaskManager/Client"),Object(i.b)("p",null,"Flink\u8fd0\u884c\u65f6\u5305\u542b\u4e24\u79cd\u7c7b\u578b\u7684\u8fdb\u7a0b\uff1a"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"JobManager\uff08master\uff09\uff1a\u534f\u8c03job\u7684\u5206\u5e03\u5f0f\u6267\u884c\uff0c\u5177\u4f53\u5305\u62ec\u8c03\u5ea6task\u3001\u534f\u8c03checkpoint\u3001\u534f\u8c03\u4ece\u5931\u8d25\u4e2d\u6062\u590d\u7b49\u3002\u5728\u5b9e\u9645\u90e8\u7f72\u4e2d\uff0c\u81f3\u5c11\u6709\u4e00\u4e2aJobManager\uff0c\u9ad8\u53ef\u7528\u6a21\u5f0f\u4e0b\u4f1a\u6709\u591a\u4e2aJobManager\uff08\u4e00\u4e2a\u4f5c\u4e3aleader\u5176\u5b83\u4f5c\u4e3astandby\uff09\u3002")),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"TaskManager\uff08worker\uff09\uff1a\u8d1f\u8d23dataflow\u4e2dtask\u7684\u5177\u4f53\u6267\u884c\uff08\u66f4\u5177\u4f53\u5730\u8bf4\u662fsubtask\uff09\u3002TaskManager\u9700\u8981\u8fde\u63a5\u5230JobManager\uff0c\u544a\u8bc9\u5b83\u81ea\u5df1\u662f\u53ef\u7528\u7684\uff0c\u5e76\u7b49\u5f85\u88ab\u5206\u914d\u4efb\u52a1\u3002\u5728\u5b9e\u9645\u90e8\u7f72\u4e2d\uff0c\u4e5f\u81f3\u5c11\u6709\u4e00\u4e2aTaskManager\u3002"))),Object(i.b)("p",null,"\u5728\u5355\u673a\u4f2a\u5206\u5e03\u6a21\u5f0f\u4e0b\uff0c\u53ea\u6709JobManager\u8fdb\u7a0b\uff0c\u800cTaskManager\u4f1a\u4f5c\u4e3aJobManager\u8fdb\u7a0b\u4e2d\u7684\u4e00\u4e2a\u7ebf\u7a0b\u3002"),Object(i.b)("p",null,"JobManager\u548cTaskManager\u53ef\u4ee5\u76f4\u63a5\u5728\u673a\u5668\u4e0a\u542f\u52a8\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8d44\u6e90\u7ba1\u7406\u6846\u67b6\uff08\u5982YARN\u3001Mesos\uff09\u6765\u7ba1\u7406\u542f\u52a8\u3002"),Object(i.b)("p",null,"Client\u4e0d\u662fFlink\u8fd0\u884c\u65f6\u7684\u7ec4\u6210\u90e8\u5206\uff0c\u88ab\u7528\u4e8e\u5411JobManager\u53d1\u9001Job\uff08\u6b64\u540e\u53ef\u4ee5\u65ad\u5f00\u8fde\u63a5\u6216\u8005\u7b49\u5f85JobManager\u7684\u4efb\u52a1\u6267\u884c\u8fdb\u5ea6\u62a5\u544a\uff09\u3002"),Object(i.b)("p",null,"JobManager\u3001TaskManager\u548cClient\u4e4b\u95f4\u7684\u4ea4\u4e92\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("p",null,Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/yFGn0a.png",alt:"img"}))," "),Object(i.b)("h4",{id:"233-task\u69fd\uff08slot\uff09\u4e0e\u8d44\u6e90"},"2.3.3 Task\u69fd\uff08slot\uff09\u4e0e\u8d44\u6e90"),Object(i.b)("p",null,"\u6bcf\u4e2aTaskManager\u662f\u4e00\u4e2aJVM\u8fdb\u7a0b\uff0c\u4f1a\u5728\u4e0d\u540c\u7684\u7ebf\u7a0b\u4e2d\u6267\u884c\u4e00\u4e2a\u6216\u591a\u4e2aoperator subtask\u3002\u4e3a\u4e86\u63a7\u5236\u5355\u4e2aTaskManager\u6240\u80fd\u63a5\u6536\u7684\u4efb\u52a1\u6570\u91cf\uff0c\u6bcf\u4e2aTaskManager\u4f1a\u5305\u542b\u4e00\u7ec4Task\u69fd\uff08\u81f3\u5c11\u4f1a\u6709\u4e00\u4e2a\uff09\u3002"),Object(i.b)("p",null,"\u4e00\u4e2aTask\u69fd\u8868\u793aTaskManager JVM\u8fdb\u7a0b\u4e2d\u4e00\u7ec4\u56fa\u5b9a\u7684\u8d44\u6e90\uff0c\u53ef\u4ee5\u88ab\u4e00\u4e2a\u6216\u591a\u4e2a\u7ebf\u7a0b\uff08\u6216operator subtask\uff09\u5171\u4eab\u3002"),Object(i.b)("p",null,"\u4f8b\u5982\uff0c\u5bf9\u4e00\u4e2a\u5305\u542b3\u4e2aTask\u69fd\u7684TaskManager\uff0c\u5b83\u4f1a\u628a\u8fdb\u7a0b\u4e2d1/3\u7684\u8d44\u6e90\uff08\u5982\u5185\u5b58\uff09\u5206\u914d\u7ed9\u5404\u4e2a\u69fd\u3002\u4e0d\u540cTask\u69fd\u4e2d\u7684subtask\u4e92\u76f8\u72ec\u7acb\u4e0d\u4f1a\u4e92\u76f8\u4e89\u593a\u8d44\u6e90\uff0c\u4f46\u662f\u4f1a\u5171\u4eabJVM\u4e2d\u7684TCP\u8fde\u63a5\u3001\u5fc3\u8df3\u6d88\u606f\u3002Task\u69fd\u76ee\u524d\u53ea\u662f\u7528\u4e8e\u9694\u79bbTask\u4f7f\u7528\u7684\u5185\u5b58\u3002"),Object(i.b)("p",null,"TaskManager JVM\u4e2doperator subtask\u3001thread\u3001task slot\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a"),Object(i.b)("p",null,"\u4e00\u4e2aTaskManager JVM\u8fdb\u7a0b\u4f1a\u6709\u4e00\u4e2a\u6216\u591a\u4e2aTask Slot\uff08\u4e2a\u6570\u4e00\u822c\u4e0ecpu core\u7684\u4e2a\u6570\u76f8\u7b49\uff09\uff0c\u6bcf\u4e2aTask Slot\u80fd\u5206\u914d\u5230\u8fd9\u4e2aJVM\u4e2d\u7684\u4e00\u90e8\u5206\u8d44\u6e90\uff08\u5185\u5b58\uff09\uff1b\n\u4e00\u4e2aTask Slot\uff08\u4e2d\u7684\u8d44\u6e90\uff09\u53ef\u4ee5\u88ab\u4e00\u4e2a\u6216\u591a\u4e2a\u7ebf\u7a0b\u5171\u4eab\u3002\u4e00\u4e2a\u7ebf\u7a0b\u4e2d\u8fd0\u884c\u4e00\u4e2aoperator subtask\u6216\u94fe\u63a5\u8d77\u6765\u7684\u591a\u4e2aoperator subtask\u3002"),Object(i.b)("p",null,Object(i.b)("img",Object(n.a)({parentName:"p"},{src:"https://img-upic.oss-accelerate.aliyuncs.com/uPic/2020%10/06/Ni2Wd7.png",alt:"img"}))),Object(i.b)("h4",{id:"234-\u72b6\u6001\u5b58\u50a8"},"2.3.4 \u72b6\u6001\u5b58\u50a8"),Object(i.b)("p",null,"\u4e0a\u6587\u8bb2\u5230\uff0cstreaming dataflow\u4e2d\u7684\u4e00\u4e9boperator\uff08\u5982windows\uff09\u662f\u6709\u72b6\u6001\u7684\u3002\u8fd9\u4e9b\u72b6\u6001\uff08\u88ab\u7d22\u5f15\u7684\u952e\u503c\u5bf9\uff09\u4f5c\u4e3acheckpoint\u7684\u4e00\u90e8\u5206\uff0c\u53ef\u4ee5\u5b58\u50a8\u5728\u5185\u5b58/HDFS/RocksDB\u4e2d\uff08\u901a\u8fc7\u914d\u7f6e\u63a7\u5236\uff09\u3002"),Object(i.b)("h4",{id:"235-\u4fdd\u5b58\u70b9\uff08savepoint\uff09"},"2.3.5 \u4fdd\u5b58\u70b9\uff08savepoint\uff09"),Object(i.b)("p",null,"\u4f7f\u7528DataStream API\u7f16\u5199\u7684Flink\u7a0b\u5e8f\u53ef\u4ee5\u4ece\u4efb\u610f\u6307\u5b9a\u7684savepoint\u5f00\u59cb\u6267\u884c\u3002Savepoint\u5141\u8bb8\u4f60\u201c\u51bb\u7ed3\u201dstream\u7684\u5904\u7406\u3001\u66f4\u65b0\u4f60\u7684flink\u7a0b\u5e8f\u751a\u81f3\u4f60\u7684flink\u96c6\u7fa4\uff08\u5982\u5347\u7ea7\u7248\u672c\uff09\uff0c\u7136\u540e\u53ef\u4ee5\u4ecesavepoints\u6062\u590d\u6267\u884c\u3002"),Object(i.b)("p",null,"savepoint\u662f\u624b\u5de5\u89e6\u53d1\u7684checkpoints\uff0c\u4e5f\u4f9d\u8d56checkpointing\u673a\u5236\uff0c\u53ef\u4ee5\u5bf9\u5f53\u524d\u7684\u72b6\u6001\u751f\u6210\u5feb\u7167\u5e76\u4fdd\u5b58\u3002"),Object(i.b)("h3",{id:"24-api\u5e93"},"2.4 API&\u5e93"),Object(i.b)("p",null,"Flink\u7a0b\u5e8f\u4ecesource\u4e2d\u8bfb\u6570\u636e\uff08\u5982file/\u5185\u5b58/kafka topic\uff09\uff0c\u5728\u6570\u636e\u96c6\u4e0a\u5b9e\u73b0\u8f6c\u6362\uff08\u5982filtering/mapping/updating state/joining/grouping/defining windows/aggregating\u7b49\uff09\uff0c\u5e76\u5c06\u5b8c\u6210\u4e00\u7cfb\u5217\u8f6c\u6362\u5904\u7406\u540e\u7684\u6570\u636e\u5199\u5230sink\u4e2d\uff08\u5982file/\u7ec8\u7aef\uff09\u3002\u6211\u4eec\u53ef\u4ee5\u7528DataStream API\u5904\u7406streaming\u6570\u636e\uff0c\u53ef\u4ee5\u7528DataSet API\u5904\u7406batch\u6570\u636e\u3002"),Object(i.b)("p",null,"Flink API\u7684\u57fa\u672c\u6982\u5ff5\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/api_concepts.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/api_concepts.html\u3002")),Object(i.b)("h4",{id:"241-flink\u63d0\u4f9b\u7684api"},"2.4.1 Flink\u63d0\u4f9b\u7684API"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},"DataStream API")),Object(i.b)("p",null,"\u5728data stream\u4e0a\u5b9e\u73b0\u8f6c\u6362\uff0c\u5982filter\u3001update state\u3001define windows\u3001aggregate\u3002DataStream\u4e2d\u7684transformation\u53ef\u4ee5\u5c06\u4e00\u4e2a\u6216\u591a\u4e2aDataStream\u8f6c\u6362\u4e3a\u4e00\u4e2aDataStream\u3002API\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/datastream_api.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/datastream_api.html\u3002")),Object(i.b)("p",null,"\u5e38\u7528\u7684\u8f6c\u6362\u7b97\u5b50\u5305\u62ec\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"map\uff1a\u8f93\u5165\u4e00\u4e2aelement\u4ea7\u751f\u53e6\u4e00\u4e2aelement\uff1b"),Object(i.b)("li",{parentName:"ul"},"flatMap\uff1a\u8f93\u5165\u4e00\u4e2aelement\u4ea7\u751f0\u4e2a\u6216\u591a\u4e2aelement\uff1b"),Object(i.b)("li",{parentName:"ul"},"filter\uff1a\u5bf9\u4e00\u4e2aelement\uff0c\u4ec5\u5f53\u5e03\u5c14\u51fd\u6570\u8fd4\u56detrue\u65f6\u4fdd\u7559\u8fd9\u4e2aelement\uff1b"),Object(i.b)("li",{parentName:"ul"},"keyBy\uff1a\u6309\u7167\u67d0\u4e2a\u6307\u5b9a\u7684key\u7684\u503c\uff0c\u5c06\u4e00\u4e2astream\u5212\u5206\u4e3a\u591a\u4e2a\u4e0d\u76f8\u4ea4\u7684partition\uff0c\u4e00\u4e2apartition\u4e2d\u6240\u6709element\u7684\u8fd9\u4e2akey\u7684\u503c\u76f8\u540c\uff1b"),Object(i.b)("li",{parentName:"ul"},"reduce\uff1a\u5c06\u5f53\u524d\u7684element\u4e0e\u6700\u8fd1\u4e00\u6b21\u751f\u6210\u7684reduced\u503c\u8fdb\u884c\u5408\u5e76\uff0c\u7136\u540e\u6d88\u9664\u8fd9\u4e2aelement\uff08reduce\u4f5c\u7528\u5728\u7ecf\u8fc7keyBy\u7684\u6570\u636e\u6d41\u4e0a\uff09\uff1b"),Object(i.b)("li",{parentName:"ul"},"fold\uff1a\u7c7b\u4f3c\u4e8ereduce\uff0c\u4f46\u5b83\u662f\u5bf9\u6d41\u4e2d\u7684element\u8fdb\u884c\u6298\u53e0\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u805a\u5408\u7b97\u5b50\uff0c\u5305\u62ecmin\u3001minBy\u3001max\u3001maxBy\uff1b"),Object(i.b)("li",{parentName:"ul"},"window\uff1a\u4e00\u4e2a\u6d41\u88abkeyBy\u5212\u5206\u4e3a\u82e5\u5e72\u4e2apartition\u540e\uff0c\u5bf9\u5404partition\u53ef\u4ee5\u6267\u884cwindow\uff0c\u6bd4\u5982\u6536\u96c6\u6700\u8fd15\u5206\u949f\u7684\u6570\u636e\uff1b"),Object(i.b)("li",{parentName:"ul"},"window apply/reduce/fold/\u805a\u5408\uff1a\u5bf9\u4e00\u4e2awindow\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u67d0\u79cd\u5904\u7406\uff1b"),Object(i.b)("li",{parentName:"ul"},"union\uff1a\u5c06\u591a\u4e2a\u6d41\u5408\u5e76\u4e3a\u4e00\u4e2a\u6d41\uff0c\u8fd9\u4e2a\u6d41\u5305\u542b\u8fd9\u4e9b\u6d41\u7684\u6240\u6709element\uff1b")),Object(i.b)("p",null,"\u5bf9\u4e8estream\u7684partition\uff0cFlink\u63d0\u4f9b\u4e86\u81ea\u5b9a\u4e49\u529f\u80fd\u5bf9partition\u8fc7\u7a0b\u8fdb\u884c\u5b9a\u5236\u3002"),Object(i.b)("p",null,"\u6211\u4eec\u53ef\u4ee5\u628a\u4e0d\u540c\u7684\u7b97\u5b50\u94fe\u63a5\u5230\u4e00\u8d77\uff0c\u4f7f\u5f97\u5b83\u4eec\u5728\u4e00\u4e2a\u76f8\u540c\u7684\u7ebf\u7a0b\u4e2d\u8fd0\u884c\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\u8868\u73b0\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cFlink\u4f1a\u5c3d\u53ef\u80fd\u5730\u5c06\u80fd\u94fe\u63a5\u5230\u4e00\u8d77\u7684\u7b97\u5b50\u94fe\u63a5\u5230\u4e00\u8d77\u3002\u4f46\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e8estartNewChain()\u3001disableChaining()\u8fdb\u884c\u5e72\u9884\u3002"),Object(i.b)("p",null," data source\uff1a\u6570\u636e\u6e90\u53ef\u4ee5\u662f\u57fa\u4e8e\u6587\u4ef6\u7684\u3001\u57fa\u4e8esocket\u7684\u3001\u57fa\u4e8e\u96c6\u5408\u7684\uff0c\u5bf9\u4e8e\u8fd9\u4e9b\u7c7b\u578b\u7684\u6570\u636e\u6e90Flink\u90fd\u63d0\u4f9b\u4e86\u63a5\u53e3\u53ef\u4ee5\u76f4\u63a5\u4ece\u6307\u5b9a\u6587\u4ef6\u6216socket\u6216\u96c6\u5408\u8bfb\u5165\u6570\u636e\u6d41\u3002Flink\u4e5f\u652f\u6301\u81ea\u5b9a\u4e49source function\uff0c\u5982\u4ecekafka\u4e2d\u8bfb\u53d6\u6570\u636e\u6d41\u3002Flink\u652f\u6301\u4e3a\u8bfb\u53d6\u7684element\u6253\u4e0a\u65f6\u95f4\u6233\u3002"),Object(i.b)("p",null," data sink\uff1a\u53ef\u4ee5\u5c06\u7ecf\u8fc7\u5404\u79cd\u7b97\u5b50\u5904\u7406\u540e\u7684\u6570\u636e\u6d41\u5199\u5230\u6587\u4ef6\u3001csv\u3001socket\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5199\u5230\u81ea\u5b9a\u4e49\u7684sink\uff08\u5982kafka\uff09\u3002"),Object(i.b)("ol",{start:2},Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"DataSet API"),Object(i.b)("p",{parentName:"li"},"DataSet API\u5728data set\u4e0a\u5b9e\u73b0\u8f6c\u6362\uff0c\u5982filter\u3001map\u3001join\u3001group\u3002"),Object(i.b)("p",{parentName:"li"},"DataSet API\u548cDataStream API\u7c7b\u4f3c\uff08\u5927\u90e8\u5206\u7b97\u5b50\uff09\uff0c\u5c11\u6570\u7279\u6709\u7684\u5982\u4e0b\uff1a"),Object(i.b)("ul",{parentName:"li"},Object(i.b)("li",{parentName:"ul"},"groupBy\uff1a\u7c7b\u4f3c\u4e8eDataStream API\u4e2d\u7684keyBy\uff1b"),Object(i.b)("li",{parentName:"ul"},"dinstinct\uff1a\u8fd4\u56de\u6570\u636e\u96c6\u4e2d\u7684\u6240\u6709\u4e0d\u540c\u5143\u7d20\uff1b"),Object(i.b)("li",{parentName:"ul"},"\u5176\u5b83\uff1b")))),Object(i.b)("p",null,"API\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/batch/index.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/batch/index.html\u3002")),Object(i.b)("ol",{start:3},Object(i.b)("li",{parentName:"ol"},"Table API & SQL")),Object(i.b)("p",null,"Table API\u662f\u4e00\u79cd\u7c7bSQL\u8868\u8fbe\u5f0f\u8bed\u8a00\uff0c\u53ef\u4ee5\u7528\u4e8e\u5173\u7cfb\u6d41\uff08relational stream\uff09\u548cbatch\uff0c\u53ef\u4ee5\u5d4c\u5165\u5230DataStream API\u548cDataSet API\u4e2d\u3002"),Object(i.b)("p",null,"Flink\u7684SQL\u652f\u6301\u662f\u57fa\u4e8eApache Calcite\u5b9e\u73b0\u7684\uff0c\u5176\u4e2dApache Calcite\u5b9e\u73b0\u4e86SQL\u6807\u51c6\u3002"),Object(i.b)("p",null,"Flink\u7684Table API\u548cSQL\u5c1a\u672a\u5b8c\u5168\u5b9e\u73b0\uff0c\u5e76\u975e\u6240\u6709\u7684\u529f\u80fd\u90fd\u80fd\u652f\u6301\uff0c\u8fd8\u5728\u5f00\u53d1\u4e2d\u3002"),Object(i.b)("p",null,"API\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/table/index.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/table/index.html\u3002")),Object(i.b)("h4",{id:"242-flink\u63d0\u4f9b\u7684\u5e93"},"2.4.2 Flink\u63d0\u4f9b\u7684\u5e93"),Object(i.b)("p",null,"\u57fa\u4e8eFlink\u7684\u66f4\u9ad8level\u7684\u5e93\u5305\u62ec\uff1a "),Object(i.b)("p",null,"CEP\uff1a\u4e8b\u4ef6\u5904\u7406\u5e93\u3002\u5b83\u53ef\u4ee5\u5141\u8bb8\u4f60\u5728\u4e00\u4e2a\u65e0\u5c3d\u7684\u6d41\u4e2d\u68c0\u6d4b\u7279\u5b9a\u7684event\uff0c\u4ece\u800c\u5904\u7406\u6d41\u4e2d\u4f60\u7279\u522b\u5173\u6ce8\u7684event\u3002\nGelly\uff1a\u662f\u4e00\u4e2a\u56fe\u8ba1\u7b97\u7528\u7684\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u7ec4\u65b9\u6cd5\u548c\u5de5\u5177\u7528\u4e8e\u7b80\u5316\u56fe\u5206\u6790\u3002\nMachine Learning\uff1aFlink\u793e\u533a\u5728\u63a8\u9001\u5b9e\u73b0\u7684\u4e00\u4e2a\u673a\u5668\u5b66\u4e60\u5e93\uff0c\u5b9e\u73b0\u5e38\u7528\u7684\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\uff0c\u5982SVM\u3001\u591a\u5143\u7ebf\u6027\u56de\u5f52\u3001K\u8fd1\u90bb\u7b49\u3002 "),Object(i.b)("h3",{id:"25-flink\u76d1\u63a7"},"2.5 Flink\u76d1\u63a7"),Object(i.b)("h4",{id:"251-metric\u76d1\u63a7"},"2.5.1 Metric\u76d1\u63a7"),Object(i.b)("p",null,"Flink\u5305\u542b\u4e86\u4e00\u4e2ametric\u7cfb\u7edf\uff0c\u53ef\u91c7\u96c6\u7528\u6237\u8303\u56f4/\u7cfb\u7edf\u8303\u56f4\u7684\u76d1\u63a7\u6307\u6807\u5e76\u8f93\u51fa\u7ed9\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\uff0c\u5982Ganglia/Graphite/StatsD\u7b49\u3002\u91c7\u96c6\u7684\u76d1\u63a7\u6307\u6807\u5305\u62ecCPU\u3001\u5185\u5b58\u3001\u7ebf\u7a0b\u3001\u5783\u573e\u6536\u96c6\u3001\u7c7b\u52a0\u8f7d\u5668\u3001\u7f51\u7edc\u3001\u96c6\u7fa4\u3001\u9ad8\u53ef\u7528\u3001checkpointing\u3001IO\u3001source\u8fde\u63a5\u5668\u7b49\u3002"),Object(i.b)("p",null,"\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u7528\u6237\u51fd\u6570\u4e2d\u8bbf\u95eemetric\u7cfb\u7edf\uff0c\u81ea\u5b9a\u4e49\u5e76\u7edf\u8ba1metric\u3002"),Object(i.b)("p",null,"\u8be6\u60c5\u53ef\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/metrics.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/metrics.html\u3002")),Object(i.b)("h4",{id:"252-checkpoint\u76d1\u63a7"},"2.5.2 Checkpoint\u76d1\u63a7"),Object(i.b)("p",null,"Flink\u63d0\u4f9b\u4e86dashboard\u7528\u4e8e\u76d1\u63a7Job\u7684checkpoint\u3002\u5373\u4f7fJob\u5b8c\u6210\u8fd0\u884c\uff0c\u5bf9\u5e94\u7684checkpoint\u7edf\u8ba1\u6570\u636e\u4ecd\u7136\u662f\u53ef\u4ee5\u67e5\u8be2\u7684\u3002\u8be6\u60c5\u53ef\u4ee5\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/checkpoint_monitoring.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/checkpoint_monitoring.html\u3002")),Object(i.b)("h4",{id:"253-back-pressure\u76d1\u63a7"},"2.5.3 Back Pressure\u76d1\u63a7"),Object(i.b)("p",null,"\u5982\u679c\u4f60\u770b\u5230\u4e00\u4e2atask\u7684\u80cc\u538b\uff08back pressure\uff09\u544a\u8b66\uff0c\u8fd9\u8868\u793a\u8fd9\u4e2atask\u4ea7\u751f\u6570\u636e\u7684\u901f\u5ea6\u8d85\u8fc7\u4e86\u4e0b\u6e38operator\u7684\u6d88\u8d39\u901f\u5ea6\u3002\u6570\u636e\u5728job flow\u4e2d\u662f\u6309\u7167\u4ecesource\u5230sink\u7684\u65b9\u5411\u6d41\u52a8\u7684\uff0c\u800c\u80cc\u538b\u662f\u6cbf\u7740\u76f8\u53cd\u7684\u65b9\u5411\u4f20\u64ad\u3002"),Object(i.b)("p",null,"\u8be6\u60c5\u53ef\u4ee5\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/back_pressure.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/back_pressure.html\u3002")),Object(i.b)("h4",{id:"254-\u76d1\u63a7rest-api"},"2.5.4 \u76d1\u63a7REST API"),Object(i.b)("p",null,"Flink\u57fa\u4e8eNetty\u63d0\u4f9b\u4e86\u4e00\u7ec4\u76d1\u63a7API\u7528\u4e8e\u67e5\u8be2\u6b63\u5728\u8fd0\u884c/\u6700\u8fd1\u5b8c\u6210\u7684Job\u7684\u72b6\u6001\u548c\u7edf\u8ba1\u6570\u636e\uff0c\u8fd9\u4e9bAPI\u7528\u4e8e\u8f93\u51fa\u76d1\u63a7\u6570\u636e\u7ed9Flink\u81ea\u8eab\u7684Dashboard\uff0c\u4f46\u662f\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5f00\u53d1\u5b9a\u5236\u5316\u7684\u76d1\u63a7\u5de5\u5177\u3002"),Object(i.b)("p",null,"\u8be6\u60c5\u53ef\u4ee5\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/rest_api.html%E3%80%82"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/monitoring/rest_api.html\u3002")),Object(i.b)("h2",{id:"\u4e09\u3001job\u5f00\u53d1"},"\u4e09\u3001Job\u5f00\u53d1"),Object(i.b)("p",null,"\u60f3\u4e86\u4e0b\u8fd9\u91cc\u8fd8\u662f\u4e0d\u51c6\u5907\u5199\u6210step-by-step\u7c7b\u7684manual\u4e86\uff0c\u5c31\u53ea\u662f\u7b80\u7565\u5730\u63d0\u4f9b\u4e00\u4e9b\u57fa\u672c\u6b65\u9aa4\u548c\u53c2\u8003\u4ee3\u7801\u53ca\u6587\u6863"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},"\u6839\u636eflink java template\u521b\u5efa\u7a7a\u7684job project")),Object(i.b)("p",null,"cd\u5230\u4f60\u7684\u6307\u5b9a\u76ee\u5f55\uff0c\u6267\u884c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{}),"mvn archetype:generate -DarchetypeGroupId=org.apache.flink -DarchetypeArtifactId=flink-quickstart-java -DarchetypeVersion=1.4.2\n")),Object(i.b)("p",null,"\u6267\u884c\u8fc7\u7a0b\u4e2d\u4f1a\u63d0\u793a\u8ba9\u4f60\u8f93\u5165groupId\u3001artifactId\u3001version\u7b49\uff0c\u6700\u7ec8\u751f\u6210\u4e00\u4e2a\u7a7a\u7684job project\uff0c\u5176\u4e2d\u5305\u542b\u4e24\u4e2aJob\u793a\u4f8b\uff08BatchJob/StreamingJob\uff0c\u53ef\u81ea\u884c\u5220\u9664\uff09\u3002\u4e0a\u8ff0\u7248\u672c\u53f7\u53ef\u4ee5\u9009\u7528\u4efb\u610fflink\u5df2\u53d1\u5e03\u7248\u672c\uff0c\u6700\u65b0\u7248\u672c\u53f7\u662f1.5.0\u3002"),Object(i.b)("p",null,"\u901a\u8fc7\u6a21\u677f\u751f\u6210project\uff0c\u53ef\u4ee5\u7701\u53bb\u7e41\u7410\u7684maven pom\u914d\u7f6e\u5de5\u4f5c\u3002"),Object(i.b)("p",null,"\u53c2\u8003\uff1a"),Object(i.b)("p",null,"[1]"," ",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/quickstart/java_api_quickstart.html"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/quickstart/java_api_quickstart.html")),Object(i.b)("p",null,"[2]"," ",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/start/dependencies.html"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/start/dependencies.html")),Object(i.b)("ol",{start:2},Object(i.b)("li",{parentName:"ol"},"Job\u5f00\u53d1\u4e0e\u6253\u5305")),Object(i.b)("p",null,"\u4f7f\u7528\u4e00\u4e2a\u8d81\u624b\u7684IDE\uff08\u5982IDEA\uff09\uff0c\u5c06\u4e0a\u8ff0\u9879\u76ee\u5bfc\u5165\u5230IDE\u4e2d\u5373\u53ef\u5f00\u59cb\u7f16\u7801\u3002Flink\u5728\u5176\u6e90\u7801\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2amaven\u5206\u5305flink-examples\uff0c\u5185\u542b\u6279\u5904\u7406job\u548c\u6d41\u5904\u7406job\u793a\u4f8b\uff0c\u53ef\u53c2\u8003\u7f16\u5199\u3002"),Object(i.b)("p",null,"Flink Job\u5f00\u53d1\u7684\u4e00\u4e9btips\uff1a",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/best_practices.html"}),"https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/best_practices.html")),Object(i.b)("p",null,"\u5b8c\u6210\u5f00\u53d1\u540e\u6267\u884cmvn clean package\u5373\u53ef\u7f16\u8bd1\u6253\u5305\uff0c\u4f60\u7684job\u4ee5\u53ca\u4f9d\u8d56\u7684flink connector\u3001library\uff08\u5982CEP/SQL/ML\u7b49\uff09\u4f1a\u88ab\u96c6\u6210\u5230jar\u5305\u4e2d\uff0c\u800cflink core\u76f8\u5173\u7684jar\u5305\u4e0d\u4f1a\u88ab\u653e\u8fdb\u53bb\u3002"),Object(i.b)("ol",{start:3},Object(i.b)("li",{parentName:"ol"},"\u63d0\u4ea4\u8fd0\u884c")),Object(i.b)("p",null,"\u5c06Job jar\u5305\u901a\u8fc7flink\u63d0\u4f9b\u7684CLI\u5de5\u5177\u63d0\u4ea4\u5230Flink\u96c6\u7fa4\u8fd0\u884c\u3002\u6267\u884c\u547d\u4ee4\u793a\u4f8b\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{}),"./bin/flink run examples/streaming/SocketWindowWordCount.jar --port 9000\n")),Object(i.b)("p",null,"\u5176\u4e2d\uff0cSocketWindowWordCount.jar\u662f\u4f60\u5f00\u53d1\u6253\u5305\u751f\u6210\u7684jar\u5305\uff0c--port 9000\u662f\u8fd9\u4e2ajob\u81ea\u5b9a\u4e49\u7684\u53c2\u6570\u3002"),Object(i.b)("p",null,"CLI\u5de5\u5177\u53c2\u8003\uff1a",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-master/ops/cli.html"}),"https://ci.apache.org/projects/flink/flink-docs-master/ops/cli.html")),Object(i.b)("h2",{id:"\u56db\u3001flink\u6e90\u7801\u7814\u8bfb\u51c6\u5907"},"\u56db\u3001Flink\u6e90\u7801\u7814\u8bfb\u51c6\u5907"),Object(i.b)("h3",{id:"41-\u811a\u672c\u5206\u6790"},"4.1 \u811a\u672c\u5206\u6790"),Object(i.b)("p",null,"Flink\u63d0\u4f9b\u4e86\u7cfb\u5217shell\u811a\u672c\u7528\u4e8eflink\u96c6\u7fa4\u7ba1\u7406\u3001job\u63d0\u4ea4\u7b49\uff0c\u901a\u8fc7\u5206\u6790\u8fd9\u4e9b\u811a\u672c\u627e\u5230\u81ea\u5df1\u6240\u5173\u5fc3\u7684\u6838\u5fc3\u94fe\u8def\u5165\u53e3\u662f\u6bd4\u8f83\u5408\u9002\u7684\u3002"),Object(i.b)("h4",{id:"411-\u542f\u52a8\u811a\u672c"},"4.1.1 \u542f\u52a8\u811a\u672c"),Object(i.b)("p",null,"Flink\u63d0\u4f9b\u4e86\u4e24\u4e2a\u542f\u52a8\u811a\u672c\uff1abin/start-local.sh\u7528\u4e8e\u542f\u52a8\u5355\u673a\u6a21\u5f0f\u7684Flink\uff1bbin/start-cluster.sh\u7528\u4e8e\u542f\u52a8\u96c6\u7fa4\u6a21\u5f0f\u7684Flink\u3002"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},"start-local.sh")),Object(i.b)("p",null,"\u89e3\u6790\u63d0\u53d6",Object(i.b)("inlineCode",{parentName:"p"},"flink-yaml.xml"),"\u4e2d\u7684\u914d\u7f6e\u9879\uff0c\u5404\u914d\u7f6e\u9879\u7684\u542b\u4e49\u53ef\u53c2\u8003",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-master/ops/config.html"}),"config.html"),"\u3002\u4ee5daemon\u6a21\u5f0f\u542f\u52a8jobmanager\u8fdb\u7a0b\uff08\u5e76\u5206\u51fa\u4e00\u4e2a\u7ebf\u7a0b\u542f\u52a8taskmanager\uff09\u3002"),Object(i.b)("ol",{start:2},Object(i.b)("li",{parentName:"ol"},"start-cluster.sh")),Object(i.b)("p",null,"\u89e3\u6790\u63d0\u53d6",Object(i.b)("inlineCode",{parentName:"p"},"flink-yaml.xml"),"\u4e2d\u7684\u914d\u7f6e\u9879\u3002\u901a\u8fc7ssh\u8fdc\u7a0b\u542f\u52a8\u5404master\u673a\u5668\u4e0a\u7684jobmaster\u8fdb\u7a0b\uff08\u9700\u8981\u5728",Object(i.b)("inlineCode",{parentName:"p"},"conf/masters"),"\u4e2d\u914d\u7f6emaster\u673a\u5668\u7684ip\u5730\u5740\uff0c\u9ed8\u8ba4\u662flocalhost:8081\uff09\u3002\u542f\u52a8taskmanager\u8fdb\u7a0b\uff08\u9700\u8981\u5728",Object(i.b)("inlineCode",{parentName:"p"},"conf/slaves"),"\u914d\u7f6eslave\u673a\u5668\u7684ip\u5730\u5740\uff0c\u901a\u5e38\u662flocalhost\uff09\u3002\n\u7531",Object(i.b)("inlineCode",{parentName:"p"},"flink-daemon.sh"),"\u53ef\u77e5\uff0cFlink\u4e2d\u5404\u4e3b\u8981\u8fdb\u7a0b\u7684\u5165\u53e3\u5bf9\u5e94\u5173\u7cfb\u5982\u4e0b\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"jobmanager -> org.apache.flink.runtime.jobmanager.JobManager"),Object(i.b)("li",{parentName:"ul"},"taskmanager -> org.apache.flink.runtime.taskmanager.TaskManager"),Object(i.b)("li",{parentName:"ul"},"\u5185\u7f6ezookeeper -> org.apache.flink.runtime.zookeeper.FlinkZooKeeperQuorumPeer"),Object(i.b)("li",{parentName:"ul"},"historyserver -> org.apache.flink.runtime.webmonitor.history.HistoryServer")),Object(i.b)("h4",{id:"412-cli\u811a\u672c"},"4.1.2 CLI\u811a\u672c"),Object(i.b)("p",null,"Flink\u63d0\u4f9b\u7684CLI\u811a\u672c\u662f",Object(i.b)("inlineCode",{parentName:"p"},"bin/flink"),"\uff0c\u53ef\u4ee5\u901a\u8fc7\u8be5\u811a\u672c\u63d0\u4ea4Job\u3001\u521b\u5efaSavepoint\u7b49\u3002"),Object(i.b)("p",null,"\u811a\u672c\u7684\u4e3b\u8981\u6d41\u7a0b\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u89e3\u6790\u63d0\u53d6",Object(i.b)("inlineCode",{parentName:"li"},"flink-yaml.xml"),"\u4e2d\u7684\u914d\u7f6e\u9879\u3002"),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7Client\u5165\u53e3",Object(i.b)("inlineCode",{parentName:"li"},"org.apache.flink.client.CliFrontend"),"\u8fde\u63a5\u5230JobManager\u5e76\u53d1\u9001\u6d88\u606f\u3002")),Object(i.b)("h3",{id:"42-\u6e90\u7801debug\u65b9\u6cd5"},"4.2 \u6e90\u7801debug\u65b9\u6cd5"),Object(i.b)("p",null,"Flink\u662f\u5f00\u6e90\u7684\uff0c\u4ee3\u7801\u6258\u7ba1\u5728Github\u4e0a\uff0c\u53ef\u4ee5\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u7248\u672c\u5c06Flink\u6e90\u7801clone\u4e0b\u6765\u3002\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4eceFlink\u5b98\u7f51\u4e0a\u4e0b\u8f7d\u4e0b\u6765\uff0c\u94fe\u63a5",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"http://flink.apache.org/downloads.html#source%E3%80%82Flink%E6%BA%90%E7%A0%81%E7%9A%84%E7%BB%84%E6%88%90%E7%BB%93%E6%9E%84%E6%B8%85%E6%99%B0%E6%98%8E%E4%BA%86%EF%BC%8C%E6%AF%8F%E4%B8%AA%E5%88%86%E5%8C%85%E7%9A%84%E5%8A%9F%E8%83%BD%E8%A7%81%E5%90%8D%E7%9F%A5%E6%84%8F%E3%80%82"}),"http://flink.apache.org/downloads.html#source\u3002Flink\u6e90\u7801\u7684\u7ec4\u6210\u7ed3\u6784\u6e05\u6670\u660e\u4e86\uff0c\u6bcf\u4e2a\u5206\u5305\u7684\u529f\u80fd\u89c1\u540d\u77e5\u610f\u3002")),Object(i.b)("p",null,"\u7f16\u8bd1\u6e90\u7801\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{}),"mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true\n")),Object(i.b)("p",null,"\u53c2\u8003\uff1a",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://ci.apache.org/projects/flink/flink-docs-master/start/building.html"}),"https://ci.apache.org/projects/flink/flink-docs-master/start/building.html")),Object(i.b)("p",null,"\u5c06\u6e90\u7801\u5bfc\u5165\u5230IDE\u4e2d\uff08\u5982IDEA\uff09\uff0c\u672c\u5730debug\u57fa\u672c\u65b9\u6cd5\u5982\u4e0b\uff1a"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"\u5728jvm\u542f\u52a8\u53c2\u6570\u4e2d\u6dfb\u52a0\u8fdc\u7a0b\u8c03\u8bd5\u53c2\u6570"),Object(i.b)("ol",{parentName:"li"},Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"\u5982\u679c\u662f\u8c03\u8bd5Client\uff0c\u53ef\u4ee5\u5c06\u4e0a\u8ff0\u53c2\u6570\u52a0\u5230bin/flink\u811a\u672c\u7684\u6700\u540e\u4e00\u884c\u4e2d\uff0c\u5f62\u5982\uff1a"),Object(i.b)("pre",{parentName:"li"},Object(i.b)("code",Object(n.a)({parentName:"pre"},{}),'JVM_REMOTE_DEBUG_ARGS=\'-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005\'\nexec $JAVA_RUN $JVM_ARGS $JVM_REMOTE_DEBUG_ARGS "${log_setting[@]}" -classpath "`manglePathList "$CC_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.client.CliFrontend "$@"\n'))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"\u5982\u679c\u662f\u8c03\u8bd5JobManager\u6216TaskManager\uff0c\u53ef\u4ee5\u5728",Object(i.b)("inlineCode",{parentName:"p"},"conf/flink-conf.yaml"),"\u4e2d\u6dfb\u52a0\uff1a"),Object(i.b)("pre",{parentName:"li"},Object(i.b)("code",Object(n.a)({parentName:"pre"},{}),"env.java.opts: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006\n"))))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"\u542f\u52a8flink client\u6216jobmanager\u6216taskmanager\uff0c\u6b64\u65f6\u7a0b\u5e8f\u4f1asuspend\u7b49\u5f85debuger\u8fde\u63a5\uff08\u901a\u8fc7suspend=y\u6765\u914d\u7f6e\uff09\u3002")),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"\u914d\u7f6eIDEA\u4e2d\u7684remote\uff1ahost\u914d\u7f6e\u4e3alocalhost\uff0c\u914d\u7f6eport\uff08\u53c2\u80031\u4e2d\u7684\u914d\u7f6e\u7684address\u7aef\u53e3\uff09\u3002")),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"\u5728Flink\u6e90\u7801\u4e2d\u8bbe\u7f6e\u65ad\u70b9\uff0c\u8fde\u63a5\u8fdc\u7a0bhost\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u5f00\u59cbdebug\u8ddf\u8e2a\u4e86\u3002"))))}o.isMDXComponent=!0}}]);