If you are using Java Servlet, then you can use HDFS Java API
directly.   Use FileSystem.listStatus instead of call shell, and put
core-site.xml hdfs-site.xml on your classpath.

If you are using other programming language, maybe you can try HDFS's
thrift interface


On Fri, Nov 12, 2010 at 9:33 AM, sudharshan <sudhar...@wayne.edu> wrote:
>
> My question might be a numb but this is where I am stuck now please bear with
> me . Basically I want to execute bin/hadoop dfs -ls when a user in a web
> page clicks a button and displays 0 if the command is executed successfully
> and -1 if not executed. I have a script which runs when the user clicks the
> button in the web page. The script contains a system call of
> system(bin/hadoop dfs -ls) . But it is not been executed due to file
> permission of hdfs when issued from www.
> After googling I came to know that hdfs executes commands by identifying the
> user only as a superuser. I tried to change the posix permissions of hdfs
> but it took no effect.  So can some one help me out?
> Thanks
> --
> View this message in context: 
> http://old.nabble.com/how-to-perform-dfs--ls-as-a-request-from-www-tp30195698p30195698.html
> Sent from the Hadoop core-user mailing list archive at Nabble.com.
>
>



-- 
Best Regards

Jeff Zhang

Reply via email to