当前位置:   article > 正文

8、NIFI综合应用场景-NiFi监控MySQL binlog进行实时同步到hive

nifi综合应用场景-nifi监控mysql binlog进行实时同步到hive

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的数据同步



本文旨在介绍通过实时监控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>
            <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>
            <selectedRelationships>retry</selectedRelationships>
            <source>
                <groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
                <id>f3510126-b3a9-3ef8-0000-000000000000</id>
                <type>PROCESSOR</type>
            </source>
            <zIndex>0</zIndex>
        </connections>
        <connections>
            <id>e238c257-c5ca-32eb-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>d069d5bb-0e44-3aed-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>update</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>eb46aaa0-f073-3cd1-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>41f509e4-9f75-3c4d-0000-000000000000</id>
                <type>PROCESSOR</type>
            </source>
            <zIndex>0</zIndex>
        </connections>
        <connections>
            <id>f755b13f-2d28-37c2-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>407717a9-fefe-3fe3-0000-000000000000</id>
                <type>PROCESSOR</type>
            </source>
            <zIndex>0</zIndex>
        </connections>
        <connections>
            <id>fb7797c7-aa5e-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>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>
            <selectedRelationships>unmatched</selectedRelationships>
            <source>
                <groupId>cc71fffc-d0fd-3a74-0000-000000000000</groupId>
                <id>877cd3d6-0995-358a-0000-000000000000</id>
                <type>PROCESSOR</type>
            </source>
            <zIndex>0</zIndex>
        </connections>
        <controllerServices>
            <id>83f7fb9e-5a36-305c-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <bundle>
                <artifact>nifi-hive-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <comments></comments>
            <descriptors>
                <entry>
                    <key>hive-db-connect-url</key>
                    <value>
                        <name>hive-db-connect-url</name>
                    </value>
                </entry>
                <entry>
                    <key>hive-config-resources</key>
                    <value>
                        <name>hive-config-resources</name>
                    </value>
                </entry>
                <entry>
                    <key>hive-db-user</key>
                    <value>
                        <name>hive-db-user</name>
                    </value>
                </entry>
                <entry>
                    <key>hive-db-password</key>
                    <value>
                        <name>hive-db-password</name>
                    </value>
                </entry>
                <entry>
                    <key>hive-max-wait-time</key>
                    <value>
                        <name>hive-max-wait-time</name>
                    </value>
                </entry>
                <entry>
                    <key>hive-max-total-connections</key>
                    <value>
                        <name>hive-max-total-connections</name>
                    </value>
                </entry>
                <entry>
                    <key>Validation-query</key>
                    <value>
                        <name>Validation-query</name>
                    </value>
                </entry>
                <entry>
                    <key>kerberos-credentials-service</key>
                    <value>
                        <identifiesControllerService>org.apache.nifi.kerberos.KerberosCredentialsService</identifiesControllerService>
                        <name>kerberos-credentials-service</name>
                    </value>
                </entry>
                <entry>
                    <key>Kerberos Principal</key>
                    <value>
                        <name>Kerberos Principal</name>
                    </value>
                </entry>
                <entry>
                    <key>Kerberos Keytab</key>
                    <value>
                        <name>Kerberos Keytab</name>
                    </value>
                </entry>
            </descriptors>
            <name>HiveConnectionPool</name>
            <persistsState>false</persistsState>
            <properties>
                <entry>
                    <key>hive-db-connect-url</key>
                    <value>jdbc:hive2://server4:10000</value>
                </entry>
                <entry>
                    <key>hive-config-resources</key>
                    <value>/usr/local/bigdata/testdata/hdfs-site.xml,/usr/local/bigdata/testdata/core-site.xml,/usr/local/bigdata/testdata/hive-site.xml</value>
                </entry>
                <entry>
                    <key>hive-db-user</key>
                    <value>alanchan</value>
                </entry>
                <entry>
                    <key>hive-db-password</key>
                </entry>
                <entry>
                    <key>hive-max-wait-time</key>
                    <value>500 millis</value>
                </entry>
                <entry>
                    <key>hive-max-total-connections</key>
                    <value>8</value>
                </entry>
                <entry>
                    <key>Validation-query</key>
                </entry>
                <entry>
                    <key>kerberos-credentials-service</key>
                </entry>
                <entry>
                    <key>Kerberos Principal</key>
                </entry>
                <entry>
                    <key>Kerberos Keytab</key>
                </entry>
            </properties>
            <state>ENABLED</state>
            <type>org.apache.nifi.dbcp.hive.HiveConnectionPool</type>
        </controllerServices>
        <controllerServices>
            <id>f8602325-c430-3690-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <bundle>
                <artifact>nifi-distributed-cache-services-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <comments></comments>
            <descriptors>
                <entry>
                    <key>Server Hostname</key>
                    <value>
                        <name>Server Hostname</name>
                    </value>
                </entry>
                <entry>
                    <key>Server Port</key>
                    <value>
                        <name>Server Port</name>
                    </value>
                </entry>
                <entry>
                    <key>SSL Context Service</key>
                    <value>
                        <identifiesControllerService>org.apache.nifi.ssl.SSLContextService</identifiesControllerService>
                        <name>SSL Context Service</name>
                    </value>
                </entry>
                <entry>
                    <key>Communications Timeout</key>
                    <value>
                        <name>Communications Timeout</name>
                    </value>
                </entry>
            </descriptors>
            <name>DistributedMapCacheClientService</name>
            <persistsState>false</persistsState>
            <properties>
                <entry>
                    <key>Server Hostname</key>
                    <value>server1</value>
                </entry>
                <entry>
                    <key>Server Port</key>
                    <value>4557</value>
                </entry>
                <entry>
                    <key>SSL Context Service</key>
                </entry>
                <entry>
                    <key>Communications Timeout</key>
                    <value>30 secs</value>
                </entry>
            </properties>
            <state>ENABLED</state>
            <type>org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService</type>
        </controllerServices>
        <processors>
            <id>227f5c84-8d6b-320e-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>2.570618773470528</x>
                <y>551.1887534671108</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Destination</key>
                        <value>
                            <name>Destination</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Return Type</key>
                        <value>
                            <name>Return Type</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Path Not Found Behavior</key>
                        <value>
                            <name>Path Not Found Behavior</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Null Value Representation</key>
                        <value>
                            <name>Null Value Representation</name>
                        </value>
                    </entry>
                    <entry>
                        <key>content_id</key>
                        <value>
                            <name>content_id</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Destination</key>
                        <value>flowfile-attribute</value>
                    </entry>
                    <entry>
                        <key>Return Type</key>
                        <value>auto-detect</value>
                    </entry>
                    <entry>
                        <key>Path Not Found Behavior</key>
                        <value>ignore</value>
                    </entry>
                    <entry>
                        <key>Null Value Representation</key>
                        <value>empty string</value>
                    </entry>
                    <entry>
                        <key>content_id</key>
                        <value>$.columns[0].value</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>EvaluateJsonPath_delete</name>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>matched</name>
            </relationships>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>unmatched</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.EvaluateJsonPath</type>
        </processors>
        <processors>
            <id>2e7030a3-7059-3df9-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>936.336601121247</x>
                <y>827.0900163650513</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Regular Expression</key>
                        <value>
                            <name>Regular Expression</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Replacement Value</key>
                        <value>
                            <name>Replacement Value</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Character Set</key>
                        <value>
                            <name>Character Set</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Maximum Buffer Size</key>
                        <value>
                            <name>Maximum Buffer Size</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Replacement Strategy</key>
                        <value>
                            <name>Replacement Strategy</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Evaluation Mode</key>
                        <value>
                            <name>Evaluation Mode</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Regular Expression</key>
                        <value>(?s)(^.*$)</value>
                    </entry>
                    <entry>
                        <key>Replacement Value</key>
                        <value>insert into test.dms_content_t 
