NIFI列表文件如何维护其时间戳? [英] how does NIFI listfile maintains its timestamp?

查看:151
本文介绍了NIFI列表文件如何维护其时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用NiFi,其中我使用过诸如list,fetch等处理器.列表文件处理器将在新文件到达上述目录系统时列出文件.到目前为止,我已经完成了从2016年1月到现在的一年数据文件的处理.

i am working on NiFi in which i have used processors such as list, fetch and others. The list file processer lists the file as and when new files arrives in the mentioned directory system. till now, i have done processing of one year of data files that is from the year january 2016 till date.

现在我想将flow.xml文件导出到新环境并继续进行处理.当我启动列表处理器时,它从2016年1月开始.无论如何,是否有必要继续在上一个环境处理过程中离开的列表处理器.

now i want to export flow.xml file to the new environment and continue the processing. when i start the list processor, it starts from the beginning i.e 2016 january. is there anyway to continue the listing processor where it left in the previous environment processing.

推荐答案

在独立的NiFi实例中,状态由state-management.xml中配置的本地状态提供程序存储:

In a standalone NiFi instance, the state is being stored by the local state provider configured in state-management.xml:

<local-provider>
        <id>local-provider</id>
        <class>org.apache.nifi.controller.state.providers.local.WriteAheadLocalStateProvider</class>
        <property name="Directory">./state/local</property>
        <property name="Always Sync">false</property>
        <property name="Partitions">16</property>
        <property name="Checkpoint Interval">2 mins</property>
    </local-provider>

您会看到磁盘上的位置位于./state/local中,因此您需要将此目录结构及其下的所有内容复制到另一个NiFi实例上的相同位置.

You can see that the location on disk is in ./state/local so you would need to copy this directory structure and everything under it to the same location on the other NiFi instance.

此外,这仅在将flow.xml.gz从一个实例复制到另一个实例的情况下有效,因为状态是根据组件的UUID存储的,因此您需要UUID保持不变.如果您使用模板移动流程,则会获得新的UUID,并且状态不会对齐.

Also, this only works if you are copying the flow.xml.gz from one instance to the other because state is stored based on the UUID of the component, so you need the UUIDs to stay the same. If you use templates to move the flow then you get new UUIDs and the state won't line up.

这篇关于NIFI列表文件如何维护其时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