Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

nodejs integration with hbase rest api


We have hbase setup with application integrating using java. I need to try and setup a way to have nodejs scripts interact with the tables and finding it hard to get workable resources on how to do this. I found the rest/thrift tutorials but need to test a simple way first before getting any new software installed.

1 - rest api start and test fails

hbase(main):005:0> bin/ start rest 
<a href=""></a>
  "status": 404,
  "message": "Not Found"

How do I activate the rest API and then also could someone provide resources on how to integrate with hbase. My understanding from the tutorials, is setting up thrift on the same hbase server where it interacts with the REST API. The nodejs scripts however are run on the same machine which does not help me.

Thanks in advance for any suggestions.


Tried the following based on another site:

# hbase rest start

2017-06-07 07:40:32,341 INFO [main] util.VersionInfo: HBase 2017-06-07 07:40:32,342 INFO [main] util.VersionInfo: Source code repository .....

org.apache.hadoop.hbase.http.HttpServer.openListeners( ... 3 more Exception in thread "main" Port in use: at org.apache.hadoop.hbase.http.HttpServer.openListeners( at org.apache.hadoop.hbase.http.HttpServer.start( at org.apache.hadoop.hbase.http.InfoServer.start( at Caused by: Address already in use at Method) at at at at at at org.apache.hadoop.hbase.http.HttpServer.openListeners( ... 3 more 2017-06-07 07:40:33,437 INFO [Shutdown] mortbay.log: Shutdown hook executing 2017-06-07 07:40:33,438 INFO [Shutdown] mortbay.log: Shutdown hook complete [


The HBase REST,, and Thrift,, external APIs are two separate things and do not depend on one-another.

Your first error is because you used the wrong URL. Again, refer to the documentation: You want /version/cluster, not /version.

The second error is because you instructed HBase to start an instance of the REST server listening on port 8085 but there was another process already bound to that port. Thus, your new REST server instance failed to start. Consider using a tool like netstat to understand what process is listening on that port already.


Thank you so much for responding. It's working now and I hope you could answer one more question for me please: to connect to hbase using nodejs, is there a client library that needs to be downloaded or could I just create a script that will be able to make a GET request for a specific record?

I am not aware of any NodeJS library which is abstracts the HBase REST API. However, there are numerous libraries and APIs available which you can use to make REST calls.



Thanks Josh. I managed to figure how to get this working but realized that you cannot query with a GET for multiple columns ( at least not aware of a way to do it). The PUT so far does not work for me either. The java library and API works well so not sure why making requests through the API with nodejs is so difficult. But thanks again.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.