(content_id ,title , publisher ,click_num , picture ,rcmd ,stick  ,page_title ,
page_keyword ,page_descr ,publish_time ,update_time ,create_time ,create_user_id ,modify_time  ,modify_user_id ,status ,type ) 
values(
${content_id},
'${title}',
'${publisher}',
${click_num},
'${picture}',
${rcmd},
${stick},
'${page_title}',
'${page_keyword}',
'${page_descr}',
'${publish_time}',
'${update_time}',
'${create_time}',
${create_user_id},
'${modify_time}',
${modify_user_id},
${status},
${type}
)</value>
                    </entry>
                    <entry>
                        <key>Character Set</key>
                        <value>UTF-8</value>
                    </entry>
                    <entry>
                        <key>Maximum Buffer Size</key>
                        <value>1 MB</value>
                    </entry>
                    <entry>
                        <key>Replacement Strategy</key>
                        <value>Regex Replace</value>
                    </entry>
                    <entry>
                        <key>Evaluation Mode</key>
                        <value>Entire text</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>ReplaceText_insert</name>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>success</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.ReplaceText</type>
        </processors>
        <processors>
            <id>407717a9-fefe-3fe3-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>503.83906293000393</x>
                <y>826.243760585218</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Regular Expression</key>
                        <value>
                            <name>Regular Expression</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Replacement Value</key>
                        <value>
                            <name>Replacement Value</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Character Set</key>
                        <value>
                            <name>Character Set</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Maximum Buffer Size</key>
                        <value>
                            <name>Maximum Buffer Size</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Replacement Strategy</key>
                        <value>
                            <name>Replacement Strategy</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Evaluation Mode</key>
                        <value>
                            <name>Evaluation Mode</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Regular Expression</key>
                        <value>(?s)(^.*$)</value>
                    </entry>
                    <entry>
                        <key>Replacement Value</key>
                        <value>UPDATE test.dms_content_t 
