Primary 동작이 없는 일반 Cluster 에서 getSFTP 를 실행하면, 모든 노드가 똑같은 데이터를 읽어온다.
각 노드마다 똑같은 데이터를 읽어서 노드 수 만큼의 데이터를 가져오게 된다.
When you use GetSFTP in a cluster you are duplicating your data. Each node will ingest the same data.

community.cloudera.com/t5/Support-Questions/GETSFTP-with-NiFi-cluster/m-p/220629#M182514


만약 Delete Original 옵션을 true 로 했다면, FPT 서버상의 데이터를 읽고 지우기까지 하므로 Access 오류가 발생할 수 있다.
if the processor is configured to delete the file once retrieved (default behavior) you will have errors showing up.

pierrevillard.com/2017/02/23/listfetch-pattern-and-remote-process-group-in-apache-nifi/

 

따라서 getSFTP 를 사용해야 한다면, 똑같은 데이터를 읽어오지 않도록 Primary 로 동작하게 만들어야 한다.
in a NiFi cluster it should be set to run on "primary node only" so that every node in the cluster is not competing to pull the same data.

community.cloudera.com/t5/Community-Articles/How-to-Retrieve-files-from-a-SFTP-server-using-NiFi-GetSFTP/ta-p/245430

 

하지만 위와 같이 Primary 로 동작하게 만들면, 효율적이지 않다. 왜냐면 하나의 노드에서만 데이터를 가져오기 때문에, 그리고 데이터는 데이터를 가져온 해당 노드에서만 처리될 것이기 때문에.
(물론 load balancing 이나 원격 포트를 이용하여 데이터를 각 노드로 퍼뜨릴 수 있을 것임)
it’s not efficient at all. First reason is that you get data from only one node (this does not scale at all), and, in the end, only the primary node of your cluster is actually handling the data. Why? Because, unless you explicitly use a remote process group, the data will remain on the same node from the beginning to the end.

pierrevillard.com/2017/02/23/listfetch-pattern-and-remote-process-group-in-apache-nifi/

위와 같은 연유로 getSFTP 대신 ListSFTP/fetchSFTP 를 사용하는 것이 좋다.
ListSFTP 를 통해 FTP 서버에서 파일들의 메타데이터를 가져옴.
이 때는 listSFTP는 Primary 로 동작함
listSFTP 는 Processor 자체적으로 Primary 에서만 돌아가게 설계되어있음.
All Nodes 동작은 선택조차 되지 않음. 만약 Primary 노드가 새로 선출되어도, 이전에 가져온 메타데이터는 가져오지 않음.
즉, listSFTP 는 중복없이 FTP 서버 데이터의 메타데이터를 가져오는 역할을 함.

this Processor can be run on Primary Node only and if a new Primary Node is selected, the new node will not duplicate the data that was listed by the previous Primary Node.

nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache.nifi.processors.standard.ListSFTP/

그 후 FetchSFTP 를 통해 각 메타데이터에 맞는 실제 데이터를 FTP 서버로부터 가져옴.

위의 설명은 ListSFTP/fetchSFTP 패턴의 동작 과정을 굉장히 간략하게 설명한 부분임.
자세한 내용은 아래 링크 참고.

pierrevillard.com/2017/02/23/listfetch-pattern-and-remote-process-group-in-apache-nifi/


아래 링크에서 ListSFTP/fetchSFTP 사용 방법을 알려줌
soowan541.tistory.com/9

+ Recent posts