<?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: I want to wirte a file to vm datanode with a local java client in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309684#M223899</link>
    <description>&lt;P&gt;I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&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="mark as solution button" style="width: 331px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/5960i4EC112CCAAC11427/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-08-06 at 1.54.47 PM.png" alt="Screen Shot 2019-08-06 at 1.54.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2021 17:44:24 GMT</pubDate>
    <dc:creator>cjervis</dc:creator>
    <dc:date>2021-01-14T17:44:24Z</dc:date>
    <item>
      <title>I want to wirte a file to vm datanode with a local java client</title>
      <link>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309650#M223890</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have HDP 2.6.5 running in VirtualBox with the networkmode "bridgenetwork".&lt;BR /&gt;I have opened port 50010 in the sandbox vm and the port is accessible.&lt;BR /&gt;Now I want to create a text file from my Windows machine with a Java programme.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Configuration conf = new Configuration();&lt;BR /&gt;conf.set("dfs.client.use.datanode.hostname", "true");&lt;BR /&gt;FileSystem fs = new DistributedFileSystem();&lt;BR /&gt;fs.initialize(new URI("hdfs://sandbox-hdp.hortonworks.com:8020"), conf);&lt;BR /&gt;FSDataOutputStream fdos=fs.create(new Path("/testing/file02.txt"), true);&lt;BR /&gt;fdos.writeBytes("Test text for the txt file");&lt;BR /&gt;fdos.flush();&lt;BR /&gt;fdos.close();&lt;BR /&gt;fs.close();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The text file is also created, but there is nothing in it and I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;21/01/13 19:13:00 INFO hdfs.DFSClient: Exception in createBlockOutputStream&lt;BR /&gt;java.io.EOFException: Premature EOF: no length prefix available&lt;BR /&gt;at org.apache.hadoop.hdfs.protocolPB.PBHelper.vintPrefixed(PBHelper.java:2294)&lt;BR /&gt;at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.createBlockOutputStream(DFSOutputStream.java:1480)&lt;BR /&gt;at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1400)&lt;BR /&gt;at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:554)&lt;BR /&gt;21/01/13 19:13:00 INFO hdfs.DFSClient: Abandoning BP-1389476969-172.18.0.2-1610559785364:blk_1073741850_1026&lt;BR /&gt;21/01/13 19:13:00 INFO hdfs.DFSClient: Excluding datanode DatanodeInfoWithStorage[172.18.0.2:50010,DS-11d5c1d9-fa92-46fd-b130-cd05683300c7,DISK]&lt;BR /&gt;21/01/13 19:13:00 WARN hdfs.DFSClient: DataStreamer Exception&lt;BR /&gt;org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /testing/file02.txt could only be replicated to 0 nodes instead of minReplication (=1). There are 1 datanode(s) running and 1 node(s) are excluded in this operation.&lt;BR /&gt;at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1719)&lt;BR /&gt;at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNewBlockTargets(FSNamesystem.java:3372)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My local pc ip is 192.168.178.2 and the vm ip is 192.168.178.39.&lt;/P&gt;&lt;P&gt;I have already tested everything recommended under this link.&lt;BR /&gt;&lt;A href="https://community.cloudera.com/t5/Support-Questions/Cannot-copy-from-local-machine-to-VM-datanode-via-Java/m-p/141141" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/Cannot-copy-from-local-machine-to-VM-datanode-via-Java/m-p/141141&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But nothing has helped.&lt;BR /&gt;Does anyone have an idea what the problem is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Marcel&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 06:51:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309650#M223890</guid>
      <dc:creator>MarcelG</dc:creator>
      <dc:date>2021-01-14T06:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: I want to wirte a file to vm datanode with a local java client</title>
      <link>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309671#M223895</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i solve the problem.&lt;/P&gt;&lt;P&gt;I add the port 50010 to the tcp-hdp.conf which is mapped to the docker container.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 14:06:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309671#M223895</guid>
      <dc:creator>MarcelG</dc:creator>
      <dc:date>2021-01-14T14:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: I want to wirte a file to vm datanode with a local java client</title>
      <link>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309684#M223899</link>
      <description>&lt;P&gt;I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&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="mark as solution button" style="width: 331px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/5960i4EC112CCAAC11427/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-08-06 at 1.54.47 PM.png" alt="Screen Shot 2019-08-06 at 1.54.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:44:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/I-want-to-wirte-a-file-to-vm-datanode-with-a-local-java/m-p/309684#M223899</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2021-01-14T17:44:24Z</dc:date>
    </item>
  </channel>
</rss>

