如何使用状态将开发流程更新为产品 [英] How to update flows from dev to prod with state

查看:53
本文介绍了如何使用状态将开发流程更新为产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个nifi流,它与ListS3处理器保持某种状态.我有一个开发实例和一个生产实例.我想要一些从开发人员部署到产品的选项,以便保留状态,而不必手动进入并更改所有处理器和进程组.

似乎无法使用模板完成此操作?基于以下stackoverflow问题:

NIFI列表文件如何维护其时间戳?

如此一来,在部署时我要保持产品状态就不会造成误解.

解决方案

听起来您没有使用NiFi注册表,因此您正在下载流模板,然后将其导入.这不能保存状态,因为它是不一样的流程.

您应该使用NiFi Registry对流进行版本控制,它支持此Dev->生产工作流程.

在Dev NiFi中构建您的流程,版本为Registry.

在产品中,添加一个新的流程组,并在要求您输入名称时选择 Import 选项.您将可以选择版本流.

运行您的流程,使其存储一些状态.查看处理器状态以进行验证.

现在更新Dev中的流程,并将本地更改提交到Registry.

然后,从注册表中将Prod中的流程更新为最新版本.它将状态保存在有状态处理器上.

有关安装&的详细步骤使用注册表,请参阅以下链接:

https://nifi.apache.org/docs/nifi-registry-docs/html/getting-started.html

https://pierrevillard.com/2018/04/09/automate-workflow-deployment-in-apache-nifi-with-the-nifi-registry/

https://alasdairb.com/2021/03/22/nifi-in-production-nifi-registry/

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.2.0/versioning-a-dataflow/content/connecting-to-a-nifi-registry.html

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.4.0/getting-started-with-nifi-registry/content/import-a-versioned-flow.html

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.4.0/getting-started-with-nifi-registry/content/save-changes-to-a-versioned-flow.html

how does NIFI listfile maintains its timestamp?

edit: Just so there is no misunderstanding I want to keep prod state when deploying.

解决方案

It sounds like you aren't using NiFi registry, so you're downloading a flow template and then importing it. This can't preserve state, as it's not the same flow.

You should be using NiFi Registry to version control your flows, which supports this Dev -> Prod workflow.

Build your flow in Dev NiFi, version to Registry.

In prod, add a new Process Group and select the Import option when it asks you for a name. You'll be able to pick your versioned flow.

Run your flow so that it stores some state. View the processors state to verify.

Now update the flow in Dev, and commit the local change to Registry.

Then, update the flow in Prod to the latest version from Registry. It will preserve state on the stateful processor.

For detailed steps on installing & using Registry, see these links:

https://nifi.apache.org/docs/nifi-registry-docs/html/getting-started.html

https://pierrevillard.com/2018/04/09/automate-workflow-deployment-in-apache-nifi-with-the-nifi-registry/

https://alasdairb.com/2021/03/22/nifi-in-production-nifi-registry/

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.2.0/versioning-a-dataflow/content/connecting-to-a-nifi-registry.html

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.4.0/getting-started-with-nifi-registry/content/import-a-versioned-flow.html

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.4.0/getting-started-with-nifi-registry/content/save-changes-to-a-versioned-flow.html

https://docs.cloudera.com/HDPDocuments/HDF3/HDF-3.4.0/getting-started-with-nifi-registry/content/start-version-control-on-a-process-group.html

这篇关于如何使用状态将开发流程更新为产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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