第一個問題 HUE 無法直接連接到 HBase
在默認配置下 CDH 6.0.1 版本下的 HBase2.0 使用了默認配置
hbase.regionserver.thrift.compact = True
也就是是被勾選的狀態,但是 HUE 我找了半天發現無法配置 thift.compact 的啟用。所以要使用 hue 來使用 HBase 2.0 就需要把這個 HBase 的參數置為 False
hbase.regionserver.thrift.compact 是否使用Thrift TCompactProtocol,如果你每列數據比較大,可以試着開啟,減少帶寬。
這里就比較坑的一點是,CDH 官方文檔讓開啟
啟用 HBase Thrift Http 服務器
hbase.regionserver.thrift.http
HBase(服務范圍)
啟用 HBase Thrift 代理用戶
hbase.thrift.support.proxyuser
HBase(服務范圍)
這兩個選項,但是經過實際測試,開啟這兩個選項不僅會讓 hue 無法連接上去,就連 happybase 也會報錯。所以關閉了,詳情可以參考 reference 里面的 「Sharing how to solve HUE and HBase connect problem on CDH 6.0.1」文章。
另外使用 happybase 的默認配置對其進行訪問,也無法直接訪問,原因是來自於 happybase 默認的 protocol 和 transport 不兼容不一樣。
當我們參照 「Sharing how to solve HUE and HBase connect problem on CDH 6.0.1」關閉相關參數之后。設置 protocol 為 compact 和 transport 是 framed
默認參數使用的是 protocol 為 binary 和 transport 是 buffred
connection = happybase.Connection('xxxx', 9090, transport='framed', protocol='compact')
調整好之后就可以正確訪問了!
Reference:
https://community.cloudera.com/t5/Web-UI-Hue-Beeswax/Sharing-how-to-solve-HUE-and-HBase-connect-problem-on-CDH-6/td-p/82030 Sharing how to solve HUE and HBase connect problem on CDH 6.0.1
https://github.com/wbolster/happybase/issues/161 Getting cybin.ProtocolError: No protocol version header error
http://my.525.life/article?id=1510739742002 hadoop組件---面向列的開源數據庫(三)---hbase的接口thrift(需整理和csdn)