Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Recommended way to use environment management with Nifi

avatar
New Contributor

What is the recommended way to handle multiple environments with Nifi, without editing the UI? Specifically, how can I manage differing controller and processor credentials between environments? For instance, if I have a DBCP controller service that connects to a DEV database in a DEV environment, how can I adjust the credentials so that the Nifi instance connects to a QA database in a QA environment without manually altering the values from within the Nifi UI itself.

  • I am aware that I can move the flowfile between different instances of nifi, provided the security properties remain the same between environments
  • Within the flowfile.xml file itself, I can see where sensitive values are stored as base64 encoded strings. Using the default security properties, is there a way to decrypt them and/or re-encode new credentials?
1 ACCEPTED SOLUTION

avatar
Guru

@Jonas Carson

Using custom properties files should solve your needs perfectly. Bottom line is you configure your processor with NiFi Expression Language that references the custom property e.g ${my.cust.prop.name}. Each environment has its own instance of the custom property file -- with same property names as file deployed to other environments but values specific to the environment.

To implement this, open the nifi.properties file and set the field nifi.variable.registry.properties to a comma-delimited list of paths to custom property files. Be sure to make your property names unique if you are using more than one property file in the same envt. Also, they must be unique from system and environment properties.

See the following links for more information:

https://community.hortonworks.com/articles/57304/supporting-custom-properties-for-expression-langua....

https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#Using_Custom_Properties

Note: You can also refer to system variables and environment variables the same way: ${system.variable.name}

View solution in original post

1 REPLY 1

avatar
Guru

@Jonas Carson

Using custom properties files should solve your needs perfectly. Bottom line is you configure your processor with NiFi Expression Language that references the custom property e.g ${my.cust.prop.name}. Each environment has its own instance of the custom property file -- with same property names as file deployed to other environments but values specific to the environment.

To implement this, open the nifi.properties file and set the field nifi.variable.registry.properties to a comma-delimited list of paths to custom property files. Be sure to make your property names unique if you are using more than one property file in the same envt. Also, they must be unique from system and environment properties.

See the following links for more information:

https://community.hortonworks.com/articles/57304/supporting-custom-properties-for-expression-langua....

https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#Using_Custom_Properties

Note: You can also refer to system variables and environment variables the same way: ${system.variable.name}