NiFi版本升级

NiFi版本升级

转载自https://cwiki.apache.org/confluence/display/NIFI/1.x.0+to+1.x.0+Upgrade

发行说明&迁移指南

升级之前,您应该仔细阅读《发行说明》,以确保您了解所做的更改及其对现有数据流和/或环境的影响。

以下说明是从1.x.0版本升级到另一个版本时要遵循的一般步骤。 在特定版本的NiFi之间移动时,请注意``迁移指南''页面上的特定项目。

重要:

  • 同一群集中不能包含具有不同NiFi版本的节点。

  • 不建议在同一台主机上运行多个NiFi节点。

在你开始之前

在开始之前,您可以执行一些任务来提高升级的效率和成功率。

保留您的自定义处理器

如果您编写了任何自定义NAR,请先在单独的新NiFi版本沙盒中进行测试和验证,然后再进行升级。可以在升级过程中通过以下方式将已验证的NAR存储在集中位置中,以保留它们:

  1. 创建另一个库目录,称为custom_lib。

  2. 将您的自定义NAR移到这个新的lib目录。

  3. 在nifi.properties文件中添加新行以指定此新的lib目录

     nifi.nar.library.directory=./lib

     nifi.nar.library.directory.custom=/opt/configuration_resources/custom_lib

保留修改后的NAR

如果您修改了任何默认的NAR文件,则升级将覆盖这些更改。 保留定制:

  1. 在现有实例中标识并保存对默认NAR文件所做的更改。

  2. 执行升级到新的NiFi版本。

  3. 在升级的NiFi实例中重做对NAR文件所做的更改。

安装

1.下载并解压缩新的NiFi tar.gz文件。

2.对于群集中的每个节点,将新的NiFi安装在与现有NiFi安装平行的目录中。 假设您已安装到opt /目录,例如:

主机-节点1

|--> opt/

   |--> existing-nifi

   |--> new-nifi

 

主机-节点2

|--> opt/

   |--> existing-nifi

   |--> new-nifi

 

主机-节点3

|--> opt/

   |--> existing-nifi

   |--> new-nifi

 

注意:请确保新NiFi目录的所有文件和目录所有权与您在现有目录上设置的所有权相匹配。

3. 在现有安装的NiFi上:

  • 停止所有负责提取新数据的处理器。
  • 允许NiFi运行,直到不再有FlowFiles排队在数据流中的任何地方。
  • 关闭您现有的NiFi实例。

4. 使用现有NiFi安装中的配置文件(<安装目录> / conf)更新新NiFi部署中的相应属性。

配置文件必要的更改
authorizers.xml

Copy the <authorizer>...</authorizer> configured in the existing NiFi to new the NiFi file.

将在现有NiFi中配置的<authorizer> ... </ authorizer>复制到新的NiFi文件。

If you are using the default “file-provider” authorizer, ensure that you copy the users.xml and authorizations.xml files from the existing to the new NiFi.

如果使用默认的“文件提供者”授权者,请确保将users.xml和authorizations.xml文件从现有文件复制到新的NiFi。

Configuration best practices recommend creating a separate location outside of the NiFi base directory for storing such configuration files. If you are storing these files in a separate directory, you do not need to move them. Instead, ensure that the new NiFi is pointing to the same files. For example: /opt/nifi/configuration-resources/

配置最佳做法建议在NiFi基本目录之外创建一个单独的位置,以存储此类配置文件。如果要将这些文件存储在单独的目录中,则无需移动它们。相反,请确保新的NiFi指向相同的文件。例如:/opt/nifi/configuration-resources/

bootstrap-notification-services.xml

Update the values based on values from the existing NiFi file.

根据现有NiFi文件中的值更新值。

bootstrap.conf

Use the existing NiFi bootstrap.conf file to update properties in the new NiFi.

使用现有的NiFi bootstrap.conf文件来更新新NiFi中的属性。

logback.xml

If you added any custom logging modification to the existing NiFi, make those same changes to the new NiFi.

如果您对现有的NiFi添加了任何自定义日志记录修改,请对新的NiFi进行相同的更改。

login-identity-providers.xml

If you used a provider value in the existing NiFi, copy the <provider>...</provider> configuration from the existing NiFi to this file in your new NiFi.

如果您在现有NiFi中使用了提供者值,请将<provider> ... </ provider>配置从现有NiFi复制到新NiFi中的该文件。

nifi.properties





 

Use the existing file to populate the same properties in the new NiFi nifi.properties file.

使用现有文件在新的NiFi nifi.properties文件中填充相同的属性。

This file contains the majority of NiFi configuration settings, so ensure that you have copied the values correctly.

该文件包含大多数NiFi配置设置,因此请确保您已正确复制了这些值。

If you followed NiFi best practices, the following properties should be pointing to external directories outside of the base NiFi installation path.

如果您遵循NiFi最佳做法,则以下属性应指向基本NiFi安装路径之外的外部目录。

If the below properties point to directories inside the NiFi base installation path, you must copy the target directories to the new NiFi. Stop your existing NiFi installation before you do this.

如果以下属性指向NiFi基本安装路径内的目录,则必须将目标目录复制到新的NiFi。在执行此操作之前,请停止现有的NiFi安装。

nifi.flow.configuration.file=

If you have retained the default value, (./conf/flow.xml.gz), copy flow.xml.gz from the existing to the new NiFi base install conf directory.

Alternately, you can copy to an external location and update the property value to point there.

