I am accessing HDFS with savings.
This is the expected (and right) content on HDFS.
[ hadoop@hdp-namenode-01 ~]$ hadoop fs -ls / Found 3 items drwxr-xr-x - hadoop supergroup 0 2012-04-26 14:07 /home drwxr-xr-x - hadoop supergroup 0 2012-04-26 14:21 /tmp drwxr-xr-x - hadoop supergroup 0 2012-04-26 14:20 /user
And then I run HDFSThriftServer
[ hadoop@hdp-namenode-01 ~]$ jps 17290 JobTracker 16980 NameNode 27289 Jps 17190 SecondaryNameNode 17511 RunJar 25270 HadoopThriftServer
Try to access content through the economy in PHP.
$transport = new TSocket(HDFS_HOST, HDFS_PORT); $transport->setRecvTimeout(60000); $transport->setSendTimeout(60000); $protocol =new TBinaryProtocol($transport); $client = new ThriftHadoopFileSystemClient($protocol); logv("connect hdfs"); $transport->open(); logv("testing existent of `%s'", $remote_uri); $remote_path = new Pathname(array('pathname' => $remote_uri)); $remote_file = null; try { $remote_file = $client->listStatus($remote_path); } catch(Exception $e) { } if (!$remote_file) loge("could not open `%s'", $remote_uri);
So far, $remote_uri is the absolute way to go. For $remote_uri === '/non/existent' or '/user' , etc. ListStatus always fails. But if I changed it to '/tmp' , I found that it lists the contents of '/tmp' local FS FS shore.
Thus, the returned content is a local FS on a lean server instead of HDFS! What is wrong here?
source share