hadoop-yarn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liu, David" <liujion...@gmail.com>
Subject Re: How do I use java api to read data from secured hadoop cluster?
Date Tue, 24 Jun 2014 23:50:24 GMT
By the way, I have kinit hadoop on the cluster, and "hadoop fs -ls /" works on the cluster.
The code below is run on the cluster too.
On Jun 25, 2014, at 6:22 AM, "Liu, David" <liujiong25@gmail.com> wrote:

> I mean to  read data from secured hdfs.
> 
> 
> On Jun 25, 2014, at 6:14 AM, "Liu, David" <liujiong25@gmail.com> wrote:
> 
>> Hi experts,
>> 
>> Can anyone provide some example or api name to read data from secured hadoop cluster?
>> I have code like this which can read data from unsecured cluster, but when it comes
to secured one, authentication error will show.
>>> Configuration conf = new Configuration();
>>> FileSystem fs = FileSystem.get(URI.create(uri), conf);
>>> FSDataInputStream in = fs.open(new Path(uri));
>>> IOUtils.copy(in, System.out, 4096);
>>> 
>>> Could anyone help me? Really Appreicate it.
>>> 
>>> Thanks
>> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message