user3122267
user3122267

Reputation: 327

Node.js and HBase on Azure (HDInsight)

I am trying to access HBase on Microsoft's Azure from Node.js. I looked at different libraries such as hbase and also the REST API (webhcat). What I want to achieve is to create a table and upload data from Node. Later I want to do queries on this dataset. Unfortunately the documentation from Azure is not very helpful in this matter, as it focuses on PowerShell and the .NET SDK.

One quite helpful article I found is this: http://blogs.msdn.com/b/bigdatasupport/archive/2014/04/22/querying-hdinsight-job-status-with-webhcat-via-native-powershell-or-node-js.aspx Querying the job status works fine for me, but I am a bit stuck when it comes to adapting the request in order to upload and query data. Is this even possible with using the webhcat (former templeton) API?

This azure page describes how to use hive or the REST API to interact with HBase on HDInsight: http://azure.microsoft.com/en-us/documentation/articles/hdinsight-hbase-get-started/#hive-query However, I don't know if it is possible to do this with node.js rather than the PowerShell?

I would be very thankful for any thoughts and leads in the right direction!!

Upvotes: 1

Views: 629

Answers (1)

Simon Elliston Ball
Simon Elliston Ball

Reputation: 4455

You can use the HBase REST API on HDInsight, but you have to prepend /hbaserest/ to it.

You also need to provide basic auth credentials, which are those provided when you create the cluster. This should also work with any valid hadoop user on the cluster.

The endpoint is: https://[clustername].azurehdinsight.net/hbaserest/

The rest of the REST API is documented here: https://wiki.apache.org/hadoop/Hbase/Stargate

So for example in node:

var superagent = require('superagent')
superagent.get('https://clustername.azurehdinsight.net/hbaserest/my_table/schema')
.auth(username, password)
.end(function(err, result) {
    console.log(result.text)
})

There is an NPM modules for hbase, but it currently (v 0.1.7) doesn't support authentication, or SSL, both of which are required for the HDInsight Hbase clusters.

Upvotes: 1

Related Questions