SET 
title = '${title}', 
publisher = '${publisher}' ,
click_num = ${click_num}, 
picture = '${picture}',
rcmd = ${rcmd},
stick  =${stick},
page_title = '${page_title}',
page_keyword = '${page_keyword}',
page_descr = '${page_descr}',
publish_time = '${publish_time}',
update_time = '${update_time}',
create_time = '${create_time}',
create_user_id = ${create_user_id},
modify_time = '${modify_time}',
modify_user_id = ${modify_user_id},
status = ${status},
type = ${type}
WHERE 
content_id = ${content_id}</value>
                    </entry>
                    <entry>
                        <key>Character Set</key>
                        <value>UTF-8</value>
                    </entry>
                    <entry>
                        <key>Maximum Buffer Size</key>
                        <value>1 MB</value>
                    </entry>
                    <entry>
                        <key>Replacement Strategy</key>
                        <value>Regex Replace</value>
                    </entry>
                    <entry>
                        <key>Evaluation Mode</key>
                        <value>Entire text</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>ReplaceText</name>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>success</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.ReplaceText</type>
        </processors>
        <processors>
            <id>41f509e4-9f75-3c4d-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>0.0</x>
                <y>823.6731217176821</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Regular Expression</key>
                        <value>
                            <name>Regular Expression</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Replacement Value</key>
                        <value>
                            <name>Replacement Value</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Character Set</key>
                        <value>
                            <name>Character Set</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Maximum Buffer Size</key>
                        <value>
                            <name>Maximum Buffer Size</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Replacement Strategy</key>
                        <value>
                            <name>Replacement Strategy</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Evaluation Mode</key>
                        <value>
                            <name>Evaluation Mode</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Regular Expression</key>
                        <value>(?s)(^.*$)</value>
                    </entry>
                    <entry>
                        <key>Replacement Value</key>
                        <value>delete from test.dms_content_t where content_id = ${content_id}</value>
                    </entry>
                    <entry>
                        <key>Character Set</key>
                        <value>UTF-8</value>
                    </entry>
                    <entry>
                        <key>Maximum Buffer Size</key>
                        <value>1 MB</value>
                    </entry>
                    <entry>
                        <key>Replacement Strategy</key>
                        <value>Regex Replace</value>
                    </entry>
                    <entry>
                        <key>Evaluation Mode</key>
                        <value>Entire text</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>ReplaceText_delete</name>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>success</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.ReplaceText</type>
        </processors>
        <processors>
            <id>877cd3d6-0995-358a-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>937.5049055646064</x>
                <y>550.9260149002075</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Destination</key>
                        <value>
                            <name>Destination</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Return Type</key>
                        <value>
                            <name>Return Type</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Path Not Found Behavior</key>
                        <value>
                            <name>Path Not Found Behavior</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Null Value Representation</key>
                        <value>
                            <name>Null Value Representation</name>
                        </value>
                    </entry>
                    <entry>
                        <key>click_num</key>
                        <value>
                            <name>click_num</name>
                        </value>
                    </entry>
                    <entry>
                        <key>content</key>
                        <value>
                            <name>content</name>
                        </value>
                    </entry>
                    <entry>
                        <key>content_id</key>
                        <value>
                            <name>content_id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>create_time</key>
                        <value>
                            <name>create_time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>create_user_id</key>
                        <value>
                            <name>create_user_id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>database</key>
                        <value>
                            <name>database</name>
                        </value>
                    </entry>
                    <entry>
                        <key>modify_time</key>
                        <value>
                            <name>modify_time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>modify_user_id</key>
                        <value>
                            <name>modify_user_id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>page_descr</key>
                        <value>
                            <name>page_descr</name>
                        </value>
                    </entry>
                    <entry>
                        <key>page_keyword</key>
                        <value>
                            <name>page_keyword</name>
                        </value>
                    </entry>
                    <entry>
                        <key>page_title</key>
                        <value>
                            <name>page_title</name>
                        </value>
                    </entry>
                    <entry>
                        <key>picture</key>
                        <value>
                            <name>picture</name>
                        </value>
                    </entry>
                    <entry>
                        <key>publish_time</key>
                        <value>
                            <name>publish_time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>publisher</key>
                        <value>
                            <name>publisher</name>
                        </value>
                    </entry>
                    <entry>
                        <key>rcmd</key>
                        <value>
                            <name>rcmd</name>
                        </value>
                    </entry>
                    <entry>
                        <key>status</key>
                        <value>
                            <name>status</name>
                        </value>
                    </entry>
                    <entry>
                        <key>stick</key>
                        <value>
                            <name>stick</name>
                        </value>
                    </entry>
                    <entry>
                        <key>table_name</key>
                        <value>
                            <name>table_name</name>
                        </value>
                    </entry>
                    <entry>
                        <key>title</key>
                        <value>
                            <name>title</name>
                        </value>
                    </entry>
                    <entry>
                        <key>type</key>
                        <value>
                            <name>type</name>
                        </value>
                    </entry>
                    <entry>
                        <key>update_time</key>
                        <value>
                            <name>update_time</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Destination</key>
                        <value>flowfile-attribute</value>
                    </entry>
                    <entry>
                        <key>Return Type</key>
                        <value>auto-detect</value>
                    </entry>
                    <entry>
                        <key>Path Not Found Behavior</key>
                        <value>ignore</value>
                    </entry>
                    <entry>
                        <key>Null Value Representation</key>
                        <value>empty string</value>
                    </entry>
                    <entry>
                        <key>click_num</key>
                        <value>$.columns[3].value</value>
                    </entry>
                    <entry>
                        <key>content</key>
                        <value>$.columns[7].value</value>
                    </entry>
                    <entry>
                        <key>content_id</key>
                        <value>$.columns[0].value</value>
                    </entry>
                    <entry>
                        <key>create_time</key>
                        <value>$.columns[13].value</value>
                    </entry>
                    <entry>
                        <key>create_user_id</key>
                        <value>$.columns[14].value</value>
                    </entry>
                    <entry>
                        <key>database</key>
                        <value>$.database</value>
                    </entry>
                    <entry>
                        <key>modify_time</key>
                        <value>$.columns[15].value</value>
                    </entry>
                    <entry>
                        <key>modify_user_id</key>
                        <value>$.columns[16].value</value>
                    </entry>
                    <entry>
                        <key>page_descr</key>
                        <value>$.columns[10].value</value>
                    </entry>
                    <entry>
                        <key>page_keyword</key>
                        <value>$.columns[9].value</value>
                    </entry>
                    <entry>
                        <key>page_title</key>
                        <value>$.columns[8].value</value>
                    </entry>
                    <entry>
                        <key>picture</key>
                        <value>$.columns[4].value</value>
                    </entry>
                    <entry>
                        <key>publish_time</key>
                        <value>$.columns[11].value</value>
                    </entry>
                    <entry>
                        <key>publisher</key>
                        <value>$.columns[2].value</value>
                    </entry>
                    <entry>
                        <key>rcmd</key>
                        <value>$.columns[5].value</value>
                    </entry>
                    <entry>
                        <key>status</key>
                        <value>$.columns[17].value</value>
                    </entry>
                    <entry>
                        <key>stick</key>
                        <value>$.columns[6].value</value>
                    </entry>
                    <entry>
                        <key>table_name</key>
                        <value>$.table_name</value>
                    </entry>
                    <entry>
                        <key>title</key>
                        <value>$.columns[1].value</value>
                    </entry>
                    <entry>
                        <key>type</key>
                        <value>$.columns[18].value</value>
                    </entry>
                    <entry>
                        <key>update_time</key>
                        <value>$.columns[12].value</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>EvaluateJsonPath_insert</name>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>matched</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>unmatched</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.EvaluateJsonPath</type>
        </processors>
        <processors>
            <id>9217073a-1e76-3aeb-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>498.3604353497626</x>
                <y>0.0</y>
            </position>
            <bundle>
                <artifact>nifi-cdc-mysql-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>capture-change-mysql-hosts</key>
                        <value>
                            <name>capture-change-mysql-hosts</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-driver-class</key>
                        <value>
                            <name>capture-change-mysql-driver-class</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-driver-locations</key>
                        <value>
                            <name>capture-change-mysql-driver-locations</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-username</key>
                        <value>
                            <name>capture-change-mysql-username</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-password</key>
                        <value>
                            <name>capture-change-mysql-password</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-server-id</key>
                        <value>
                            <name>capture-change-mysql-server-id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-db-name-pattern</key>
                        <value>
                            <name>capture-change-mysql-db-name-pattern</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-name-pattern</key>
                        <value>
                            <name>capture-change-mysql-name-pattern</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-max-wait-time</key>
                        <value>
                            <name>capture-change-mysql-max-wait-time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-dist-map-cache-client</key>
                        <value>
                            <identifiesControllerService>org.apache.nifi.distributed.cache.client.DistributedMapCacheClient</identifiesControllerService>
                            <name>capture-change-mysql-dist-map-cache-client</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-retrieve-all-records</key>
                        <value>
                            <name>capture-change-mysql-retrieve-all-records</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-include-begin-commit</key>
                        <value>
                            <name>capture-change-mysql-include-begin-commit</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-include-ddl-events</key>
                        <value>
                            <name>capture-change-mysql-include-ddl-events</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-state-update-interval</key>
                        <value>
                            <name>capture-change-mysql-state-update-interval</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-init-seq-id</key>
                        <value>
                            <name>capture-change-mysql-init-seq-id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-init-binlog-filename</key>
                        <value>
                            <name>capture-change-mysql-init-binlog-filename</name>
                        </value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-init-binlog-position</key>
                        <value>
                            <name>capture-change-mysql-init-binlog-position</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>PRIMARY</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>capture-change-mysql-hosts</key>
                        <value>192.168.10.37:3306</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-driver-class</key>
                        <value>com.mysql.jdbc.Driver</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-driver-locations</key>
                        <value>/usr/local/bigdata/testdata/mysql-connector-java-5.1.44.jar</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-username</key>
                        <value>root</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-password</key>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-server-id</key>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-db-name-pattern</key>
                        <value>smp</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-name-pattern</key>
                        <value>dms_content_t</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-max-wait-time</key>
                        <value>30 seconds</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-dist-map-cache-client</key>
                        <value>f8602325-c430-3690-0000-000000000000</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-retrieve-all-records</key>
                        <value>true</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-include-begin-commit</key>
                        <value>false</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-include-ddl-events</key>
                        <value>false</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-state-update-interval</key>
                        <value>0 seconds</value>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-init-seq-id</key>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-init-binlog-filename</key>
                    </entry>
                    <entry>
                        <key>capture-change-mysql-init-binlog-position</key>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>86400 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>CaptureChangeMySQL</name>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>success</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.cdc.mysql.processors.CaptureChangeMySQL</type>
        </processors>
        <processors>
            <id>ab7d7202-e5c1-3329-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>503.7869490216376</x>
                <y>221.10748767852783</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Routing Strategy</key>
                        <value>
                            <name>Routing Strategy</name>
                        </value>
                    </entry>
                    <entry>
                        <key>delete</key>
                        <value>
                            <name>delete</name>
                        </value>
                    </entry>
                    <entry>
                        <key>insert</key>
                        <value>
                            <name>insert</name>
                        </value>
                    </entry>
                    <entry>
                        <key>update</key>
                        <value>
                            <name>update</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Routing Strategy</key>
                        <value>Route to Property name</value>
                    </entry>
                    <entry>
                        <key>delete</key>
                        <value>${cdc.event.type:equals("delete")}</value>
                    </entry>
                    <entry>
                        <key>insert</key>
                        <value>${cdc.event.type:equals("insert")}</value>
                    </entry>
                    <entry>
                        <key>update</key>
                        <value>${cdc.event.type:equals("update")}</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>RouteOnAttribute</name>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>delete</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>insert</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>unmatched</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>update</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.RouteOnAttribute</type>
        </processors>
        <processors>
            <id>c9ec9f4d-7a7c-3181-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>1644.0293196271064</x>
                <y>667.1878252029419</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Log Level</key>
                        <value>
                            <name>Log Level</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Log Payload</key>
                        <value>
                            <name>Log Payload</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Attributes to Log</key>
                        <value>
                            <name>Attributes to Log</name>
                        </value>
                    </entry>
                    <entry>
                        <key>attributes-to-log-regex</key>
                        <value>
                            <name>attributes-to-log-regex</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Attributes to Ignore</key>
                        <value>
                            <name>Attributes to Ignore</name>
                        </value>
                    </entry>
                    <entry>
                        <key>attributes-to-ignore-regex</key>
                        <value>
                            <name>attributes-to-ignore-regex</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Log prefix</key>
                        <value>
                            <name>Log prefix</name>
                        </value>
                    </entry>
                    <entry>
                        <key>character-set</key>
                        <value>
                            <name>character-set</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Log Level</key>
                        <value>info</value>
                    </entry>
                    <entry>
                        <key>Log Payload</key>
                        <value>false</value>
                    </entry>
                    <entry>
                        <key>Attributes to Log</key>
                    </entry>
                    <entry>
                        <key>attributes-to-log-regex</key>
                        <value>.*</value>
                    </entry>
                    <entry>
                        <key>Attributes to Ignore</key>
                    </entry>
                    <entry>
                        <key>attributes-to-ignore-regex</key>
                    </entry>
                    <entry>
                        <key>Log prefix</key>
                    </entry>
                    <entry>
                        <key>character-set</key>
                        <value>UTF-8</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>LogAttribute</name>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>success</name>
            </relationships>
            <state>RUNNING</state>
            <style/>
            <type>org.apache.nifi.processors.standard.LogAttribute</type>
        </processors>
        <processors>
            <id>d069d5bb-0e44-3aed-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>505.1243669870492</x>
                <y>548.6181273364</y>
            </position>
            <bundle>
                <artifact>nifi-standard-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Destination</key>
                        <value>
                            <name>Destination</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Return Type</key>
                        <value>
                            <name>Return Type</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Path Not Found Behavior</key>
                        <value>
                            <name>Path Not Found Behavior</name>
                        </value>
                    </entry>
                    <entry>
                        <key>Null Value Representation</key>
                        <value>
                            <name>Null Value Representation</name>
                        </value>
                    </entry>
                    <entry>
                        <key>click_num</key>
                        <value>
                            <name>click_num</name>
                        </value>
                    </entry>
                    <entry>
                        <key>content</key>
                        <value>
                            <name>content</name>
                        </value>
                    </entry>
                    <entry>
                        <key>content_id</key>
                        <value>
                            <name>content_id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>create_time</key>
                        <value>
                            <name>create_time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>create_user_id</key>
                        <value>
                            <name>create_user_id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>modify_time</key>
                        <value>
                            <name>modify_time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>modify_user_id</key>
                        <value>
                            <name>modify_user_id</name>
                        </value>
                    </entry>
                    <entry>
                        <key>page_descr</key>
                        <value>
                            <name>page_descr</name>
                        </value>
                    </entry>
                    <entry>
                        <key>page_keyword</key>
                        <value>
                            <name>page_keyword</name>
                        </value>
                    </entry>
                    <entry>
                        <key>page_title</key>
                        <value>
                            <name>page_title</name>
                        </value>
                    </entry>
                    <entry>
                        <key>picture</key>
                        <value>
                            <name>picture</name>
                        </value>
                    </entry>
                    <entry>
                        <key>publish_time</key>
                        <value>
                            <name>publish_time</name>
                        </value>
                    </entry>
                    <entry>
                        <key>publisher</key>
                        <value>
                            <name>publisher</name>
                        </value>
                    </entry>
                    <entry>
                        <key>rcmd</key>
                        <value>
                            <name>rcmd</name>
                        </value>
                    </entry>
                    <entry>
                        <key>status</key>
                        <value>
                            <name>status</name>
                        </value>
                    </entry>
                    <entry>
                        <key>stick</key>
                        <value>
                            <name>stick</name>
                        </value>
                    </entry>
                    <entry>
                        <key>title</key>
                        <value>
                            <name>title</name>
                        </value>
                    </entry>
                    <entry>
                        <key>type</key>
                        <value>
                            <name>type</name>
                        </value>
                    </entry>
                    <entry>
                        <key>update_time</key>
                        <value>
                            <name>update_time</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Destination</key>
                        <value>flowfile-attribute</value>
                    </entry>
                    <entry>
                        <key>Return Type</key>
                        <value>auto-detect</value>
                    </entry>
                    <entry>
                        <key>Path Not Found Behavior</key>
                        <value>ignore</value>
                    </entry>
                    <entry>
                        <key>Null Value Representation</key>
                        <value>empty string</value>
                    </entry>
                    <entry>
                        <key>click_num</key>
                        <value>$.columns[3].value</value>
                    </entry>
                    <entry>
                        <key>content</key>
                        <value>$.columns[7].value</value>
                    </entry>
                    <entry>
                        <key>content_id</key>
                        <value>$.columns[0].value</value>
                    </entry>
                    <entry>
                        <key>create_time</key>
                        <value>$.columns[13].value</value>
                    </entry>
                    <entry>
                        <key>create_user_id</key>
                        <value>$.columns[14].value</value>
                    </entry>
                    <entry>
                        <key>modify_time</key>
                        <value>$.columns[15].value</value>
                    </entry>
                    <entry>
                        <key>modify_user_id</key>
                        <value>$.columns[16].value</value>
                    </entry>
                    <entry>
                        <key>page_descr</key>
                        <value>$.columns[10].value</value>
                    </entry>
                    <entry>
                        <key>page_keyword</key>
                        <value>$.columns[9].value</value>
                    </entry>
                    <entry>
                        <key>page_title</key>
                        <value>$.columns[8].value</value>
                    </entry>
                    <entry>
                        <key>picture</key>
                        <value>$.columns[4].value</value>
                    </entry>
                    <entry>
                        <key>publish_time</key>
                        <value>$.columns[11].value</value>
                    </entry>
                    <entry>
                        <key>publisher</key>
                        <value>$.columns[2].value</value>
                    </entry>
                    <entry>
                        <key>rcmd</key>
                        <value>$.columns[5].value</value>
                    </entry>
                    <entry>
                        <key>status</key>
                        <value>$.columns[17].value</value>
                    </entry>
                    <entry>
                        <key>stick</key>
                        <value>$.columns[6].value</value>
                    </entry>
                    <entry>
                        <key>title</key>
                        <value>$.columns[1].value</value>
                    </entry>
                    <entry>
                        <key>type</key>
                        <value>$.columns[18].value</value>
                    </entry>
                    <entry>
                        <key>update_time</key>
                        <value>$.columns[12].value</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>EvaluateJsonPath_update</name>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>matched</name>
            </relationships>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>unmatched</name>
            </relationships>
            <state>STOPPED</state>
            <style/>
            <type>org.apache.nifi.processors.standard.EvaluateJsonPath</type>
        </processors>
        <processors>
            <id>f3510126-b3a9-3ef8-0000-000000000000</id>
            <parentGroupId>cc71fffc-d0fd-3a74-0000-000000000000</parentGroupId>
            <position>
                <x>508.31115147638445</x>
                <y>1174.3765625631154</y>
            </position>
            <bundle>
                <artifact>nifi-hive-nar</artifact>
                <group>org.apache.nifi</group>
                <version>1.9.2</version>
            </bundle>
            <config>
                <bulletinLevel>WARN</bulletinLevel>
                <comments></comments>
                <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                <descriptors>
                    <entry>
                        <key>Hive Database Connection Pooling Service</key>
                        <value>
                            <identifiesControllerService>org.apache.nifi.dbcp.hive.HiveDBCPService</identifiesControllerService>
                            <name>Hive Database Connection Pooling Service</name>
                        </value>
                    </entry>
                    <entry>
                        <key>hive-batch-size</key>
                        <value>
                            <name>hive-batch-size</name>
                        </value>
                    </entry>
                    <entry>
                        <key>hive-charset</key>
                        <value>
                            <name>hive-charset</name>
                        </value>
                    </entry>
                    <entry>
                        <key>statement-delimiter</key>
                        <value>
                            <name>statement-delimiter</name>
                        </value>
                    </entry>
                    <entry>
                        <key>rollback-on-failure</key>
                        <value>
                            <name>rollback-on-failure</name>
                        </value>
                    </entry>
                </descriptors>
                <executionNode>ALL</executionNode>
                <lossTolerant>false</lossTolerant>
                <penaltyDuration>30 sec</penaltyDuration>
                <properties>
                    <entry>
                        <key>Hive Database Connection Pooling Service</key>
                        <value>83f7fb9e-5a36-305c-0000-000000000000</value>
                    </entry>
                    <entry>
                        <key>hive-batch-size</key>
                        <value>100</value>
                    </entry>
                    <entry>
                        <key>hive-charset</key>
                        <value>UTF-8</value>
                    </entry>
                    <entry>
                        <key>statement-delimiter</key>
                        <value>;</value>
                    </entry>
                    <entry>
                        <key>rollback-on-failure</key>
                        <value>false</value>
                    </entry>
                </properties>
                <runDurationMillis>0</runDurationMillis>
                <schedulingPeriod>0 sec</schedulingPeriod>
                <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                <yieldDuration>1 sec</yieldDuration>
            </config>
            <executionNodeRestricted>false</executionNodeRestricted>
            <name>PutHiveQL</name>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>failure</name>
            </relationships>
            <relationships>
                <autoTerminate>false</autoTerminate>
                <name>retry</name>
            </relationships>
            <relationships>
                <autoTerminate>true</autoTerminate>
                <name>success</name>
            </relationships>
            <state>RUNNING</state>
            <style/>
            <type>org.apache.nifi.processors.hive.PutHiveQL</type>
        </processors>
    </snippet>
    <timestamp>02/16/2023 09:04:16 GMT</timestamp>
