Node.js and npm phoenix-client package connectivit

2019-03-06 08:48发布

问题:

I am trying to connect kerberized Apache phoenix with the npm jdbc package on node.js [ node.js and npm jdbc package issue with kerberized apache phoenix ], but facing lots of challenges, hence looking for other solutions; In my case npm phoenix-client package seems to be a good option, but I didn't find any kerberized phoenix connectivity example, using phoenix-client package.

If anybody have connected kerberized Apache phoenix uses npm phoenix-client package, please share your thoughts.

回答1:

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
}