I am trying to list data present in hadoop cluster and also copy the data using curl command but i am getting http 405 error. Below is the command i am using.
curl -iku guest:guest-password -L -T samples/hadoop-examples.jar \
-X PUT "https://{172.17.198.172}:8443\
/gateway/sandbox/webhdfs/v1/user/guest/knox-sample/lib/hadoop-examples.jar?op=CREATE
I have tried this using the following curl command and had success:
curl -i -v -k -u guest:guest-password -L -T /Users/larry/hadoop-examples.jar -X PUT "https://{localhost}:8443/gateway/sandbox/webhdfs/v1/user/guest/knox-sample/lib/hadoop-examples.jar?op=CREATE"
It resulted in the expected HTTP 100 continue, 307 for the redirect and PUT and 201 created.
A subsequent curl command listed the contents of the target directory successfully listing the file as present:
curl -i -v -k -u guest:guest-password https://localhost:8443/gateway/sandbox/webhdfs/v1/user/guest/knox-sample/lib?op=LISTSTATUS
There are a couple things in curl command that you posed that are a bit odd:
I suspect that some combination of the above issues caused the URL to be truncated or something in which a PUT was inappropriate for the received URL and/or operation parameter.
I hope this is helpful for you.
If the user guide isn't clear about this then we would love for you to file a jira and we'll get that resolved.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.