</template>

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297
  • 298
  • 299
  • 300
  • 301
  • 302
  • 303
  • 304
  • 305
  • 306
  • 307
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 327
  • 328
  • 329
  • 330
  • 331
  • 332
  • 333
  • 334
  • 335
  • 336
  • 337
  • 338
  • 339
  • 340
  • 341
  • 342
  • 343
  • 344
  • 345
  • 346
  • 347
  • 348
  • 349
  • 350
  • 351
  • 352
  • 353
  • 354
  • 355
  • 356
  • 357
  • 358
  • 359
  • 360
  • 361
  • 362
  • 363
  • 364
  • 365
  • 366
  • 367
  • 368
  • 369
  • 370
  • 371
  • 372
  • 373
  • 374
  • 375
  • 376
  • 377
  • 378
  • 379
  • 380
  • 381
  • 382
  • 383
  • 384
  • 385
  • 386
  • 387
  • 388
  • 389
  • 390
  • 391
  • 392
  • 393
  • 394
  • 395
  • 396
  • 397
  • 398
  • 399
  • 400
  • 401
  • 402
  • 403
  • 404
  • 405
  • 406
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420
  • 421
  • 422
  • 423
  • 424
  • 425
  • 426
  • 427
  • 428
  • 429
  • 430
  • 431
  • 432
  • 433
  • 434
  • 435
  • 436
  • 437
  • 438
  • 439
  • 440
  • 441
  • 442
  • 443
  • 444
  • 445
  • 446
  • 447
  • 448
  • 449
  • 450
  • 451
  • 452
  • 453
  • 454
  • 455
  • 456
  • 457
  • 458
  • 459
  • 460
  • 461
  • 462
  • 463
  • 464
  • 465
  • 466
  • 467
  • 468
  • 469
  • 470
  • 471
  • 472
  • 473
  • 474
  • 475
  • 476
  • 477
  • 478
  • 479
  • 480
  • 481
  • 482
  • 483
  • 484
  • 485
  • 486
  • 487
  • 488
  • 489
  • 490
  • 491
  • 492
  • 493
  • 494
  • 495
  • 496
  • 497
  • 498
  • 499
  • 500
  • 501
  • 502
  • 503
  • 504
  • 505
  • 506
  • 507
  • 508
  • 509
  • 510
  • 511
  • 512
  • 513
  • 514
  • 515
  • 516
  • 517
  • 518
  • 519
  • 520
  • 521
  • 522
  • 523
  • 524
  • 525
  • 526
  • 527
  • 528
  • 529
  • 530
  • 531
  • 532
  • 533
  • 534
  • 535
  • 536
  • 537
  • 538
  • 539
  • 540
  • 541
  • 542
  • 543
  • 544
  • 545
  • 546
  • 547
  • 548
  • 549
  • 550
  • 551
  • 552
  • 553
  • 554
  • 555
  • 556
  • 557
  • 558
  • 559
  • 560
  • 561
  • 562
  • 563
  • 564
  • 565
  • 566
  • 567
  • 568
  • 569
  • 570
  • 571
  • 572
  • 573
  • 574
  • 575
  • 576
  • 577
  • 578
  • 579
  • 580
  • 581
  • 582
  • 583
  • 584
  • 585
  • 586
  • 587
  • 588
  • 589
  • 590
  • 591
  • 592
  • 593
  • 594
  • 595
  • 596
  • 597
  • 598
  • 599
  • 600
  • 601
  • 602
  • 603
  • 604
  • 605
  • 606
  • 607
  • 608
  • 609
  • 610
  • 611
  • 612
  • 613
  • 614
  • 615
  • 616
  • 617
  • 618
  • 619
  • 620
  • 621
  • 622
  • 623
  • 624
  • 625
  • 626
  • 627
  • 628
  • 629
  • 630
  • 631
  • 632
  • 633
  • 634
  • 635
  • 636
  • 637
  • 638
  • 639
  • 640
  • 641
  • 642
  • 643
  • 644
  • 645
  • 646
  • 647
  • 648
  • 649
  • 650
  • 651
  • 652
  • 653
  • 654
  • 655
  • 656
  • 657
  • 658
  • 659
  • 660
  • 661
  • 662
  • 663
  • 664
  • 665
  • 666
  • 667
  • 668
  • 669
  • 670
  • 671
  • 672
  • 673
  • 674
  • 675
  • 676
  • 677
  • 678
  • 679
  • 680
  • 681
  • 682
  • 683
  • 684
  • 685
  • 686
  • 687
  • 688
  • 689
  • 690
  • 691
  • 692
  • 693
  • 694
  • 695
  • 696
  • 697
  • 698
  • 699
  • 700
  • 701
  • 702
  • 703
  • 704
  • 705
  • 706
  • 707
  • 708
  • 709
  • 710
  • 711
  • 712
  • 713
  • 714
  • 715
  • 716
  • 717
  • 718
  • 719
  • 720
  • 721
  • 722
  • 723
  • 724
  • 725
  • 726
  • 727
  • 728
  • 729
  • 730
  • 731
  • 732
  • 733
  • 734
  • 735
  • 736
  • 737
  • 738
  • 739
  • 740
  • 741
  • 742
  • 743
  • 744
  • 745
  • 746
  • 747
  • 748
  • 749
  • 750
  • 751
  • 752
  • 753
  • 754
  • 755
  • 756
  • 757
  • 758
  • 759
  • 760
  • 761
  • 762
  • 763
  • 764
  • 765
  • 766
  • 767
  • 768
  • 769
  • 770
  • 771
  • 772
  • 773
  • 774
  • 775
  • 776
  • 777
  • 778
  • 779
  • 780
  • 781
  • 782
  • 783
  • 784
  • 785
  • 786
  • 787
  • 788
  • 789
  • 790
  • 791
  • 792
  • 793
  • 794
  • 795
  • 796
  • 797
  • 798
  • 799
  • 800
  • 801
  • 802
  • 803
  • 804
  • 805
  • 806
  • 807
  • 808
  • 809
  • 810
  • 811
  • 812
  • 813
  • 814
  • 815
  • 816
  • 817
  • 818
  • 819
  • 820
  • 821
  • 822
  • 823
  • 824
  • 825
  • 826
  • 827
  • 828
  • 829
  • 830
  • 831
  • 832
  • 833
  • 834
  • 835
  • 836
  • 837
  • 838
  • 839
  • 840
  • 841
  • 842
  • 843
  • 844
  • 845
  • 846
  • 847
  • 848
  • 849
  • 850
  • 851
  • 852
  • 853
  • 854
  • 855
  • 856
  • 857
  • 858
  • 859
  • 860
  • 861
  • 862
  • 863
  • 864
  • 865
  • 866
  • 867
  • 868
  • 869
  • 870
  • 871
  • 872
  • 873
  • 874
  • 875
  • 876
  • 877
  • 878
  • 879
  • 880
  • 881
  • 882
  • 883
  • 884
  • 885
  • 886
  • 887
  • 888
  • 889
  • 890
  • 891
  • 892
  • 893
  • 894
  • 895
  • 896
  • 897
  • 898
  • 899
  • 900
  • 901
  • 902
  • 903
  • 904
  • 905
  • 906
  • 907
  • 908
  • 909
  • 910
  • 911
  • 912
  • 913
  • 914
  • 915
  • 916
  • 917
  • 918
  • 919
  • 920
  • 921
  • 922
  • 923
  • 924
  • 925
  • 926
  • 927
  • 928
  • 929
  • 930
  • 931
  • 932
  • 933
  • 934
  • 935
  • 936
  • 937
  • 938
  • 939
  • 940
  • 941
  • 942
  • 943
  • 944
  • 945
  • 946
  • 947
  • 948
  • 949
  • 950
  • 951
  • 952
  • 953
  • 954
  • 955
  • 956
  • 957
  • 958
  • 959
  • 960
  • 961
  • 962
  • 963
  • 964
  • 965
  • 966
  • 967
  • 968
  • 969
  • 970
  • 971
  • 972
  • 973
  • 974
  • 975
  • 976
  • 977
  • 978
  • 979
  • 980
  • 981
  • 982
  • 983
  • 984
  • 985
  • 986
  • 987
  • 988
  • 989
  • 990
  • 991
  • 992
  • 993
  • 994
  • 995
  • 996
  • 997
  • 998
  • 999
  • 1000
  • 1001
  • 1002
  • 1003
  • 1004
  • 1005
  • 1006
  • 1007
  • 1008
  • 1009
  • 1010
  • 1011
  • 1012
  • 1013
  • 1014
  • 1015
  • 1016
  • 1017
  • 1018
  • 1019
  • 1020
  • 1021
  • 1022
  • 1023
  • 1024
  • 1025
  • 1026
  • 1027
  • 1028
  • 1029
  • 1030
  • 1031
  • 1032
  • 1033
  • 1034
  • 1035
  • 1036
  • 1037
  • 1038
  • 1039
  • 1040
  • 1041
  • 1042
  • 1043
  • 1044
  • 1045
  • 1046
  • 1047
  • 1048
  • 1049
  • 1050
  • 1051
  • 1052
  • 1053
  • 1054
  • 1055
  • 1056
  • 1057
  • 1058
  • 1059
  • 1060
  • 1061
  • 1062
  • 1063
  • 1064
  • 1065
  • 1066
  • 1067
  • 1068
  • 1069
  • 1070
  • 1071
  • 1072
  • 1073
  • 1074
  • 1075
  • 1076
  • 1077
  • 1078
  • 1079
  • 1080
  • 1081
  • 1082
  • 1083
  • 1084
  • 1085
  • 1086
  • 1087
  • 1088
  • 1089
  • 1090
  • 1091
  • 1092
  • 1093
  • 1094
  • 1095
  • 1096
  • 1097
  • 1098
  • 1099
  • 1100
  • 1101
  • 1102
  • 1103
  • 1104
  • 1105
  • 1106
  • 1107
  • 1108
  • 1109
  • 1110
  • 1111
  • 1112
  • 1113
  • 1114
  • 1115
  • 1116
  • 1117
  • 1118
  • 1119
  • 1120
  • 1121
  • 1122
  • 1123
  • 1124
  • 1125
  • 1126
  • 1127
  • 1128
  • 1129
  • 1130
  • 1131
  • 1132
  • 1133
  • 1134
  • 1135
  • 1136
  • 1137
  • 1138
  • 1139
  • 1140
  • 1141
  • 1142
  • 1143
  • 1144
  • 1145
  • 1146
  • 1147
  • 1148
  • 1149
  • 1150
  • 1151
  • 1152
  • 1153
  • 1154
  • 1155
  • 1156
  • 1157
  • 1158
  • 1159
  • 1160
  • 1161
  • 1162
  • 1163
  • 1164
  • 1165
  • 1166
  • 1167
  • 1168
  • 1169
  • 1170
  • 1171
  • 1172
  • 1173
  • 1174
  • 1175
  • 1176
  • 1177
  • 1178
  • 1179
  • 1180
  • 1181
  • 1182
  • 1183
  • 1184
  • 1185
  • 1186
  • 1187
  • 1188
  • 1189
  • 1190
  • 1191
  • 1192
  • 1193
  • 1194
  • 1195
  • 1196
  • 1197
  • 1198
  • 1199
  • 1200
  • 1201
  • 1202
  • 1203
  • 1204
  • 1205
  • 1206
  • 1207
  • 1208
  • 1209
  • 1210
  • 1211
  • 1212
  • 1213
  • 1214
  • 1215
  • 1216
  • 1217
  • 1218
  • 1219
  • 1220
  • 1221
  • 1222
  • 1223
  • 1224
  • 1225
  • 1226
  • 1227
  • 1228
  • 1229
  • 1230
  • 1231
  • 1232
  • 1233
  • 1234
  • 1235
  • 1236
  • 1237
  • 1238
  • 1239
  • 1240
  • 1241
  • 1242
  • 1243
  • 1244
  • 1245
  • 1246
  • 1247
  • 1248
  • 1249
  • 1250
  • 1251
  • 1252
  • 1253
  • 1254
  • 1255
  • 1256
  • 1257
  • 1258
  • 1259
  • 1260
  • 1261
  • 1262
  • 1263
  • 1264
  • 1265
  • 1266
  • 1267
  • 1268
  • 1269
  • 1270
  • 1271
  • 1272
  • 1273
  • 1274
  • 1275
  • 1276
  • 1277
  • 1278
  • 1279
  • 1280
  • 1281
  • 1282
  • 1283
  • 1284
  • 1285
  • 1286
  • 1287
  • 1288
  • 1289
  • 1290
  • 1291
  • 1292
  • 1293
  • 1294
  • 1295
  • 1296
  • 1297
  • 1298
  • 1299
  • 1300
  • 1301
  • 1302
  • 1303
  • 1304
  • 1305
  • 1306
  • 1307
  • 1308
  • 1309
  • 1310
  • 1311
  • 1312
  • 1313
  • 1314
  • 1315
  • 1316
  • 1317
  • 1318
  • 1319
  • 1320
  • 1321
  • 1322
  • 1323
  • 1324
  • 1325
  • 1326
  • 1327
  • 1328
  • 1329
  • 1330
  • 1331
  • 1332
  • 1333
  • 1334
  • 1335
  • 1336
  • 1337
  • 1338
  • 1339
  • 1340
  • 1341
  • 1342
  • 1343
  • 1344
  • 1345
  • 1346
  • 1347
  • 1348
  • 1349
  • 1350
  • 1351
  • 1352
  • 1353
  • 1354
  • 1355
  • 1356
  • 1357
  • 1358
  • 1359
  • 1360
  • 1361
  • 1362
  • 1363
  • 1364
  • 1365
  • 1366
  • 1367
  • 1368
  • 1369
  • 1370
  • 1371
  • 1372
  • 1373
  • 1374
  • 1375
  • 1376
  • 1377
  • 1378
  • 1379
  • 1380
  • 1381
  • 1382
  • 1383
  • 1384
  • 1385
  • 1386
  • 1387
  • 1388
  • 1389
  • 1390
  • 1391
  • 1392
  • 1393
  • 1394
  • 1395
  • 1396
  • 1397
  • 1398
  • 1399
  • 1400
  • 1401
  • 1402
  • 1403
  • 1404
  • 1405
  • 1406
  • 1407
  • 1408
  • 1409
  • 1410
  • 1411
  • 1412
  • 1413
  • 1414
  • 1415
  • 1416
  • 1417
  • 1418
  • 1419
  • 1420
  • 1421
  • 1422
  • 1423
  • 1424
  • 1425
  • 1426
  • 1427
  • 1428
  • 1429
  • 1430
  • 1431
  • 1432
  • 1433
  • 1434
  • 1435
  • 1436
  • 1437
  • 1438
  • 1439
  • 1440
  • 1441
  • 1442
  • 1443
  • 1444
  • 1445
  • 1446
  • 1447
  • 1448
  • 1449
  • 1450
  • 1451
  • 1452
  • 1453
  • 1454
  • 1455
  • 1456
  • 1457
  • 1458
  • 1459
  • 1460
  • 1461
  • 1462
  • 1463
  • 1464
  • 1465
  • 1466
  • 1467
  • 1468
  • 1469
  • 1470
  • 1471
  • 1472
  • 1473
  • 1474
  • 1475
  • 1476
  • 1477
  • 1478
  • 1479
  • 1480
  • 1481
  • 1482
  • 1483
  • 1484
  • 1485
  • 1486
  • 1487
  • 1488
  • 1489
  • 1490
  • 1491
  • 1492
  • 1493
  • 1494
  • 1495
  • 1496
  • 1497
  • 1498
  • 1499
  • 1500
  • 1501
  • 1502
  • 1503
  • 1504
  • 1505
  • 1506
  • 1507
  • 1508
  • 1509
  • 1510
  • 1511
  • 1512
  • 1513
  • 1514
  • 1515
  • 1516
  • 1517
  • 1518
  • 1519
  • 1520
  • 1521
  • 1522
  • 1523
  • 1524
  • 1525
  • 1526
  • 1527
  • 1528
  • 1529
  • 1530
  • 1531
  • 1532
  • 1533
  • 1534
  • 1535
  • 1536
  • 1537
  • 1538
  • 1539
  • 1540
  • 1541
  • 1542
  • 1543
  • 1544
  • 1545
  • 1546
  • 1547
  • 1548
  • 1549
  • 1550
  • 1551
  • 1552
  • 1553
  • 1554
  • 1555
  • 1556
  • 1557
  • 1558
  • 1559
  • 1560
  • 1561
  • 1562
  • 1563
  • 1564
  • 1565
  • 1566
  • 1567
  • 1568
  • 1569
  • 1570
  • 1571
  • 1572
  • 1573
  • 1574
  • 1575
  • 1576
  • 1577
  • 1578
  • 1579
  • 1580
  • 1581
  • 1582
  • 1583
  • 1584
  • 1585
  • 1586
  • 1587
  • 1588
  • 1589
  • 1590
  • 1591
  • 1592
  • 1593
  • 1594
  • 1595
  • 1596
  • 1597
  • 1598
  • 1599
  • 1600
  • 1601
  • 1602
  • 1603
  • 1604
  • 1605
  • 1606
  • 1607
  • 1608
  • 1609
  • 1610
  • 1611
  • 1612
  • 1613
  • 1614
  • 1615
  • 1616
  • 1617
  • 1618
  • 1619
  • 1620
  • 1621
  • 1622
  • 1623
  • 1624
  • 1625
  • 1626
  • 1627
  • 1628
  • 1629
  • 1630
  • 1631
  • 1632
  • 1633
  • 1634
  • 1635
  • 1636
  • 1637
  • 1638
  • 1639
  • 1640
  • 1641
  • 1642
  • 1643
  • 1644
  • 1645
  • 1646
  • 1647
  • 1648
  • 1649
  • 1650
  • 1651
  • 1652
  • 1653
  • 1654
  • 1655
  • 1656
  • 1657
  • 1658
  • 1659
  • 1660
  • 1661
  • 1662
  • 1663
  • 1664
  • 1665
  • 1666
  • 1667
  • 1668
  • 1669
  • 1670
  • 1671
  • 1672
  • 1673
  • 1674
  • 1675
  • 1676
  • 1677
  • 1678
  • 1679
  • 1680
  • 1681
  • 1682
  • 1683
  • 1684
  • 1685
  • 1686
  • 1687
  • 1688
  • 1689
  • 1690
  • 1691
  • 1692
  • 1693
  • 1694
  • 1695
  • 1696
  • 1697
  • 1698
  • 1699
  • 1700
  • 1701
  • 1702
  • 1703
  • 1704
  • 1705
  • 1706
  • 1707
  • 1708
  • 1709
  • 1710
  • 1711
  • 1712
  • 1713
  • 1714
  • 1715
  • 1716
  • 1717
  • 1718
  • 1719
  • 1720
  • 1721
  • 1722
  • 1723
  • 1724
  • 1725
  • 1726
  • 1727
  • 1728
  • 1729
  • 1730
  • 1731
  • 1732
  • 1733
  • 1734
  • 1735
  • 1736
  • 1737
  • 1738
  • 1739
  • 1740
  • 1741
  • 1742
  • 1743
  • 1744
  • 1745
  • 1746
  • 1747
  • 1748
  • 1749
  • 1750
  • 1751
  • 1752
  • 1753
  • 1754
  • 1755
  • 1756
  • 1757
  • 1758
  • 1759
  • 1760
  • 1761
  • 1762
  • 1763
  • 1764
  • 1765
  • 1766
  • 1767
  • 1768
  • 1769
  • 1770
  • 1771
  • 1772
  • 1773
  • 1774
  • 1775
  • 1776
  • 1777
  • 1778
  • 1779
  • 1780
  • 1781
  • 1782
  • 1783
  • 1784
  • 1785
  • 1786
  • 1787
  • 1788
  • 1789
  • 1790
  • 1791
  • 1792
  • 1793
  • 1794
  • 1795
  • 1796
  • 1797
  • 1798
  • 1799
  • 1800
  • 1801
  • 1802
  • 1803
  • 1804
  • 1805
  • 1806
  • 1807
  • 1808
  • 1809
  • 1810
  • 1811
  • 1812
  • 1813
  • 1814
  • 1815
  • 1816
  • 1817
  • 1818
  • 1819
  • 1820
  • 1821
  • 1822
  • 1823
  • 1824
  • 1825
  • 1826
  • 1827
  • 1828
  • 1829
  • 1830
  • 1831
  • 1832
  • 1833
  • 1834
  • 1835
  • 1836
  • 1837
  • 1838
  • 1839
  • 1840
  • 1841
  • 1842
  • 1843
  • 1844
  • 1845
  • 1846
  • 1847
  • 1848
  • 1849
  • 1850
  • 1851
  • 1852
  • 1853
  • 1854
  • 1855
  • 1856
  • 1857
  • 1858
  • 1859
  • 1860
  • 1861
  • 1862
  • 1863
  • 1864
  • 1865
  • 1866
  • 1867
  • 1868
  • 1869
  • 1870
  • 1871
  • 1872
  • 1873
  • 1874
  • 1875
  • 1876
  • 1877
  • 1878
  • 1879
  • 1880
  • 1881
  • 1882
  • 1883
  • 1884
  • 1885
  • 1886
  • 1887
  • 1888
  • 1889
  • 1890
  • 1891
  • 1892
  • 1893
  • 1894
  • 1895
  • 1896
  • 1897
  • 1898
  • 1899
  • 1900
  • 1901
  • 1902
  • 1903
  • 1904
  • 1905
  • 1906
  • 1907
  • 1908
  • 1909
  • 1910
  • 1911
  • 1912
  • 1913
  • 1914
  • 1915
  • 1916
  • 1917
  • 1918
  • 1919
  • 1920
  • 1921
  • 1922
  • 1923
  • 1924
  • 1925
  • 1926
  • 1927
  • 1928
  • 1929
  • 1930
  • 1931
  • 1932
  • 1933
  • 1934
  • 1935
  • 1936
  • 1937
  • 1938
  • 1939
  • 1940
  • 1941
  • 1942
  • 1943
  • 1944
  • 1945
  • 1946
  • 1947
  • 1948
  • 1949
  • 1950
  • 1951
  • 1952
  • 1953
  • 1954
  • 1955
  • 1956
  • 1957
  • 1958
  • 1959
  • 1960
  • 1961
  • 1962
  • 1963
  • 1964
  • 1965
  • 1966
  • 1967
  • 1968
  • 1969
  • 1970
  • 1971
  • 1972
  • 1973
  • 1974
  • 1975
  • 1976
  • 1977
  • 1978
  • 1979
  • 1980
  • 1981
  • 1982
  • 1983
  • 1984
  • 1985
  • 1986
  • 1987
  • 1988
  • 1989
  • 1990
  • 1991
  • 1992
  • 1993
  • 1994
  • 1995
  • 1996
  • 1997
  • 1998
  • 1999
  • 2000
  • 2001
  • 2002
  • 2003
  • 2004
  • 2005
  • 2006
  • 2007
  • 2008
  • 2009
  • 2010
  • 2011
  • 2012
  • 2013
  • 2014
  • 2015
  • 2016
  • 2017
  • 2018
  • 2019
  • 2020
  • 2021
  • 2022
  • 2023
  • 2024
  • 2025
  • 2026
  • 2027
  • 2028
  • 2029
  • 2030
  • 2031
  • 2032
  • 2033
  • 2034
  • 2035
  • 2036
  • 2037
  • 2038
  • 2039
  • 2040
  • 2041
  • 2042
  • 2043
  • 2044
  • 2045
  • 2046
  • 2047
  • 2048
  • 2049
  • 2050
  • 2051
  • 2052
  • 2053
  • 2054
  • 2055

