Pivotal Knowledge Base

Follow

A WebHDFS command is not working - RemoteException:exception:Unsupport

Environment

  • PHD 1.1.1
  • PHD 2.0.1
  • PHD 2.1
  • Kerberized Hadoop Cluster

Symptom

A curl command for testing WebHDFS fails like below:

$ kinit
$ curl -i --negotiate -u : -X GET -L "http://namenode.gphd.local:50070/webhdfs/v1/mydir/myfile"
HTTP/1.1 401
Date: Mon, 03 Nov 2014 22:06:21 GMT
Pragma: no-cache
Date: Mon, 03 Nov 2014 22:06:21 GMT
Pragma: no-cache
WWW-Authenticate: Negotiate
Set-Cookie: hadoop.auth=;Path=/;Expires=Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1387
Server: Jetty(7.6.10.v20130312)
HTTP/1.1 400 Bad Request
Date: Mon, 03 Nov 2014 22:06:21 GMT
Pragma: no-cache
Cache-Control: no-cache
Date: Mon, 03 Nov 2014 22:06:21 GMT
Pragma: no-cache
Set-Cookie: hadoop.auth="u=myid&p=myid@GPHD.LOCAL&t=kerberos&e=1415088381995&s=CX9IUj4J88+GvCPVJ6UApMNHaQY=";Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(7.6.10.v20130312)
{"RemoteException":{"exception":"Unsupport"

Cause

-X GET is not supported REST API for WebHDFS access

Fix

Customer wanted to read a file using the WebHDFS, and following command served the requirement.

$ kinit
$ curl -i --negotiate -u : -L "http://namenode.gphd.local:50070/webhdfs/v1/mydir/myfile?op=OPEN"

Notes

Please refer to following link for complete list of WebHDFS REST APIs.

http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/WebHDFS.html

Comments

Powered by Zendesk