Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NIFI custom properties are not accessible from NIFI Flow

NIFI custom properties are not accessible from NIFI Flow

New Contributor

Hi,

I have 3 node NIFI cluster with external zookeeper cluster.I have updated the customer properties file location in nifi.properties file on 3 NIFI nodes.Attached nifi properties file screenshot.I restarted all nodes after modifying nifi properties file.I am not able to access these custom properties in nifi flow.

Here is the sample expression I used to map custome properties to NIFI flow attributes

${configdb_url}

Please help me to resolve this.

Thanks,

Bob

86595-nifi-properties-file.jpg

2 REPLIES 2

Re: NIFI custom properties are not accessible from NIFI Flow

Super Guru
@Bob T

Not able to reproduce the same exact issue on my instance.

1.Could you please make sure the path's are exact to the afflication.properties and exceptions.properties files.

2. Make sure you are having configdb_url value in the format below in your .properties file

configdb_url=some_url

Then once you restart the NiFi cluster then nifi able to load these properties files.

3. we can access the variables by using nifi expression language as you have mentioned above.

${configdb_url}

return value as

some_url

-

In addition it's better to use DistributeCacheMap processors to store your .properties file and use FetchDistributeMapCache processor to pull the the required key from the Distributecache.

GetFile //keep Source File to true
SplitText //to split each line ExtractText //extract the key name
PutDistributeMapCache //store based on key name

FetchDIstributeCache you can fetch based on the key name, By using this way you don't need to restart the NiFi cluster everytime if you want to change/modify the .properties file.

If you are having handful number of key values in .properties you can leverage variable registry by using UI/RestApi to add them to nifi instance, this registry also doesn't require any restart of nifi cluster.

Re: NIFI custom properties are not accessible from NIFI Flow

New Contributor
Agree with the answer by @Shu, One more thing, if you try to add these properties in the nifi.properties itself , does that work?
Don't have an account?
Coming from Hortonworks? Activate your account here