2、实现流程

CaptureChangeMySQL ——> RouteOnAttribute ——> EvaluateJsonPath ——> ReplaceText ——> PutHiveQL

3、修改hive配置

使用puthive处理器需要使用的是事务表,存储格式为orc。需要设置hive-site.xml文件中对事务表的支持,具体内容如下:

<!-- 添加事务表控制配置-->
    <property>
        <name>hive.support.concurrency</name>
        <value>true</value>
    </property>
        <property>
        <name>hive.exec.dynamic.partition.mode</name>
        <value>nonstrict</value>
    </property>
        <property>
        <name>hive.txn.manager</name>
        <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>
    </property>
    <property>
        <name>hive.compactor.initiator.on</name>
        <value>true</value>
    </property>
    <property>
        <name>hive.compactor.worker.threads</name>
        <value>1</value>
    </property>
    <property>
        <name>hive.in.test</name>
        <value>true</value>
</property>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

如果不设置,则会出现异常:This command is not allowed on an ACID table test.dms_content_t with a non-ACID transaction manager

4、创建hive表

CREATE TABLE myhive.nifi_hive(id int,name string,day_time string)
clustered by (id) into 2 buckets
STORED AS ORC
TBLPROPERTIES('transactional'='true');
  • 1
  • 2
  • 3
  • 4

