title: spring hbase sample with standalone hbase
body: <p>On my local dev Ubuntu 14 box I cant get hadoop and hbase to run standalone.</p>
  
  <p>BUt can get hbase to work directly with the file system (verfied by creating table and putting values in the hbase shell).</p>
  
  <p>Now I want to read this table from spring. I started out with code at <a href="https://github.com/spring-projects/spring-hadoop-samples/tree/master/hbase" rel="nofollow">https://github.com/spring-projects/spring-hadoop-samples/tree/master/hbase</a></p>
  
  <p>If I change the IP and port to the qa server it works. But if I want to connect to my local hbase not able to.</p>
  
  <p>hbase-site</p>
  
  <pre><code>   &lt;property&gt;
        &lt;name&gt;hbase.rootdir&lt;/name&gt;
        &lt;!-- value&gt;hdfs://localhost:50070/hbase&lt;/value --&gt; &lt;!-- 8030--&gt;
      &lt;value&gt;file:///usr/local/hbase/HFiles3&lt;/value&gt;
     &lt;/property&gt;
  
     &lt;property&gt;
      &lt;name&gt;hbase.zookeeper.property.dataDir&lt;/name&gt;
      &lt;value&gt;/usr/local/hbase/zookeeper3&lt;/value&gt;
    &lt;/property&gt;     
  
     &lt;property&gt;
      &lt;name&gt;hbase.master.info.port&lt;/name&gt;
      &lt;value&gt;8095&lt;/value&gt;
    &lt;/property&gt;
  
     &lt;property&gt;
      &lt;name&gt;hbase.regionserver.info.port&lt;/name&gt;
      &lt;value&gt;8096&lt;/value&gt; &lt;!-- changed as i dont know where it was connecting other wise none of the usual ports --&gt;
    &lt;/property&gt;
  </code></pre>
  
  <p>application-context.xml</p>
  
  <pre><code>    &lt;context:property-placeholder location="hbase.properties"/&gt;
  
      &lt;context:component-scan base-package="org.springframework.samples.hadoop.hbase"/&gt;
  
      &lt;hdp:configuration id="hadoopConfiguration"&gt;
        fs.defaultFS=file:///usr/local/hbase/HFiles3
      &lt;/hdp:configuration&gt;
  
  &lt;!--    configuration-ref="hadoopConfiguration" --&gt;
      &lt;hdp:hbase-configuration configuration-ref="hadoopConfiguration" zk-quorum="${hbase.zk.host}" zk-port="${hbase.zk.port}"/&gt;
  
      &lt;bean id="hbaseTemplate" class="org.springframework.data.hadoop.hbase.HbaseTemplate"&gt;
          &lt;property name="configuration" ref="hbaseConfiguration"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>hbase.properties</p>
  
  <pre><code>hbase.zk.host=localhost
  hbase.zk.port=8095
  </code></pre>
  
  <p>Log (part):
  ...</p>
  
  <pre><code>12:20:21,763  INFO           org.apache.zookeeper.ZooKeeper: 100 - Client environment:user.home=/home/t
  12:20:21,763  INFO           org.apache.zookeeper.ZooKeeper: 100 - Client environment:user.dir=/home/t/prog/r/github/spring-hadoop-samples/hbase
  12:20:21,765  INFO           org.apache.zookeeper.ZooKeeper: 438 - Initiating client connection, connectString=localhost:8095 sessionTimeout=90000 watcher=hconnection-0x5a7fd55c, quorum=localhost:8095, baseZNode=/hbase
  12:20:21,802  INFO oop.hbase.zookeeper.RecoverableZooKeeper: 120 - Process identifier=hconnection-0x5a7fd55c connecting to ZooKeeper ensemble=localhost:8095
  12:20:21,805  INFO          org.apache.zookeeper.ClientCnxn: 975 - Opening socket connection to server t/127.0.0.1:8095. Will not attempt to authenticate using SASL (unknown error)
  12:20:21,828  INFO          org.apache.zookeeper.ClientCnxn: 852 - Socket connection established to t/127.0.0.1:8095, initiating session
  12:20:21,834  WARN          org.apache.zookeeper.ClientCnxn:1102 - Session 0x0 for server t/127.0.0.1:8095, unexpected error, closing socket connection and attempting reconnect
  java.io.IOException: Packet len1213486160 is out of range!
      at org.apache.zookeeper.ClientCnxnSocket.readLength(ClientCnxnSocket.java:112)
      at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:79)
      at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366)
      at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
  12:20:21,947  WARN oop.hbase.zookeeper.RecoverableZooKeeper: 253 - Possibly transient ZooKeeper, quorum=localhost:8095, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
  12:20:21,947  INFO rg.apache.hadoop.hbase.util.RetryCounter: 155 - Sleeping 1000ms before retry #0...
  12:20:23,325  INFO          org.apache.zookeeper.ClientCnxn: 975 - Opening socket connection to server t/127.0.0.1:8095. Will not attempt to authenticate using SASL (unknown error)
  12:20:23,326  INFO          org.apache.zookeeper.ClientCnxn: 852 - Socket connection established to t/127.0.0.1:8095, initiating session
  12:20:23,327  WARN          org.apache.zookeeper.ClientCnxn:1102 - Session 0x0 for server t/127.0.0.1:8095, unexpected error, closing socket connection and attempting reconnect
  java.io.IOException: Packet len1213486160 is out of range!
  
  ...
  </code></pre>
  
  <p>Can I run spring hbase without hadoop for local dev? Do I need to run a stand alone zookeeper and give that port as hbase.zk.port ? what is hbase.zk.port?</p>