Support Questions

Find answers, ask questions, and share your expertise

Accessing the Linux server through Nifi (Linux)

Contributor

Good Morning

 

I'm trying to access an address of another Linux server through Nifi that is also installed on a Linux server, to search for files.

 

I'm trying to use the FetchFile Processor for this but I'm not getting the error "Routing to not found".

 

Could you help me how to make this connection between one server and another?

1 ACCEPTED SOLUTION

Master Guru

@leandrolinof 
I see no reason why using UpdateAttribute to establish the needed path and filename values for FetchSFTP processor would not work.  FetchSFTP has no dependency on using ListSFTP.  ListSFP just serves as a mechanism for obtaining a list of Files from a target SFTp server and recording state.  ListSFTP simply creates a FlowFile with the needed attributes set for each File found on the target.  So if you have another method build that can get set those attributes, then you are good to go.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt



View solution in original post

5 REPLIES 5

Expert Contributor

@leandrolinof 

 

FetchFile is going to look for the file on the nifi node or nifi nodes where nifi is installed.  This is usually something done on the primary node of a multi node nifi cluster.

 

If you want to connect to another linux server, not part of the nifi cluster you will have to take a different approach.  One such approach could be using minifi, or possible ExecuteScript to run a linux command from nifi node to other linux server.

Master Guru

@leandrolinof 
ListSFTP  and FetchSFTP are commonly used to fetch files from a remote server.  In order to use ListFile or FetchFile the location remote directory would need to be mounted as a local file directory.

Matt

Contributor

@MattWho 

 

I'm trying this way.

 

With an UpdateAttribute processor and right after FetchSFTP

 

leandrolinof_0-1664799037925.png

 

 

leandrolinof_1-1664799076897.png

 

I'm trying this way because I need to run Oracle QUERY previously and do some validations

 

Can it work?

Master Guru

@leandrolinof 
I see no reason why using UpdateAttribute to establish the needed path and filename values for FetchSFTP processor would not work.  FetchSFTP has no dependency on using ListSFTP.  ListSFP just serves as a mechanism for obtaining a list of Files from a target SFTp server and recording state.  ListSFTP simply creates a FlowFile with the needed attributes set for each File found on the target.  So if you have another method build that can get set those attributes, then you are good to go.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt



Contributor

@MattWho 

 

Thank you very much, this worked perfectly for what I was needing.

 

Can you tell me if this same flow also works with windows?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.