二、处理器说明

1、CaptureChangeMySQL

1)、描述

从MySQL数据库检索更改数据捕获(CDC)事件。CDC事件包括INSERT,UPDATE,DELETE操作。事件将作为单独的流文件输出,并按操作发生的时间排序。

2)、属性配置

在下面的列表中,列出属性及其默认值,属性是否支持NiFi表达式语言,以及属性是否被视为“敏感”,这意味着将加密其值。在敏感属性中输入值之前,请确保nifi.properties文件具有属性nifi.sensitive.props.key的条目。
在这里插入图片描述

3)、写入属性

在这里插入图片描述

2、DistributedMapCacheServer

1)、描述

提供可通过套接字访问的映射(键/值)缓存。与该服务的交互通常是通过DistributedMapCacheClient服务完成的。

2)、属性配置

在下面的列表中,列出属性及其默认值
在这里插入图片描述

3、DistributedMapCacheClientService

1)、描述

提供与DistributedMapCacheServer通信的功能。可以使用它来在NiFi群集中的节点之间共享地图

2)、属性配置

在下面的列表中,列出属性及其默认值。
在这里插入图片描述

4、RouteOnAttribute

1)、描述

该处理器使用属性表达式语言,根据流文件的属性去计算然后进行路由。该处理器往往用于判断逻辑。

