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.

Allowing CORS on HBase REST API

Highlighted

Allowing CORS on HBase REST API

Contributor

I am currently creating a simple HTML page to read data from the HBase REST API. I can successfully get data from the REST API using curl so I know the REST API is working. However when I try to get this data from JavaScript, I get the following error: "No 'Access-Control-Allow-Origin' header is present on the requested resource."

I understand that this is due to the fact that browsers typically implement a same origin policy. I can bypass this by setting up the server for CORS. However I can find no guidance online about how to achieve this with the HBase rest server.

Could somebody please provide with me guidance on how to set up CORS on the HBase REST server.

4 REPLIES 4
Highlighted

Re: Allowing CORS on HBase REST API

@Mark Heydenrych

I believe the current version of Hbase doesn't have jetty which has cross-origin resource sharing, you can follow below Jira for more info.

https://issues.apache.org/jira/browse/HBASE-12894

Highlighted

Re: Allowing CORS on HBase REST API

Super Collaborator

Considering the package namespace change, HBASE-12894 wouldn't come into hbase 1.x release.

For 2.0, the release date is unknown.

Highlighted

Re: Allowing CORS on HBase REST API

To work-around this you could configure your web service to proxy the HBase requests.

For example, in Apache HTTP:

/etc/httpd/conf.d/hbase-rest.conf

ProxyPass /hbase/ http://localhost:8081/
ProxyPassReverse /hbase/ https://localhost:8081/
Highlighted

Re: Allowing CORS on HBase REST API

New Contributor

Hi Mark.. I got in to similar issue(

Allowing CORS on HBase REST API

)... do you have some fix for this..Please help me....

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