<?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 Spark - HDFS File access Error in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120504#M22450</link>
    <description>&lt;P&gt;I am trying to access a file in HDFS with the help of Spark Scala command in Spark Shell&lt;/P&gt;&lt;P&gt;Hadoop HDFS file URL is localhost:50070/sridhar/hadoop/sample.txt&lt;/P&gt;&lt;P&gt;I executed&lt;/P&gt;&lt;P&gt;scala&amp;gt; val file = sc.textFile("hdfs://localhost:50070/sridhar/hadoop/sample.txt")&lt;/P&gt;&lt;P&gt;then executed &lt;/P&gt;&lt;P&gt;scala&amp;gt; file.foreach(println) ,  got the following errors&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;EM&gt;java.io.IOException: Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.; Host Details : local host is: "sridhar25/127.0.1.1"; destination host is: "localhost":50070; 
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:772)
at org.apache.hadoop.ipc.Client.call(Client.java:1472)
at org.apache.hadoop.ipc.Client.call(Client.java:1399)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
at com.sun.proxy.$Proxy33.getFileInfo(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:752)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;How to access the files without errors?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2016 12:51:14 GMT</pubDate>
    <dc:creator>sridharbabu1138</dc:creator>
    <dc:date>2016-03-10T12:51:14Z</dc:date>
    <item>
      <title>Spark - HDFS File access Error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120504#M22450</link>
      <description>&lt;P&gt;I am trying to access a file in HDFS with the help of Spark Scala command in Spark Shell&lt;/P&gt;&lt;P&gt;Hadoop HDFS file URL is localhost:50070/sridhar/hadoop/sample.txt&lt;/P&gt;&lt;P&gt;I executed&lt;/P&gt;&lt;P&gt;scala&amp;gt; val file = sc.textFile("hdfs://localhost:50070/sridhar/hadoop/sample.txt")&lt;/P&gt;&lt;P&gt;then executed &lt;/P&gt;&lt;P&gt;scala&amp;gt; file.foreach(println) ,  got the following errors&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;EM&gt;java.io.IOException: Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.; Host Details : local host is: "sridhar25/127.0.1.1"; destination host is: "localhost":50070; 
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:772)
at org.apache.hadoop.ipc.Client.call(Client.java:1472)
at org.apache.hadoop.ipc.Client.call(Client.java:1399)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
at com.sun.proxy.$Proxy33.getFileInfo(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:752)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;How to access the files without errors?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 12:51:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120504#M22450</guid>
      <dc:creator>sridharbabu1138</dc:creator>
      <dc:date>2016-03-10T12:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spark - HDFS File access Error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120505#M22451</link>
      <description>&lt;P&gt;Can you try using hdfs://localhost:8020 or hdfs://machinname:8020&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 17:52:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120505#M22451</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-10T17:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Spark - HDFS File access Error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120506#M22452</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I am getting the following errors&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;java.net.ConnectException: Call From sridhar25/127.0.1.1 to localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  &lt;A href="http://wiki.apache.org/hadoop/ConnectionRefused"&gt;http://wiki.apache.org/hadoop/ConnectionRefused&lt;/A&gt;
&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;
&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 21:52:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120506#M22452</guid>
      <dc:creator>sridharbabu1138</dc:creator>
      <dc:date>2016-03-10T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Spark - HDFS File access Error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120507#M22453</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3273/sridharbabu1138.html" nodeid="3273"&gt;@Sridhar Babu M&lt;/A&gt; is your hdfs up? Please make sure your cluster is up and passes service checks.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 21:52:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120507#M22453</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-10T21:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Spark - HDFS File access Error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120508#M22454</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;In the hadoop core-site.xml file&lt;/P&gt;&lt;P&gt;I have given the hdfs url as &lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;
	&amp;lt;property&amp;gt;
		&amp;lt;name&amp;gt;fs.default.name&amp;lt;/name&amp;gt;      
		&amp;lt;value&amp;gt;hdfs://localhost:9000&amp;lt;/value&amp;gt;
 	&amp;lt;/property&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/PRE&gt;&lt;P&gt;After giving it as hdfs://localhost:9000/path it worked!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Correct command&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Scala&amp;gt; val file= sc.textFile("hdfs://localhost:9000/path")&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Mar 2016 21:55:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120508#M22454</guid>
      <dc:creator>sridharbabu1138</dc:creator>
      <dc:date>2016-03-10T21:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Spark - HDFS File access Error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120509#M22455</link>
      <description>&lt;P&gt;great you got it resolved.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2016 22:03:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-HDFS-File-access-Error/m-p/120509#M22455</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-10T22:03:03Z</dc:date>
    </item>
  </channel>
</rss>