2)、属性配置

在下面的列表中,列出属性默认值(如果有默认值),以及属性是否支持表达式语言。
在这里插入图片描述

3)、动态属性

该处理器允许用户指定属性的名称和值。
在这里插入图片描述

4)、连接关系

在这里插入图片描述

5)、自定义连接关系

可以根据用户配置处理器的方式创建动态连接关系
在这里插入图片描述

5、PutHiveQL

1)、描述

执行HiveQL DDL / DML命令(例如,UPDATE,INSERT)。预期传入File的内容是要执行的HiveQL命令。HiveQL命令可以使用?转义参数。在这种情况下,要使用的参数必须作为FlowFile属性存在,命名约定为hiveql.args.N.type和hiveql.args.N.value,其中N是一个正整数。hiveql.args.N.type应该是指示JDBC类型的数字。FlowFile的内容应采用UTF-8格式。

2)、属性配置

在下面的列表中,列出属性及其默认值
在这里插入图片描述

6、HiveConnectionPool

1)、描述

为Apache Hive提供数据库连接池服务。可以从池中请求连接,使用后返回连接。

2)、属性配置

在下面的列表中,列出属性及其默认值,属性是否支持NiFi表达式语言
在这里插入图片描述

三、操作

1、开启mysql binlog

1)、查看mysql binlog开启状态

