<?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 Re: Apache Hadoop FileSystem method copyToLocalFile is not working in cluster mode. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367997#M240019</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;&amp;nbsp; Below is the hadoop fs function being used&lt;/P&gt;&lt;P&gt;copyToLocalFile(new Path(src_HDFSPath), new Path(dest_edgePath))&lt;/P&gt;&lt;P&gt;Please note that my goal is to copy the file from HDFS to edge server local file system when i run the spark job in cluster mode&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 11:59:21 GMT</pubDate>
    <dc:creator>Sanchari</dc:creator>
    <dc:date>2023-04-07T11:59:21Z</dc:date>
    <item>
      <title>Apache Hadoop FileSystem method copyToLocalFile is not working in cluster mode.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367971#M240011</link>
      <description>&lt;P&gt;Hello, I have a scenario where I need to copy the file from HDFS to local file system on edge server.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;When i run the code in cluster mode with spark submit , I am getting below kind of error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;User class threw exception: java.io.IOException: Mkdirs failed to create&lt;BR /&gt;/some_specific/path/in_edge_server (exists=false, cwd=file:/some/path/yarn/nm/usercache/1234/appcache/application_123456744/container_t1234)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems like it is trying to find the destination path where the execution takes place and since it is not finding the specific path it is trying to create a directory and failing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the function being used:&lt;BR /&gt;fs.copyToLocalFile(new Path(src_HDFSPath), new Path(dest_edgePath))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do we have a solution to copy the file from HDFS to specific path of edge server when we run the program in cluster mode?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 07:16:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367971#M240011</guid>
      <dc:creator>Sanchari</dc:creator>
      <dc:date>2026-04-21T07:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Apache Hadoop FileSystem method copyToLocalFile is not working in cluster mode.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367977#M240014</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/100554"&gt;@Sanchari&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;It could be good to share a snippet of your code.&lt;BR /&gt;logically I think you copy FROM --&amp;gt;TO&lt;BR /&gt;&lt;U&gt;Below is the function being used:&lt;/U&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.copy&lt;FONT color="#FF0000"&gt;From&lt;/FONT&gt;LocalFile(new Path(src_HDFSPath), new Path(dest_edgePath))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Disclaimer I am not a Spark/Python developer&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 08:14:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367977#M240014</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2023-04-07T08:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Apache Hadoop FileSystem method copyToLocalFile is not working in cluster mode.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367997#M240019</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;&amp;nbsp; Below is the hadoop fs function being used&lt;/P&gt;&lt;P&gt;copyToLocalFile(new Path(src_HDFSPath), new Path(dest_edgePath))&lt;/P&gt;&lt;P&gt;Please note that my goal is to copy the file from HDFS to edge server local file system when i run the spark job in cluster mode&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 11:59:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/367997#M240019</guid>
      <dc:creator>Sanchari</dc:creator>
      <dc:date>2023-04-07T11:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Apache Hadoop FileSystem method copyToLocalFile is not working in cluster mode.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/368012#M240027</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/100554"&gt;@Sanchari&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I suspect the&amp;nbsp;&lt;SPAN&gt;java.io.IOException: Mkdirs failed to create is due to permissions on the edge-node&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;Assuming you are&amp;nbsp; the HDFS copy is being run as hdfs&amp;nbsp; and your edge node&amp;nbsp; directory belongs to a different user/group that.&lt;BR /&gt;Just for test purposes&amp;nbsp; can you&amp;nbsp; &amp;nbsp;do the following on the edgenode&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;# mkdir -p &lt;SPAN&gt;/some_specific/path/in_edge_server&lt;/SPAN&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Then run chmod on the destination path&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;# chmod 777&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;/some_specific/path/in_edge_server&lt;/SPAN&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Finally, rerun you spark-submit and let me know&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 19:47:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/368012#M240027</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2023-04-07T19:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Apache Hadoop FileSystem method copyToLocalFile is not working in cluster mode.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/368090#M240051</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;&amp;nbsp;Please note that the directory on edge server to which I am trying to copy the file is already present. So ideally it should not try to perform mkdir operation. as I mentioned in my first post, it is looking for the directory in cwd of the node where the code is being executed and since it is not able to find it , it is trying to create one. So basically it should look for the directory in edge server instead of the directory mentioned in the cwd of the error posted.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 05:00:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Hadoop-FileSystem-method-copyToLocalFile-is-not/m-p/368090#M240051</guid>
      <dc:creator>Sanchari</dc:creator>
      <dc:date>2023-04-10T05:00:22Z</dc:date>
    </item>
  </channel>
</rss>

