I'm trying to interact with hbase throght knox using Python, In python
The admin give a list of knox API endpoints for hive, hbase and spark like:
https://knox-devl.www.mysite.com:9042/gateway/MYSITEHDO/hbaseversion/cluster
Now, since I'm using Python's happybase library, my connection code is
import happybase
connection=happybase.Connection('https://knox-devl.www.mysite.com/gateway/MYSITEHDO/hbaseversion/cluster',port=9042)
connection.open()
print(connection.tables())
The error it show is:
thriftpy.transport.TTransportException: TTransportException(message="Could not connect to ('https://knox-devl.www.mysite.com/gateway/MYSITEHDO/hbaseversion/cluster', 9042)", type=1)
Also I tried with Phoenixdb lib
import phoenixdb
database_url = 'https://knox-devl.www.mysite.com:9042/gateway/MYSITEHDO/hbaseversion/cluster'
conn = phoenixdb.connect(database_url, autocommit=True)
cursor = conn.cursor()
cursor.execute("SHOW tables")
But I'm getting another error:
phoenixdb.errors.InterfaceError: ('RPC request failed', None, None, BadStatusLine("''",))
Exception phoenixdb.errors.InterfaceError: InterfaceError('RPC request failed', None, None, BadStatusLine("''",)) in <bound method Connection.__del__ of <phoenixdb.connection.Connection object at 0x10bc97d90>> ignored
The only way I can get some of the data through curl:
curl -i -k -u guest:guest-password 'https://knox-devl.www.mysite.com:9042/gateway/MYSITEHDO/hbaseversion/cluster'
But there is no SQL commands there.
did anyone know how to do this or there something I'm missing here, like ask for a different URL or enable something on the cluster?