Mysql的版本号要求5.7+。

mysql> show variables like '%log_bin%';
  • 1

在这里插入图片描述

2)、mysql开启binlog

show variables like '%binlog%'  --查看binlog的一些配置信息
show variables like '%log_bin%' --查看到binlog日志为状态
show binary logs;--获取binlog文件列表
show master status;--查看当前正在写入的binlog文件
show binlog events in 'mysqlbin.000102' from 1 limit 0,10;

vi /etc/my.cnf

# 文件末尾加上如下内容:
# server-id :表示单个结点的id,单个节点可以随意写,多个节点不能重复
server_id = 1
# log-bin指定binlog日志文件的名字为mysql-bin,以及其存储路径
log_bin = mysql-bin
binlog_format = row
##只记录哪个db的信息,根据需要进行调整,为空则表示该ip下所有表
binlog_do_db=test


# 重启mysql服务
systemctl restart mysqld.service
# 或
service mysqld restart
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

3)、验证开启情况

如下图表面binlog开启,windows操作系统开启同理。
在这里插入图片描述

2、创建CaptureChangeMySQL并配置

为了验证方便,创建了一个组,即mysql_hive_realtime
CaptureChangeMySQL的配置中需要DistributedMapCacheClientService、DistributedMapCacheServer处理器。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1)、配置DistributedMapCacheServer

在这里插入图片描述

2)、配置DistributedMapCacheClientService

在这里插入图片描述

3)、配置CaptureChangeMySQL处理器

MySQL Hosts = 192.168.10.44:3306
MySQL Driver Class Name = com.mysql.jdbc.Driver
MySQL Driver Location(s) = /usr/local/bigdata/testdata/mysql-connector-java-5.1.44.jar
Username = root
Password = 888888
Include Begin/Commit Events = true
Include DDL Events = true
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

在这里插入图片描述

3、根据条件路由-RouteOnAttribute处理器

RouteOnAttribute多线程消费,根据自己的服务器硬件配置,以及数据的更新速率,进行评估后填写。
在这里插入图片描述
NiFi表达式
NiFi表达式官网:https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

NiFi表达式的equals函数
equals

  • 说明:equals函数使用非常广泛,它确定其主题是否等于另一个String值。请注意,该equals函数直接比较两个String值。注意不要将此函数与matchs函数混淆,后者会根据正则表达式评估其主题。
  • 类型:任意
  • 参数value:用于比较Subject的值。必须与主题类型相同。
  • 返回类型:布尔值
  • 示例:我们可以使用表达式${filename:equals(‘hello.txt’)}检查FlowFile的文件名是否为“ hello.txt” ,或者可以检查属性hello的值是否等于属性的值filename: ${hello:equals( ${filename} )}。
    在这里插入图片描述
    运行并查看输出
    输出的数据内容:
{
    "type": "insert",
    "timestamp": 1582484253000,
    "binlog_filename": "mysql-bin.000005",
    "binlog_position": 375,
    "database": "nifi_test",
    "table_name": "nifi_hive_streaming",
    "table_id": 108,
    "columns": [
        {
            "id": 1,
            "name": "id",
            "column_type": 4,
            "value": 7
        },
        {
            "id": 2,
            "name": "name",
            "column_type": 12,
            "value": "testName5"
        },
        {
            "id": 3,
            "name": "day_time",
            "column_type": 91,
            "value": "2020-02-24"
        }
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29

4、配置EvaluateJsonPath

1)、提取关键属性

​EvaluateJsonPath等处理器在提取数据时,可以使用JsonPath表达式,来灵活的获取信息。
JsonPath表达式

1、简介

类似于XPath在xml文档中的定位,JsonPath表达式通常是用来路径检索或设置Json的。
JsonPath中的“根成员对象”始终称为$,无论是对象还是数组。
其表达式可以接受“dot–notation”和“bracket–notation”格式,例如

$.store.book[0].title
$[‘store’][‘book’][0][‘title’]
# 两种方式等价
  • 1
  • 2
  • 3
2、操作符

在这里插入图片描述

3、函数

可以在JsonPath表达式执行后进行调用,其输入值为表达式的结果
在这里插入图片描述

4、过滤器

过滤器是用于过滤数组的逻辑表达式。

一个通常的表达式形如: [?(@.age > 18)]
可以通过逻辑表达式&&或||组合多个过滤器表达式
例如
[?(@.price < 10 > && @.category == ‘fiction’)]
字符串必须用单引号或双引号包围
[?(@.color == ‘blue’)] > or [?(@.color == “blue”)]

在这里插入图片描述
示例

{
    "store": {
        "book": [
            {
                "category": "reference",
                "author": "Nigel Rees",
                "title": "Sayings of the Century",
                "price": 8.95
            },
            {
                "category": "fiction",
                "author": "Evelyn Waugh",
                "title": "Sword of Honour",
                "price": 12.99
            },
            {
                "category": "fiction",
                "author": "Herman Melville",
                "title": "Moby Dick",
                "isbn": "0-553-21311-3",
                "price": 8.99
            },
            {
                "category": "fiction",
                "author": "J. R. R. Tolkien",
                "title": "The Lord of the Rings",
                "isbn": "0-395-19395-8",
                "price": 22.99
            }
        ],
        "bicycle": {
            "color": "red",
            "price": 19.95
        }
    },
    "expensive": 10
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

在这里插入图片描述

2)、提取Json属性到Attribute

在这里插入图片描述
运行并查看输出
在这里插入图片描述

5、ReplaceText转换Sql

配置ReplaceText
在这里插入图片描述

Replacement Value = insert into myhive.nifi_hive (id,name,day_time) values (${id},'${name}','${day_time}')
  • 1

启动查看结果
在这里插入图片描述

6、写入Hive

1)、创建PutHiveQL

2)、创建配置HiveConnectionPool

在这里插入图片描述

Database Connection URL = jdbc:hive2://192.168.10.44:10000
Hive Configuration Resources = /export/download/config/core-site.xml,/export/download/config/hdfs-site.xml,/export/download/config/hive-site.xml
hive-site.xml文件必须开启事务表配置
  • 1
  • 2
  • 3

配置完成后,记得启用HiveConnectionPool。

3)、PutHiveQL关联HiveConnectionPool

在这里插入图片描述

四、验证

验证Hive表中是否成功写入数据正常即可。
特别需要注意的是hive的配置,创建事务表的语句。
实际用途不广,速度太慢。

以上完成了mysql实时的通过binlog日志和nifi读取其数据写入hive的过程。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/622791
推荐阅读
相关标签
  

闽ICP备14008679号