Support Questions

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

Unable to read remote file in nifi by using minifi

avatar
Explorer

Hi Team, hoping for the best that someone will help me out from this issue ASAP.

I am working with nifi in local machine from couple of months  to develop some jobs.now as part of developing one job I need to read remote file in nifi by using minifi,as like tailfile processor how it reads nifi log files continuously I have to read remote log files.in the process of finding solution  I seen that by using minifi we can do that.so firstly I installed minifi remote server because I have to read remote log files by providing local machine path of outputfolder those log files will place in that path.

After installing minifi in remote server.unzippped it and tried to start the services by using ./minifi sh start .now I could see services are started and next firstly tried to take and input port in nifi UI and connected that with putfile processor by providing output path and provided connection for input and putfile .nextly taken a processor group and inside that processor group taken tailfile processor and provided the tailing mode as single file and files to tail as "logs\nifi-app.log".and next taken a remote process group(RPG)  and in the url given as "http://localhost:8443/nifi" which is localhost nifi url and port number.and provided connection to tailfile processor and RPG.

Now that process group we have to Select and convert into template and again we have to download that template by using converter toolkit we have to convert file from XML to YML .I was unable to download and use converter toolkit to convert file. i tried to convert manually but that does not worked.

 

Regards,

Sartha

15 REPLIES 15

avatar
Super Mentor

@Sartha 

localhost means same host on which the service is running, so you can't use localhost in a postHTTP processor running on MiNiFi (host B) and expect it to sent FlowFiles to ListenHTTP running on another host (host A). 

The postHTTP is going to transmit FlowFiles to another host, so why would you configure postHTTP running on your MiNiFi Host with the MiNiFi IP and port?

in the PostHTTP url used is server hostname and port number because MiNiFi is running on this server

Maybe I am just misunderstanding what you are saying in above statement.

It also does not appear that the URL is correct. It appears to be missing the "Base path" (default contentListener) as described in the processors documentation.

To help you out, I build this flow so I can share screenshots of how it is configured for you:

Here is PostHTTP configuration which would be used on MiNiFi (host B):

MattWho_0-1705588790866.png

Here is configuration of ListenHTTP used on the NiFi instance (host A) that will receive FlowFiles from above PostHTTP on your MiNiFi (host B):

MattWho_1-1705588906424.png
In my configuration I used port 9933, but you can use any unused non privileged port available on your NiFi instance (host A). 

I am also still confused by your screenshots with regards to below:

Image 1 of the tailFile processor.  This the processor that is feeding the PostHTTP processor on the MiNiFi  instance installed on (host B), correct?  You configured it to tail a nifi-app.log (which is not configured with the absolute path) which is generated by NiFi (host A).   As I mentioned before, the tailFile processor can not tail a file located on a different host form where the tailFile is executing).

Image 3 showing dataflow. Why is ListenHTTP success relationship connected to PostHTTP?

MattWho_2-1705589638751.png

 

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt



avatar
Explorer

@MattWho 

As per the above screenshots I have configured tailfile processor as below

IMG20240119181010~2.jpg

 

Nextly connected tailfile with PostHTTP and configured as below as provided hostname of nifi and port of nifi url

IMG20240119181101~2.jpg

 Still it is not working.could you please provide any link that I can go with the data flow for success relationship that to read remote file in nifi using minifi.

Thanks for all the help

Thanks,

Sartha

avatar
Super Mentor

@Sartha 

You are still not using the correct URL in your postHTTP as I stated in last response:
It needs to be based on what you shared in yoru last response:

http://10.73.121.84:5026/contentListner

 The ListenHTTP processor defines the "Base Path" on which it is listening for inbound connections.  The default value is "contentListener".  So the PostHTTP needs to post to that Base Path.

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

avatar
Explorer

@MattWho 

I followed the flow as per your guidance but still it doesn't worked.

Even tried of following as Administration Guide of Apache MINIFI.that wasn't worked.

Is there any other way that to configure this issue.

Thank you soo much for all the support.

Regards,

Sartha

avatar
Super Mentor

@Sartha 

I don't know how to respond to "I followed the flow as per your guidance but still it doesn't worked."

The flow I provided works.  
What exceptions/errors are you encountering?
You have not provided much detail on what you are seeing exception/issue wise.  

Thank you,
Matt

avatar
Community Manager

@Sartha, Did @MattWho's responses assist in resolving your query? If it did, kindly mark the relevant reply as the solution, as it will aid others in locating the answer more easily in the future. 



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: