You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Tom Melendez <to...@supertom.com> on 2011/12/08 23:47:39 UTC
Re: Question about accessing another HDFS
I'm hoping there is a better answer, but I'm thinking you could load
another configuration file (with B.company in it) using Configuration,
grab a FileSystem obj with that and then go forward. Seems like some
unnecessary overhead though.
Thanks,
Tom
On Thu, Dec 8, 2011 at 2:42 PM, Frank Astier <fa...@yahoo-inc.com> wrote:
> Hi -
>
> We have two namenodes set up at our company, say:
>
> hdfs://A.mycompany.com
> hdfs://B.mycompany.com
>
> From the command line, I can do:
>
> Hadoop fs –ls hdfs://A.mycompany.com//some-dir
>
> And
>
> Hadoop fs –ls hdfs://B.mycompany.com//some-other-dir
>
> I’m now trying to do the same from a Java program that uses the HDFS API. No luck there. I get an exception: “Wrong FS”.
>
> Any idea what I’m missing in my Java program??
>
> Thanks,
>
> Frank
Re: Question about accessing another HDFS
Posted by Jay Vyas <ja...@gmail.com>.
Can you show your code here ? What URL protocol are you using ?
On Thu, Dec 8, 2011 at 5:47 PM, Tom Melendez <to...@supertom.com> wrote:
> I'm hoping there is a better answer, but I'm thinking you could load
> another configuration file (with B.company in it) using Configuration,
> grab a FileSystem obj with that and then go forward. Seems like some
> unnecessary overhead though.
>
> Thanks,
>
> Tom
>
> On Thu, Dec 8, 2011 at 2:42 PM, Frank Astier <fa...@yahoo-inc.com>
> wrote:
> > Hi -
> >
> > We have two namenodes set up at our company, say:
> >
> > hdfs://A.mycompany.com
> > hdfs://B.mycompany.com
> >
> > From the command line, I can do:
> >
> > Hadoop fs –ls hdfs://A.mycompany.com//some-dir
> >
> > And
> >
> > Hadoop fs –ls hdfs://B.mycompany.com//some-other-dir
> >
> > I’m now trying to do the same from a Java program that uses the HDFS
> API. No luck there. I get an exception: “Wrong FS”.
> >
> > Any idea what I’m missing in my Java program??
> >
> > Thanks,
> >
> > Frank
>
--
Jay Vyas
MMSB/UCHC