title: Connect to Hbase from Python and happybase / Thrift
body: <p>I have installed Cloudera Manager Express 5.9.0 installed HBase, with Thrift server running on port 9090 on CentOS 7.3 in a VirtualBox vm. </p>
  
  <p>Please help in figuring out why I am unable to successfully interface via happybase, or help identify next steps to pursue.</p>
  
  <p>I am an experienced Java programmer, learning Python.  I have experience using Hbase from Java using the native interface, although not in this specific environment.</p>
  
  <ul>
  <li>I have validated that I can use hbase shell to create tables, insert data, etc.</li>
  <li>I have validated that 9090 (thrift) is listening and accepting connections.</li>
  <li>I think I have validated that the Thrift server is running with the same protocol/transport settings as the happybase connection parameters.</li>
  </ul>
  
  <p>Python Script taken virtually directly from happybase howto:</p>
  
  <pre><code>import happybase
  
  connection = happybase.Connection(host='localhost',port=9090,transport='buffered', protocol='compact')
  
  connection.create_table('mytable',
      {'cf1': dict(max_versions=10),
       'cf2': dict(max_versions=1, block_cache_enabled=False),
       'cf3': dict(),  # use defaults
      }
  )
  </code></pre>
  
  <p>Error Message, which I can't find great reference for:</p>
  
  <pre><code>[root@data1 ~]# python testhbase.py
  Traceback (most recent call last):
    File "testhbase.py", line 10, in &lt;module&gt; 'cf3': dict(),  # use defaults
    File "build/bdist.linux-x86_64/egg/happybase/connection.py", line 311, in create_table
    File "/usr/lib64/python2.7/site-packages/thriftpy/thrift.py", line 198, in _req return self._recv(_api)
    File "/usr/lib64/python2.7/site-packages/thriftpy/thrift.py", line 210, in _recv fname, mtype, rseqid = self._iprot.read_message_begin()
    File "/usr/lib64/python2.7/site-packages/thriftpy/protocol/compact.py", line 147, in read_message_begin % proto_id)
  thriftpy.protocol.exc.TProtocolException: TProtocolException(type=4)
   [root@data1 ~]#
  </code></pre>
  
  <p>I have Thift web service manager running on port 9095 which reports:</p>
  
  <pre><code>HBase Version   1.2.0-cdh5.9.0, rUnknown    HBase version and revision
  Thrift Impl Type    threadpool  Thrift RPC engine implementation type chosen by this Thrift server
  Compact Protocol    true    Thrift RPC engine uses compact protocol
  Framed Transport    false   Thrift RPC engine uses framed transport
  </code></pre>
  
  <p>Any help is greatly appreciated.  Thank you.</p>