2

I can ssh to the Hadoop Cluster and can run the hbase command. But I need to connect using the Phoenix JDBC driver which needs the IP address of the HBase server.

I tried the IP address I used for the cluster with no luck.

This is probably just a generic Hadoop question but where are the IP addresses configured?

swdev
  • 2,941
  • 2
  • 25
  • 37

2 Answers2

0

If you are aware of the hadoop cluster namenodes, then you can try pinging them or send a curl request like below

curl 'http://my-namenode-lv-101:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus'
{
  "beans" : [ {
    "name" : "Hadoop:service=NameNode,name=NameNodeStatus",
    "modelerType" : "org.apache.hadoop.hdfs.server.namenode.NameNode",
    "SecurityEnabled" : false,
    "NNRole" : "NameNode",
    "HostAndPort" : "my-namenode-lv-101:8020",
    "LastHATransitionTime" : 1561605051455,
    "State" : "standby"
  } ]
}

If the state is Standby, then that is the current inactive node, you have to try the other nodes to find for which the State says 'active' ... example below:

curl 'http://my-namenode-lv-102:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus'
{
  "beans" : [ {
    "name" : "Hadoop:service=NameNode,name=NameNodeStatus",
    "modelerType" : "org.apache.hadoop.hdfs.server.namenode.NameNode",
    "State" : "active",
    "SecurityEnabled" : false,
    "NNRole" : "NameNode",
    "HostAndPort" : "my-namenode-lv-102:8020",
    "LastHATransitionTime" : 1561605054944
  } ]
}
0

To connect to phoenix-hbase use the zookeeper address, port & zookeeper.znode.parent configuration's value which is configured in your cluster. (it can be found in your hbase-site.xml file)

Rahul
  • 459
  • 2
  • 13