当我更新xml时,NiFi不会更新模板信息

时间:2018-02-06 04:32:22

标签: templates apache-nifi

我正在尝试将我的Nifi工作从Dev推广到QA,因为我正在使用模板。我知道模板不存储敏感信息(即密码和其他信息),我很好。

但是,即使我更改了XML中的其他值,然后上传模板,它也无法正常工作。

我是否需要重启nifi服务器?或者其他什么东西让tempalte被反映出来?

我想在此模板中更改的唯一内容是队列名称主机名。但是,如果我在XML模板中更改它并上传它,它就无法正常工作。

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
    <description></description>
    <groupId>6893964f-0161-1000-c252-8edd203653e6</groupId>
    <name>template1</name>
    <snippet>
        <processGroups>
            <id>e0bb9818-49e5-3194-0000-000000000000</id>
            <parentGroupId>62dd8ddb-07e2-3459-0000-000000000000</parentGroupId>
            <position>
                <x>0.0</x>
                <y>0.0</y>
            </position>
            <comments></comments>
            <contents>
                <processors>
                    <id>a2cb42ea-5e05-362d-0000-000000000000</id>
                    <parentGroupId>e0bb9818-49e5-3194-0000-000000000000</parentGroupId>
                    <position>
                        <x>414.0</x>
                        <y>174.0</y>
                    </position>
                    <bundle>
                        <artifact>nifi-amqp-nar</artifact>
                        <group>org.apache.nifi</group>
                        <version>1.5.0</version>
                    </bundle>
                    <config>
                        <bulletinLevel>WARN</bulletinLevel>
                        <comments></comments>
                        <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
                        <descriptors>
                            <entry>
                                <key>Queue</key>
                                <value>
                                    <name>Queue</name>
                                </value>
                            </entry>
                            <entry>
                                <key>Host Name</key>
                                <value>
                                    <name>Host Name</name>
                                </value>
                            </entry>
                            <entry>
                                <key>Port</key>
                                <value>
                                    <name>Port</name>
                                </value>
                            </entry>
                            <entry>
                                <key>Virtual Host</key>
                                <value>
                                    <name>Virtual Host</name>
                                </value>
                            </entry>
                            <entry>
                                <key>User Name</key>
                                <value>
                                    <name>User Name</name>
                                </value>
                            </entry>
                            <entry>
                                <key>Password</key>
                                <value>
                                    <name>Password</name>
                                </value>
                            </entry>
                            <entry>
                                <key>AMQP Version</key>
                                <value>
                                    <name>AMQP Version</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>cert-authentication</key>
                                <value>
                                    <name>cert-authentication</name>
                                </value>
                            </entry>
                            <entry>
                                <key>ssl-client-auth</key>
                                <value>
                                    <name>ssl-client-auth</name>
                                </value>
                            </entry>
                        </descriptors>
                        <executionNode>ALL</executionNode>
                        <lossTolerant>false</lossTolerant>
                        <penaltyDuration>30 sec</penaltyDuration>
                        <properties>
                            <entry>
                                <key>Queue</key>
                                <value>testq</value>
                            </entry>
                            <entry>
                                <key>Host Name</key>
                                <value>abcd.com</value>
                            </entry>
                            <entry>
                                <key>Port</key>
                                <value>5672</value>
                            </entry>
                            <entry>
                                <key>Virtual Host</key>
                            </entry>
                            <entry>
                                <key>User Name</key>
                                <value>gshah</value>
                            </entry>
                            <entry>
                                <key>Password</key>
                            </entry>
                            <entry>
                                <key>AMQP Version</key>
                                <value>0.9.1</value>
                            </entry>
                            <entry>
                                <key>ssl-context-service</key>
                            </entry>
                            <entry>
                                <key>cert-authentication</key>
                                <value>false</value>
                            </entry>
                            <entry>
                                <key>ssl-client-auth</key>
                                <value>REQUIRED</value>
                            </entry>
                        </properties>
                        <runDurationMillis>0</runDurationMillis>
                        <schedulingPeriod>0 sec</schedulingPeriod>
                        <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
                        <yieldDuration>1 sec</yieldDuration>
                    </config>
                    <name>ConsumeAMQP</name>
                    <relationships>
                        <autoTerminate>false</autoTerminate>
                        <name>success</name>
                    </relationships>
                    <state>STOPPED</state>
                    <style/>
                    <type>org.apache.nifi.amqp.processors.ConsumeAMQP</type>
                </processors>
            </contents>
            <name>Consumer</name>
            <variables/>
        </processGroups>
    </snippet>
    <timestamp>02/05/2018 23:22:10 EST</timestamp>
</template>

1 个答案:

答案 0 :(得分:0)

您可以使用NiFi Registry,它非常适合您的需求。 另外,我建议您阅读this article,它已经很好地解释了如何部署不同的环境。

  

我将讨论自动部署的方法   使用NiFi在多个环境之间推广工作流程   注册。我将讨论并演示您拥有的两个选项   需要了解:

     

随NiFi Toolkit 1.6.0发布的NiFi CLI   NiPyAPI python库0.8.0