1
votes

I have a problem connecting an Apache Phoenix JDBC client (I'm using sqlline.py for test purposes) to my Hbase, from any remote computer.

The way I'm testing is the following:

I ssh to another machine running linux and then try to connect to my zookeeper quorum (which is just one machine at the moment: christianwith-KP):

    hadoopuser@mike-iMac ~/phoenix-4.4.0-HBase-1.0-bin/bin $./sqlline.py christianwirth-KP
    Setting property: [isolation, TRANSACTION_READ_COMMITTED]
    issuing: !connect jdbc:phoenix:christianwirth-KP none none org.apache.phoenix.jdbc.PhoenixDriver
    Connecting to jdbc:phoenix:christianwirth-KP
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    15/08/06 14:11:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

After trying to connect the commandline does nothing and I get a lot off java-error message after a couple of minutes.

That's from the logfile zookeeper.out, and it seems Zookeeper is accepting the connection from the remote client running sqlline.py, as the IP-adress matches the remote computer I'm trying to connect from.

    2015-08-06 14:10:37,720 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.59.148:39731
    2015-08-06 14:10:37,721 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@868] - Client attempting to establish new session at /192.168.59.148:39731
    2015-08-06 14:10:37,726 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@617] - Established session 0x14f02da342b001b with negotiated timeout 40000 for client /192.168.59.148:39731
    2015-08-06 14:10:37,785 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.59.148:39732
    2015-08-06 14:10:37,786 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@868] - Client attempting to establish new session at /192.168.59.148:39732
    2015-08-06 14:10:37,794 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@617] - Established session 0x14f02da342b001c with negotiated timeout 40000 for client /192.168.59.148:39732
    2015-08-06 14:11:37,045 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.59.148:39736
    2015-08-06 14:11:37,047 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@868] - Client attempting to establish new session at /192.168.59.148:39736
    2015-08-06 14:11:37,052 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@617] - Established session 0x14f02da342b001d with negotiated timeout 40000 for client /192.168.59.148:39736
    2015-08-06 14:11:37,702 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.59.148:39737
    2015-08-06 14:11:37,702 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@868] - Client attempting to establish new session at /192.168.59.148:39737
    2015-08-06 14:11:37,707 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@617] - Established session 0x14f02da342b001e with negotiated timeout 40000 for client /192.168.59.148:39737

If I try to connect on my local machine everything works fine. I made sure the 2 version of phoenix are identical...

Now let's get to my setup, I use the following versions:

  • Hadoop: 2.5.2
  • Zookeeper: 3.4.6
  • HBase: 1.0.1.1
  • Phoenix: 4.4.0

I run my zookeeper separately, and not through HBase.

This is my hbase-site.xml:

<configuration>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
  </property>
  <property>
    <name>zookeeper.znode.parent</name>
    <value>/hbase</value>
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>christianwirth-kp</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
    <description>Property from ZooKeeper's config zoo.cfg.
      The port at which the clients will connect.
    </description>
  </property>
  <property>
    <name>hbase.regionserver.wal.codec</name>
    <value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
  </property>
  <property>
    <name>phoenix.query.timeoutMs</name>
    <value>1800000</value>
  </property>
  <property>
    <name>phoenix.query.threadPoolSize</name>
    <value>8</value>
  </property>
  <property>
    <name>hbase.rpc.timeout</name>
    <value>1800000</value>
  </property>
  <property>
    <name>hbase.client.scanner.timeout.period</name>
    <value>600000</value>
    <source>hbase-default.xml</source>
  </property>
</configuration>

This is my etc/hosts:

192.168.60.43     hbase christianwirth-KP localhost
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

This is my output, when running jps:

6555 HMaster
6435 QuorumPeerMain
13614 Jps
6300 SecondaryNameNode
6658 HRegionServer
5746 NameNode
6002 DataNode

---start edit: 10.08.15

Another thing I just realized is, that my regionserver won't start if I just put

  christianwirth-KP

to the file HBase/conf/regionservers but it starts if I put

  localhost 

in there...

---end edit: 10.08.15

I already checked a lot other topics related to my problem, but no solution seems to help. If someone has an Idea what's going wrong here, I'd greatly appreciate the help.

Best,

Chris

1

1 Answers

5
votes

After several hours of frustration and resignation I found the solution: You have to use the IP-Address of the machine, not the name.

I edited my hbase-site.xml as follows:

<property>
  <name>hbase.zookeeper.quorum</name>
  <value>192.168.59.81</value>
</property>

My regionservers - file looks like:

  localhost

And my zoo.cfg contains:

  # Define Quorum-Servers
  server.1=192.168.59.81:2888:3888

Hope this will help some others who had the same problem of connecting to a pseudo-distributed hbase cluster remotely.