Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Can we use webhdfs:// as a KNOX scheme instead of http? If yes, how?

Can we use webhdfs:// as a KNOX scheme instead of http? If yes, how?

New Contributor

I am looking specifically, if Knox can support other URI schemes like webhdfs://

If yes then how can I access hdfs using this scheme?

4 REPLIES 4

Re: Can we use webhdfs:// as a KNOX scheme instead of http? If yes, how?

Super Mentor

@Neha G

Knox works on HTTP (HTTPS) protocol. You can use webhdfs rest calls via knox Via Curl as described in the following link but you can not replace HTTPS:// with webhdfs://

https://cwiki.apache.org/confluence/display/KNOX/Examples+WebHDFS#ExamplesWebHDFS-WebHDFSviacURL

Example:

https://{gateway-host}:{gateway-port}/{gateway-path}/{cluster-name}/webhdfs

Knox Gateway is an Application Gateway for interacting with the REST APIs and UIs of Apache Hadoop deployments. The Knox Gateway provides a single access point for all REST and HTTP interactions with Apache Hadoop clusters.

.

Re: Can we use webhdfs:// as a KNOX scheme instead of http? If yes, how?

Super Mentor

@Neha G

More detailed explaination and webhdfs access via Knox is explained here: https://knox.apache.org/books/knox-0-7-0/user-guide.html#WebHDFS

Example:

curl -i -k -u guest:guest-password -X PUT 'https://localhost:8443/gateway/sandbox/webhdfs/v1/user/guest/example/README?op=CREATE'

.

Re: Can we use webhdfs:// as a KNOX scheme instead of http? If yes, how?

New Contributor

@Jay SenSharma

Thanks Jay!

But I want to understand a scenario where I have to write a java application to access hdfs (create, put, get..in hdfs) and I have to use filesystem URI to access hdfs as webhdfs://<HOST>:<HTTP_PORT>/<PATH> , then would I be able to access hdfs via Knox gateway with this URI?

Re: Can we use webhdfs:// as a KNOX scheme instead of http? If yes, how?

Contributor

Hello @Neha G, you cannot access "webhdfs://" protocol using Knox, Knox only supports Http, Https and WS protocols.

Don't have an account?
Coming from Hortonworks? Activate your account here