Member since
07-30-2019
3406
Posts
1622
Kudos Received
1008
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 151 | 12-17-2025 05:55 AM | |
| 212 | 12-15-2025 01:29 PM | |
| 147 | 12-15-2025 06:50 AM | |
| 264 | 12-05-2025 08:25 AM | |
| 432 | 12-03-2025 10:21 AM |
02-14-2020
09:59 AM
@thuylevn As i mentioned, NiFi has never been released with either a "JSONToAttributes' or "ConvertJSONToAvro" processor. All I can do is suggest existing processors which can hopefully accomplish what your use case requires. The other option is for you to build your own custom processor implementations and add them to your NiFi. Hope this helps. Thank you, Matt
... View more
02-14-2020
09:55 AM
1 Kudo
@vikrant_kumar24 The ExecuteStreamCommand processor is not doing anything fancy here. It is just trying to execute the command you enter. Assuming the command was "myscript.py", The executeStreamCommand would be doing same thing as you would if you opened a terminal window on your NiFi node and clicked on "myscript.py" to run it. Keep in mind that NiFi is performing this action as the user that owns the NiFi java process. The ExecuteStreamCommand processor will pass the FlowFiles content (if there is any) to stdin. Have you perhaps looked at the ExecuteScript processor instead? Hope this helps, Matt
... View more
02-14-2020
09:50 AM
1 Kudo
@DavidR NiFi requires that a sensitive properties key has been configured. The Sensitive properties key is used to encrypt all passwords written to the flow.xml.gz file. The flow.xml.gz is not portable between different installations of NiFi unless at least 1 of the 2 following is true: 1. Both NiFi installations are using the exact same sensitive properties key in the nif.properties file: nifi.sensitive.props.key= All the sensitive properties (passwords) entered in to components configured in your dataflows contained within the flow.xml.gz are encrypted. NiFi will fail to start if it cannot decrypt these sensitive properties as the flow.xml.gz is uncompressed and loaded in to memory. 2. The flow.xml.gz contains no encrypted sensitive properties. If you do not know the sensitive properties key used on NiFi where the flow.xml.gz was obtained, you can uncompress the flow.xml.gz yourself and remove all occurrences of "enc{.*}". For example: <value>enc{2fecf4bbb0456fd10c088f73aab2b3c3e92b532afa46eb042f0b0a14b06b1b60}</value> would be replaced with: <value></value> Then gzip the flow.xml again. This removes all passwords from your flow.xml.gz will allowing it to be loaded by any new NiFi installation. You will then need to go through your components and set the passwords again which will then get encrypted to the flow.xml.gz using the sensitive props key set on that NiFi. Hope this helps, Matt
... View more
02-13-2020
05:38 AM
@vikrant_kumar24 If you open a terminal window on your Windows server, can you execute your python script? If you are not successful from command line, the ExecuteStreamCommand processor is not going to be successful as well. Thanks, Matt
... View more
02-13-2020
05:31 AM
1 Kudo
@Umakanth NiFi components (Processors, controller services, reporting tasks, etc.) that have password properties do not support retrieving these passwords from an external source or service. NiFi not only obscures the passwords in the UI, but also encrypts all those passwords when they are written to disk in the flow.xml.gz. Additionally, for passwords entered in the various NiFi configuration files, NiFi offers and encrypt config toolkit that can encrypt all these sensitive properties in these configuration files on disk. I suggest maybe opening an Apache NiFi Jira with details around what you are trying to accomplish here for a possible future feature. - For passwords utilized through NiFi dataflow components, my thought here would be maybe around a NiFi controller service for connecting to such external services. This would also require that processors that would need to use this new NiFi Controller Service to retrieve passwords would all need to be modified as well with new configuration properties to interface with the new controller service. This is by no means a simple change in NiFi, but getting the idea out there with some strong use case for it can get the ball rolling in the community. Hope this helps, Matt
... View more
02-12-2020
01:53 PM
@Sush217 First thing i noticed here is that it appears that your are trying to start all three NiFi nodes on a single Windows machine. Why? You just add overhead with three NiFi nodes on one server. Typical NiFi cluster setups are one NiFi instance per server. The NiFi properties file would need to be unique per each NiFi instance. They cannot share any binding ports in common since only one node is going to be able to bind to a given port number. This includes properties like: nifi.remote.input.socket.port=
nifi.web.http.port= or nifi.web.https.port= (if secured)
nifi.cluster.node.protocol.port= the configured NiFi hostname also needs to be resolvable. You are using node1, node2, and node3. Since all your NiFI nodes are running on the same Windows server, those would all need to be resolvable to the Windows server IP or you could use same hostname for all three instance since they are running on the same host. Now you are also trying to use the embedded zookeeper which means each instance us going to try to standup and start its own zookeeper node. So just like NiFi, these zookeeper nodes can not share the same port numbers. So each cannot be configured to use 2181, 2888, and 3888. Plus, just like NiFi, the hostnames node1, node 2, and node 3 would all need to be resolvable in DNS or the windows local hosts file. Also not ideal to have multiple zookeeper nodes running on the same server. If you looking to just play around with NiFi, you should just install a standalone instance of NiFi, or setup a single node cluster. You can always add additional nodes to your 1 node cluster later by setting up additional servers with NiFi. As you have it configured currently, my guess here is that if you parse through the nifi-app.log for each of your nodes, you are going to see errors related to resolving each your node hostnames to IPs and then later see address already in use errors. Hope this helps, Matt
... View more
02-12-2020
01:24 PM
@Sush217 This thread/topic is very old and has an accepted answer. Please start a new question/topic wit your query. We'll be happy to assist you. Matt
... View more
02-12-2020
01:15 PM
@chhaya_vishwaka It may be beneficially to other users since this thread/topic was so long, if you accept each response that helped directly with getting to your final working cluster. I am happy to hear that you are up and running. Now you get to explore the very granular authorizations/access policies NiFi provides within your secured cluster. Matt
... View more
02-12-2020
01:11 PM
@thuylevn The specific processors you mention were never part of any distribution of Apache NiFi. 1. JSONToAttributes: Typically when extracting json elements in to FlowFile Attrinutes you would use the EvaluateJsonPath processor. There is an "AttributesToJson" processor, is that maybe what you mean? 2. ConvertJSONToAvro NiFi ships with a ConvertAvroToJson processor, is that perhaps what you mean? If you trying to convert from one content format to another, the preferred processor to use would be "convertRecord". In this processor's configuration you would select a Record Reader which reads the current format of the inbound FlowFile's content (JsonPathReader or JsonTreeReader in this case) and you then select a Record Writer (AvroRecordSetWriter in this case) which writes the content for the outbound FlowFile. If the processor types you mentioned did exist for you, then they were added via a custom nar to your previous NiFi installations. Hope this helps, Matt
... View more
02-11-2020
11:41 AM
1 Kudo
@RAM17 The rest-api call you are making will not download the content of a FlowFile. A NiFi FlowFile consists of two parts: 1. FlowFile Attributes/metadata 2. FlowFile content You are looking to download the content of a FlowFile. NiFi does not track FlowFiles using the "filename". NiFi only tracks FlowFiles by there assigned uuid. So passing the filename "9b3c4f34-ad98-4835-9412-94228db3adab.0.csv" is not going to result in content being returned. Using the NiFi rest-api to retrieve the content of a FlowFile from a connection queue is a multi step process. Step 1: Make a queue listing request curl -X POST `http://localhost:8080/nifi-api/flowfile-queues/2dc8fdee-0170-1000-768a-ea14bc96a9cd/listing-requests` The json response will contain the listing request "id" which will be a uuid which will use in next rest-api call to get a listing of the FlowFIles in this queue. Step 2: Get list of FlowFiles created by above request. curl `http://localhost:8080/nifi-api/flowfile-queues/2dc8fdee-0170-1000-768a-ea14bc96a9cd/<listing request id>` Above will return json with the list of FlowFiles in the connection queue found under "flowFileSummaries" which will include following attributes for each FlowFile: --- "uri" rest-api uri for the flowfile --- "uuid" the UUID for the FlowFile (also found in above uri) --- "filename" filename attribute for flowfile associated to above UUID. --- "position", "size", "queuedDuration", "lineageDuration", "penaltyExpiresIn", "clusterNodeId", "clusterNodeAddress", "penalized" Step 3: Use the uri for the flowfile you want to retrieve the flowfile content from curl `http://localhost:8080/nifi-api/flowfile-queues/2dc8fdee-0170-1000-768a-ea14bc96a9cd/flowfiles/<flowfile uuid>/content` Performing above rest-api call without "/content" on the end will retrieve the FlowFile metadata instead of the content. You also may want to redirect the response to above rest-api call to a file on local disk using the "filename" attribute returned during step 2. Also keep in mind that you can only download the content of a FlowFile from a queue if that FlowFile is still in the connection queue. If downstream processors are running and process that FlowFile from the connection queue, it will not be available any longer to download from that queue. If you found this answer your query, please take a moment to accept the response. Hope this helps, Matt
... View more