没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
58页
8、NIFI综合应用场景-NiFi监控MySQL binlog进行实时同步到hive 网址:https://blog.csdn.net/chenwewi520feng/article/details/130620988 本文旨在介绍通过实时监控mysql的binlog实现数据的实时同步至hive中。但由于hive执行insert语句的效率较低,一般不会这么使用。 本文的前提是hive、mysql、nifi环境可正常使用。 本文分为四部分,即实现流程、处理器说明、操作与验证。
资源推荐
资源详情
资源评论
Apache NiFi系列文章
1、nifi-1.9.2介绍、单机部署及简单验证
2、NIFI应用示例-GetFile和PutFile应用
3、NIFI处理器介绍、FlowFlie常见属性、模板介绍和运行情况信息查看
4、集群部署及验证、监控及节点管理
5、NiFi FileFlow示例和NIFI模板示例
6、NIFI应用场景-离线同步Mysql数据到HDFS中
7、NIFI综合应用场景-将mysql查询出的json数据转换成txt后存储至HDFS中
8、NIFI综合应用场景-NiFi监控MySQL binlog进行实时同步到hive
9、NIFI综合应用场景-通过NIFI配置kafka的数据同步
@TOC
本文旨在介绍通过实时监控mysql的binlog实现数据的实时同步至hive中。但由于hive执行insert语句的
效率较低,一般不会这么使用。
本文的前提是hive、mysql、nifi环境可正常使用。
本文分为四部分,即实现流程、处理器说明、操作与验证。
一、实现流程
NiFi监控MySQL binlog进行实时同步至hive。
1、模板
含有insert、update、delete
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description></description>
<groupId>4a34a13e-0186-1000-0000-00001568fc6d</groupId>
<name>mysql_to_hive_realtime</name>
<snippet>
<connections>
<id>32407c91-6021-3f17-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>41f509e4-9f75-3c4d-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>matched</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>227f5c84-8d6b-320e-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>41722019-baff-39eb-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>f3510126-b3a9-3ef8-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>success</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>2e7030a3-7059-3df9-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>4757dbca-d994-361c-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>c9ec9f4d-7a7c-3181-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>unmatched</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>ab7d7202-e5c1-3329-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>50567837-8a1d-323a-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>2e7030a3-7059-3df9-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>matched</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>877cd3d6-0995-358a-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>7a9089aa-7109-39f0-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>407717a9-fefe-3fe3-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>matched</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>d069d5bb-0e44-3aed-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>89d7ab4a-6b9a-3b57-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>c9ec9f4d-7a7c-3181-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>failure</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>2e7030a3-7059-3df9-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>9ced34ab-5a13-3440-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>877cd3d6-0995-358a-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name>R_E</name>
<selectedRelationships>insert</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>ab7d7202-e5c1-3329-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>c3c8ef8f-aff4-3b1a-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>227f5c84-8d6b-320e-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>delete</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>ab7d7202-e5c1-3329-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>c4d6b504-fd48-398d-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>ab7d7202-e5c1-3329-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name>C_R</name>
<selectedRelationships>success</selectedRelationships>
<source>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>9217073a-1e76-3aeb-0000-000000000000</id>
<type>PROCESSOR</type>
</source>
<zIndex>1</zIndex>
</connections>
<connections>
<id>d6f466e6-40a6-311d-0000-000000000000</id>
<parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
<id>c9ec9f4d-7a7c-3181-0000-000000000000</id>
<type>PROCESSOR</type>
</destination>
剩余57页未读,继续阅读
资源评论
一瓢一瓢的饮alanchanchn
- 粉丝: 2827
- 资源: 69
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功