Created 04-17-2018 01:57 AM
Hi there,
I have a cluster with https enabled, there is no kerberos yet, however when I tried to access my cluster through httpfs, it gave me error as follow:
curl -v 'http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=LISTSTATUS'
* About to connect() to 192.168.1.7 port 14000 (#0)
* Trying 192.168.1.7... connected
* Connected to 192.168.1.7 (192.168.1.7) port 14000 (#0)
> GET /webhdfs/v1/user/root/t?op=LISTSTATUS HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: 192.168.1.7:14000
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Server: Apache-Coyote/1.1
< WWW-Authenticate: PseudoAuth
< Set-Cookie: hadoop.auth=; Path=/; HttpOnly
< Content-Type: text/html;charset=utf-8
< Content-Length: 997
< Date: Tue, 17 Apr 2018 08:37:17 GMT
<
* Connection #0 to host 192.168.1.7 left intact
* Closing connection #0
<html><head><title>Apache Tomcat/6.0.53 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - Authentication required</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Authentication required</u></p><p><b>description</b> <u>This request requires HTTP authentication.</u></p><HR size="1" noshade="noshade"><h3>Ap
Please help.
Created 04-18-2018 01:08 AM
Managed to check the home directory, view the content of the file by using the following command.
curl "http://192.168.1.7:14000/webhdfs/v1?op=gethomedirectory&user.name=root"
curl 'http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=LISTSTATUS&user.name=root'
curl -i -L "http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=OPEN&user.name=root"
Created 04-17-2018 06:01 AM
The issue that you are getting is not related to kerberos
I think you don't have access for the /user/root under the below path, please try to access your own home dir, it may help you
'http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=LISTSTATUS'
Created 04-17-2018 08:56 PM
I put in user.name=root it shows the following, I can check the file and folder, however cannot load the file.
$curl 'http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=LISTSTATUS&user.name=root'
{"FileStatuses":{"FileStatus":[{"pathSuffix":"","type":"FILE","length":6,"owner":"root","group":"root","permission":"644","accessTime":1524020367539,"modificationTime":1523951936011,"blockSize":134217728,"replication":1}]}}
$curl 'http://192.168.1.7:14000/webhdfs/v1/user/root?op=LISTSTATUS&user.name=root'
{"FileStatuses":{"FileStatus":[{"pathSuffix":"t","type":"FILE","length":6,"owner":"root","group":"root","permission":"644","accessTime":1524020367539,"modificationTime":1523951936011,"blockSize":134217728,"replication":1},{"pathSuffix":"test.txt","type":"FILE","length":17,"owner":"root","group":"root","permission":"644","accessTime":1524020673090,"modificationTime":1524020673700,"blockSize":134217728,"replication":1}]}}
$curl "http://192.168.1.7:14000/webhdfs/v1/user/root/test.txt&user.name=root"
<html><head><title>Apache Tomcat/6.0.53 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - Authentication required</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Authentication required</u></p><p><b>description</b> <u>This request requires HTTP authentication.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.53</h3></body></html>[root@localhost ~]#
Created 04-18-2018 01:08 AM
Managed to check the home directory, view the content of the file by using the following command.
curl "http://192.168.1.7:14000/webhdfs/v1?op=gethomedirectory&user.name=root"
curl 'http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=LISTSTATUS&user.name=root'
curl -i -L "http://192.168.1.7:14000/webhdfs/v1/user/root/t?op=OPEN&user.name=root"