pip安装thrift 和hbase 包
from thrift.transport import TSocket,TTransport
from thrift.protocol import TBinaryProtocol,TCompactProtocol
from hbase import Hbase
socket = TSocket.TSocket(‘10.1.21.35‘,port=9090)
socket.setTimeout(5000)
transport = TTransport.TFramedTransport(socket)
protocol = TCompactProtocol.TCompactProtocol(transport)
client = Hbase.Client(protocol)
socket.open()
table = client.getTableNames()
print(table)
原文:https://www.cnblogs.com/cyue/p/10754938.html