如果保留了默认值(./conf/flow.xml.gz),请将flow.xml.gz从现有值复制到新的NiFi基本安装conf目录。

或者,您可以复制到外部位置并更新属性值以指向该位置。

nifi.flow.configuration.archive.dir=

Same applies as above if you want to retain archived copies of the flow.xml.gz.

如果要保留flow.xml.gz的归档副本,则与上述相同。

nifi.database.directory=

Best practices recommends that you use an external location for each repository. Point the new NiFi at the same external database repository location.

最佳做法建议您为每个存储库使用外部位置。将新的NiFi指向相同的外部数据库存储库位置。

nifi.flowfile.repository.directory=

Best practices recommends that you use an external location for each repository. Point the new NiFi at the same external flowfile repository location.

最佳做法建议您为每个存储库使用外部位置。将新的NiFi指向相同的外部数据库存储库位置。

Warning: You may experience data loss if flowfile repositories are not accessible to the new NiFi.

警告:如果新NiFi无法访问流文件存储库,则可能会丢失数据。

nifi.content.repository.directory.default=

Best practices recommends that you use an external location for each repository. Point the new NiFi at the same external content repository location.

最佳做法建议您为每个存储库使用外部位置。将新的NiFi指向相同的外部内容存储库位置。

Your existing NiFi may have multiple content repos defined. Make sure the exact same property names are used and point to the appropriate matching content repo locations. For example:

您现有的NiFi可能定义了多个内容存储库。确保使用完全相同的属性名称,并指向适当的匹配内容存储库位置。例如:

nifi.content.repository.directory.content1=
nifi.content.repository.directory.content2=

Warning: You may experience data loss if content repositories are not accessible to new NiFi.

Warning: You may experience data loss may if property names are wrong or the property points to wrong content repository.

警告:如果新NiFi无法访问内容存储库,则可能会丢失数据。

警告:如果属性名称错误或属性指向错误的内容存储库,则可能会丢失数据。

nifi.provenance.repository.directory.default=

Best practices recommends that you use an external location for each repository. Point new NiFi at same external provenance repository location.

最佳做法建议您为每个存储库使用外部位置。将新的NiFi指向相同的外部来源存储库位置。

Your existing NiFi may have multiple provenance repos defined. Make sure exact same property names are used and point to appropriate matching provenance repo locations. For example:

nifi.provenance.repository.directory.provenance1=
nifi.provenance.repository.directory.provenance2=

Note: You may not be able to query old events if provenance repos are not moved correctly or properties are not updated correctly.

注意:如果出处回购未正确移动或属性未正确更新,则您可能无法查询旧事件。

state-management.xml

 

For the “local-provider” value, verify the location of “state/local” directory.

对于“ local-provider”值,请验证“ state / local”目录的位置。

If you have retained the default location (./state/local), copy the complete directory tree to the new NiFi. The existing NiFi should be stopped if you are copying this directory because it may be constantly writing to this directory while running.

如果您保留了默认位置(./state/local),请将完整的目录树复制到新的NiFi。如果要复制该目录,则应停止现有的NiFi,因为它在运行时可能会不断写入该目录。

Configuration best practices recommend that you move the state to an external directory like/opt/nifi/configuration-resources/ to facilitate easier upgrading later.

配置最佳实践建议您将状态移动到外部目录,例如/opt /nifi/configuration-resources/,以方便以后的升级。

For a NiFi cluster, the “cluster-provider” ZooKeeper “Connect String" should be using the same external ZooKeeper as the existing NiFi installation.

对于NiFi群集,“群集提供者” ZooKeeper“连接字符串”应使用与现有NiFi安装相同的外部ZooKeeper。

For a NiFi cluster, make sure the “cluster-provider” ZooKeeper "Root Node" matches exactly the value you used in the existing NiFi.

对于NiFi群集,请确保“群集提供者” ZooKeeper“根节点”与您在现有NiFi中使用的值完全匹配。

If you are also setting up a new external ZooKeeper, see the ZooKeeper Migrator section of the NiFi System Administrator’s Guide for instructions on how to move ZooKeeper information from one cluster to another and migrating ZooKeeper node ownership.

如果您还要设置新的外部ZooKeeper,请参阅《 NiFi系统管理员指南》中的ZooKeeper迁移器部分,以获取有关如何将ZooKeeper信息从一个群集移至另一个群集以及迁移ZooKeeper节点所有权的说明。


注意:

  • 请勿将配置文件从旧的NiFi版本复制到新的NiFi版本。较新的配置文件可能会引入新的属性,否则将丢失这些新属性。
  • 仔细检查所有配置的属性是否存在错别字。
  • 如果要通过nifi.properties文件中的敏感属性密钥对数据流中的敏感组件属性进行加密,请确保在复制flow.xml.gz时使用相同的密钥。如果需要更改密钥,请使用流迁移过程和NiFi Encrypt-Config工具从现有文件中生成一个新的flow.xml.gz文件。

5.启动每个新的NiFi实例。

6. 验证:

  • 您的所有数据流都已返回运行状态。一些处理器可能具有需要配置的新属性,在这种情况下,它们将被停止并标记为“无效”。
  • 您所有预期的控制器服务和报告任务将再次运行。解决任何标记为“无效”的控制器服务或报告任务。

7. 确认新的NiFi实例稳定并按预期工作后,可以删除旧实例。

注意:如果将原始NiFi设置为作为服务运行,请更新所有符号链接或服务脚本以指向新的NiFi版本可执行文件。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值