0

I am trying this command on my hadoop cluster (Cloudera 5.4.1)

curl -i http://webhdfs:50075/webhdfs/v1/user/admin/test/test.txt?user.name=admin&op=OPEN&namenoderpcaddress=namenode:8022; echo

Here I have confirmed that webhdfs, namenode machine names are all correct and ports 50075 and 8022 are correct.

But I get an error

Cache-Control: no-cache
Expires: Tue, 24 Nov 2015 15:49:42 GMT
Date: Tue, 24 Nov 2015 15:49:42 GMT
Pragma: no-cache
Expires: Tue, 24 Nov 2015 15:49:42 GMT
Date: Tue, 24 Nov 2015 15:49:42 GMT
Pragma: no-cache
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26.cloudera.4)

{"RemoteException":{"exception":"IllegalArgumentException","javaClassName":
"java.lang.IllegalArgumentException","message":"namenoderpcaddress is not specified."}}
4

1 回答 1

0

我能够解决这个问题。访问 webhdfs 时,URL 应指向名称节点。所以与其说 datanode:50075 你应该说 namename:50070

所以我将我的网址更改为

curl -i http://namenode:50070/webhdfs/v1/user/admin/test/test.txt?op=GETFILESTATUS; echo

我是如何找到“50070”的?在您的 cloudera 管理器中搜索“NameNode Web UI Port”

于 2015-11-24T16:19:12.477 回答