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.

How to Connect to Apache Phoenix using Node.js

How to Connect to Apache Phoenix using Node.js

New Contributor

I am trying to connect to Apache Phoenix using node.js

Node.js Version :- 6.0 LTS

Apache Phoenix:- 4.7.0.2.5.6.0-40

HBase Version :- 1.1.2.2.5.6.0-40

Is there any npm package through which I can directly connect to Phoenix. I found some packages like phoenix-client and node-phoenix . But it seems both are outdated.

1 REPLY 1

Re: How to Connect to Apache Phoenix using Node.js

New Contributor

I use jdbc package for that. My config looks like this. Correct the version numbers accordingly.

if (!jinst.isJvmCreated()) {
  jinst.addOption('-Xrs')
  jinst.setupClasspath([
    '/etc/hbase/2.5.3.0-37/0/',
    '/etc/hadoop/2.5.3.0-37/0/',
    '/usr/hdp/2.5.3.0-37/phoenix/phoenix-4.7.0.2.5.3.0-37-thin-client.jar',
    '/usr/hdp/2.5.3.0-37/phoenix/phoenix-server-4.7.0.2.5.3.0-37-runnable.jar',
    '/usr/hdp/2.5.3.0-37/phoenix/phoenix-4.7.0.2.5.3.0-37-client.jar'
  ])
}
var config = {
  drivername: 'org.apache.phoenix.jdbc.PhoenixDriver',
  url: 'jdbc:phoenix:HOST:PORT:/hbase-unsecure',
  user: '',
  password: '',
  maxpoolsize: 100
}
Don't have an account?
Coming from Hortonworks? Activate your account here