<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to replicate a file in NiFi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345055#M234352</link>
    <description>&lt;P&gt;I have the issue whereby I receive a file into NiFi on a single node but wish to copy this onto multiple nodes.&lt;/P&gt;&lt;P&gt;Has anyone done this before and what would be the process to do so?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jun 2022 14:53:41 GMT</pubDate>
    <dc:creator>Tryfan</dc:creator>
    <dc:date>2022-06-06T14:53:41Z</dc:date>
    <item>
      <title>How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345055#M234352</link>
      <description>&lt;P&gt;I have the issue whereby I receive a file into NiFi on a single node but wish to copy this onto multiple nodes.&lt;/P&gt;&lt;P&gt;Has anyone done this before and what would be the process to do so?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 14:53:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345055#M234352</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-06T14:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345058#M234353</link>
      <description>&lt;P&gt;Why do you want to do that ? NiFi cluster is not like HDFS where data will be replicated across nodes NiFi is not a storage system.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What NiFi provides as , let's say you have 3 node cluster and you receive 100 files on one node assuming Processor which one is receiving file running on Primary node,now you want to processor these all 100 files in distributed manner using all 3 nodes , then you need to use Load Balancing at queue connection to distribute 100 file on 3 nodes , 33/33/34 files on each node then rest further downstream processing will be done on all 3 nodes.&amp;nbsp; Example flow design flow be, ListSFTP (Primary)--&amp;gt;Connection set to LB at queue tion --&amp;gt; FetchSFTP, in this use case ListSFTP will list the file details on Primary node then FetchSFTP will fetch the file from SFTP server on All 3 nodes in a distributed manner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 15:11:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345058#M234353</guid>
      <dc:creator>ckumar</dc:creator>
      <dc:date>2022-06-06T15:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345059#M234354</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There is a processor called DuplicateFlowFile where you configure it with the Number of Copies that you wish to have. I assume in your case if you want to process it on multiple nodes then the number of copies should be n-1 (where n is number of nodes and -1 because you still have the original flow file). In the downstream queue for this processor success relationship make sure to configure the queue Load Balance Strategy to "Round Robin" where each flowfile will be send to a different node. Hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 15:12:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345059#M234354</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-06-06T15:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345062#M234355</link>
      <description>&lt;P&gt;The file is placed by a third party onto an SFTP location on one node, but we want the file to be available on all nodes so that the receiving team can access it.&amp;nbsp; We'll then run a job to remove it on a daily basis prior to the next file being deposited.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 16:16:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345062#M234355</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-06T16:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345300#M234477</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry some confusion here ,so you saying &lt;EM&gt;The file is placed by a third party onto an SFTP location on one node&lt;/EM&gt;?&amp;nbsp; so the file is on SFTP server at this stage but only on node ? and then you fetch the file into NiFi using List/FetchSFTP processor running on Primary node only ? then ? what is the end goal "we want the file to be available on all nodes so that the receiving team can access it". What do you mean by All nodes is these NiFi nodes or SFTP nodes ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:00:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345300#M234477</guid>
      <dc:creator>ckumar</dc:creator>
      <dc:date>2022-06-09T13:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345376#M234499</link>
      <description>&lt;P&gt;The team logs into the system but cannot guarantee which data node in the cluster they connect to.&amp;nbsp; Currently the flow we have places the file (with the updated attributes - user name and file location) on the same data node it arrived on.&amp;nbsp; What we want to do is take the original file, duplicate it, and place a copy on all nodes so that when the end user logs in they can access the file.&amp;nbsp; No matter what node they end up on.&lt;/P&gt;&lt;P&gt;I have managed to edit the flow using the duplicateflowfile mentioned below but haven't managed to get the putfile processor to direct the copies one to each data node.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 10:31:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345376#M234499</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-10T10:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345380#M234500</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tryfan_0-1654858616827.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/34556i82F444464EEA97DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tryfan_0-1654858616827.png" alt="Tryfan_0-1654858616827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 10:57:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345380#M234500</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-10T10:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345381#M234501</link>
      <description>&lt;P&gt;I've put in the duplicateflowfile processor as shown in the screenshot above.&amp;nbsp; However it is still only sending to a single Data Node.&amp;nbsp; Is there a step or configuration I'm missing?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 10:58:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345381#M234501</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-10T10:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345382#M234502</link>
      <description>&lt;P&gt;Have you set the load balancing strategy on the queue upstream the put file to round robin. If that doesnt work for some reason, then your only option is to create a shared folder on all nodes, then you will have a workflow that picks up the file then you add as many PUTFile processors as the number of your nodes where each put file will save the file to a given node shared folder.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 11:04:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345382#M234502</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-06-10T11:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345383#M234503</link>
      <description>&lt;P&gt;I'm not seeing the load balancing being set on the success relationship of the DuplicateFlowFile. That will basically mean that the PutFile processor will be executed on each node (as many as the flowfile coming out of the duplicate processor.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 12:00:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345383#M234503</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-06-10T12:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345466#M234541</link>
      <description>&lt;P&gt;Current setup is as below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tryfan_0-1655111441630.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/34564iDA85B3D673C4F710/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tryfan_0-1655111441630.png" alt="Tryfan_0-1655111441630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically to reiterate the concept.&amp;nbsp; We wish to receive the single file uploaded on a single data node (1 of 7), process that through NiFi to present an individual copy of that file on every data node.&amp;nbsp; Currently I am getting a multiple created by the duplicateflowfile processor but this is not being placed on the individual nodes.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 09:12:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345466#M234541</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-13T09:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345467#M234542</link>
      <description>&lt;P&gt;Ok, so you got the copy file in NiFi using List/FetchFile then you changed the new directory location where it has to be written using UpdateAttribute then you have used&amp;nbsp;&lt;SPAN&gt;DuplicateFlowFile to create duplicates, till now what is happening since ListFile is running on Primary node (And it should be running on Primary ) rest all downstream flow will be processed/computed on Primary that why you see&amp;nbsp;DuplicateFlowFile creating duplicated on node which is Primary in NiFi Cluster. I do not see any issue here. If you wish to have flow files on All NiFi nodes redistributed after&amp;nbsp;DuplicateFlowFile then you need to set Load Balancing at queue connection on the connection "Round Robin " between&amp;nbsp;DuplicateFlowFile &amp;amp; PutFile, by doing this duplicates flow files will be distributed among nifi nods in round-robin manner one by one and will be written by PutFile back on each nifi nodes where files got distributed after&amp;nbsp;&amp;nbsp;DuplicateFlowFile.&amp;nbsp; Now one question you mention 7 HDFS data nodes, does that means you have&amp;nbsp; NiFi service running as well on the same 7 data nodes ? and having 7 node nifi cluster? in that case, only all 7 nodes will receive each file copy. I see&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 09:50:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345467#M234542</guid>
      <dc:creator>ckumar</dc:creator>
      <dc:date>2022-06-13T09:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345488#M234545</link>
      <description>&lt;P&gt;I have done similar here when I need to deliver jar files to all nodes.&amp;nbsp; &amp;nbsp;It's really a "this is not how things are done", but in this case I did not have access to the node's file system without doing this in a flow.&amp;nbsp; So that said, it works great!&amp;nbsp; &amp;nbsp; &amp;nbsp;The first proc creates a flowfile on all nodes (even when I dont know the number), then it checks, if not found, proceeds to get the file and write it to the file system.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-06-13 at 9.35.46 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/34565i285D911CC6336872/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-06-13 at 9.35.46 AM.png" alt="Screen Shot 2022-06-13 at 9.35.46 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 13:38:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345488#M234545</guid>
      <dc:creator>steven-matison</dc:creator>
      <dc:date>2022-06-13T13:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345572#M234569</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97913"&gt;@Tryfan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think the concept of sending a file to one node is what needs to change here.&amp;nbsp; BY sending to a single node in the NiFi cluster you create a single point of failure.&amp;nbsp; What happens if that one node on your 7 node cluster goes down?&amp;nbsp; You end up with none of the&amp;nbsp; nodes getting that file and outage to your dataflow.&lt;BR /&gt;&lt;BR /&gt;A better design is to place this file somewhere that all nodes can pull it from.&lt;BR /&gt;&lt;BR /&gt;Maybe it is a commonly mounted file system to all 7 nodes. (getFile processor)?&lt;BR /&gt;Maybe an external SFTP server (GetSFTP processor)?&lt;BR /&gt;etc...&lt;BR /&gt;&lt;BR /&gt;Then you construct a dataflow where all nodes are retrieving a file independently as needed.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 13:11:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/345572#M234569</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-06-14T13:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/346526#M234909</link>
      <description>&lt;P&gt;So I have a single file coming into a single data node (one of 7 as part of a cluster).&amp;nbsp; This file I need to fetch onto NiFi and process through the flow so that a copy is placed on all available data nodes.&lt;/P&gt;&lt;P&gt;I update the attributes to change the files location on the destination and have a put file to place it there.&amp;nbsp; I have since included a duplicateflowfile processor to copy the file 6 times (total of 7 including the original) but with round robin on the connector, this isn't distributing it across the data nodes correctly.&lt;/P&gt;&lt;P&gt;I am now looking at adding a distributeload processor after the duplicateflowfile and configuring it to direct at 7 individual putfile processors.&amp;nbsp; However, unsure of how I can configure these to place on a specific data node.&lt;/P&gt;&lt;P&gt;Can i include the hostname in the directory field?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 10:15:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/346526#M234909</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-29T10:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/346527#M234910</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;- so we have the file coming into the system via a loadbalancer which due to other intricacies, is configured to only ingest on one data node.&amp;nbsp; We don't have the option of an SFTP server so I have to figure this out on the canvas.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 10:51:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/346527#M234910</guid>
      <dc:creator>Tryfan</dc:creator>
      <dc:date>2022-06-29T10:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate a file in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/346532#M234914</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97913"&gt;@Tryfan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You mention this file comes in daily.&amp;nbsp; You also mention that this file arrives through a load-balancer so you don't know which node will receive it.&amp;nbsp; This means you can't configure your source processor for "primary node" only execution as you have done in your shared sample flow with the ListFile.&amp;nbsp; &amp;nbsp;As Primary Node only, the elected primary node will be the only node that executes that processor.&amp;nbsp; So if the source file lands on any other node, it would not get listed.&lt;BR /&gt;&lt;BR /&gt;You could handle this flow in the following manor:&lt;BR /&gt;&lt;BR /&gt;GetFile ---&amp;gt; (7 success relationships) PostHTTP or InvokeHTTP (7 of these with one configured for each node in your cluster cluster)&lt;BR /&gt;ListenHTTP --&amp;gt; UpdateAttribute --&amp;gt; PutFile&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1656508418879.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/34712i8ABE15447D9639DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MattWho_0-1656508418879.png" alt="MattWho_0-1656508418879.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So in this flow, no matter which node receives your source file, the GetFile will consume it. It will then get cloned 6 times (7 copies then exist) with one copy of the FlowFile getting routed to 7 unique PostHttp processors.&amp;nbsp; Each of these targets the ListenHTTP processor listening on each node in your cluster. That ListenHTTP processor will receive all 7 copies (one copy per node) of the original source file.&amp;nbsp; Then use the UpdateAttribute to set your username and location info before the putFile which place each copy in the desired location on the source node.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you add or remove nodes from your cluster, you would need to modify this flow accordingly which is a major downside to such a design.&amp;nbsp; Thus the best solution is still one where the source file is placed somewhere all nodes can retrieve it from so it scales automatically.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you found this response assisted with your query, please take a moment to login and click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 13:20:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-replicate-a-file-in-NiFi/m-p/346532#M234914</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-06-29T13:20:21Z</dc:date>
    </item>
  </channel>
</rss>

