《刘岩- Apache Atlas遇上Apache Flink.pdf》由会员分享,可在线阅读,更多相关《刘岩- Apache Atlas遇上Apache Flink.pdf(27页珍藏版)》请在三个皮匠报告上搜索。
1、刘岩/Cloudera Solution EngApacheApache AtlasAtlas MeetsMeets ApacheApache FlinkFlink为什么 Flink 需要对接血缘系统#1#1什么是 Apache Atlas#2#2对接技术实现及未来#3#3目录为什么 Flink 需要对接血缘系统#1#1Flink的三大应用场景Data PipelineAnalyticEvent Driven ApplicationClickstreamApplication DBService LogSTGODSDWDMReportAD-HocService Log离线数仓的基本流程和问题最
2、大延迟=T+N 天 where N=1数仓的实时加工链路 STG-ODSFLINK实时源修订源晚到数据异常数据?修订任务FLINKFLINK正常数据正常修订数据?修订任务?补数修复任务目标表数仓的实时加工链路 ODS-DWFLINK实时源修订源晚到数据异常数据?修订任务FLINKFLINK正常数据正常修订数据?修订任务?补数修复任务目标表UpsertKafkaFLINKDim Update TopicTransactionTopicDimHive TableDim Upsert TopicEnrichedTransWindow Sum1Window Sum2Window Sum3FlinkSQ
3、L 1FlinkSQL 2FlinkSQL 3FlinkSQL 4FlinkSQL 5FlinkSQL 6Batch Source 实时分析/事件驱动为什么需要血缘管理和检索无法追踪Source/Sink的上游或下游全景链路什么是 Apache Atlas#2#2Apache Atlas 核心功能#1 元数据检索Atlas 提供了对元数据进行了全量的收集,并支持多种元数据查询或检索方式Apache Atlas 核心功能#2 元数据标签Atlas 提供了对元数据进行打标签的功能,并且可以通过标签进行反向查找反向查找Apache Atlas 核心功能#3 血缘管理Atlas 提供了对纳管的数据资产
4、进行交互式血缘分析交互式血缘分析和管理的能力Apache Atlas 技术架构#1 元数据捕获Atlas 通过插件(Hook)的方式在服务段注入捕获代码,并将元数据提交至KafkaApache Atlas 技术架构#2 元数据写入Atlas服务从Kafka中消费元数据信息,并将元数据写入到JanusGraph(on HBase)和 Solr两个系统Apache Atlas 技术架构#3 元数据查询Atlas 通过其他应用通过RestAPI方式向其他第三方服务提供元数据查询和检索的服务对接技术实现及未来#3#3如何将两个系统打通ATLAS-3812-Add Apache Flink entity
5、 definitionFLINK-6757-Collect flink application metadata with Atlas 如何将两个系统打通1.在Atlas中定义Flink的相关类型2.在Flink中定义相关的Hook3.抓取Flink Connector的元数据1.在Atlas中定义Flink的相关类型Category:TypeCategorycreateTime:numbercreatedBy:stringdateFormatter:DateFormatDescription:string.subTypes:array of stringsuperTypes:array of
6、 stringcategory:TypeCategorycreateTime:numbercreatedBy:stringdateFormatter:DateFormatdescription:stringguid:stringname:stringclassificationDefsenumDefscategory:TypeCategorycreateTime:numbercreatedBy:stringdateFormatter:DateFormatdescription:stringguid:stringname:stringoptions:map of string.structDef
7、sName:flink_applicationsuperTypes:ProcessserviceType:flinktypeVersion:1.0“name:id,typeName:string,cardinality:SINGLE,isIndexable:true,isOptional:false,isUnique:trueentityDefsendDef1:AtlasRelationshipEndDeendDef2:AtlasRelationshipEndDefpropagateTags:PropagateTagrelationshipLabel:stringrelationshipDef
8、sattributeDefs2.在Flink中定义相关的Hook修改ClusterClientJobClientAdapter修改AbstractJobClusterExecutor修改AbstractSessionClusterExecutor修改LocalExecutor修改FlinkKafkaConsumerBase修改FlinkKafkaConsumer修改FlinkKafkaProducerExpose Kafka connector propertiesExpose Pipeline Class for Executor新建 JobListenerFactory修改StreamEx
9、ecutionEnvironmentMake JobListeners configurable in through flink conf修改StreamingFileSink修改ContinuousFileMonitoringFunctionExpose File source and sink properties3.抓取Flink Connector的元数据List sources=streamGraph.getSourceIDs().stream().map(streamGraph:getStreamNode).collect(Collectors.toList();Get Sour
10、ce List sinks=streamGraph.getSinkIDs().stream().map(streamGraph:getStreamNode).collect(Collectors.toList();Get Sink 最终的效果#1 单个Flink任务单任务的上下游全景链路最终的效果#2 多个Flink任务多任务血缘关系和全景链路传输链路的安全控制FlinkAtlasHook的数据会发送至ATLAS_HOOK 的Topic,这个Topic需要1.1 启用Kerberos1.2 TLS1.3 Apache Ranger授权当前实现的不足之处和后续改进1.Hook段代码获取元数据的侵入性太大2.支持的Flink Source/Sink 不完整