开启HBASE的thrift server,实现编程接口


 
 
说明:hbase的thriftserver默认已经编译好,可以使用,不需要跟hadoop thrift一样配置。
 

启动thrift server

要使用Hbase的thrift接口,必须将它的服务启动,命令行为:
    hbase-daemon.sh start thrift
 
thrift默认的监听端口是9090,可以用netstat -nl | grep 9090看看该端口是否有服务。
 
 
 

针对性配置文件

vi  hbase-site.xml
  <property>
      <name>hbase.regionserver.thrift.framed</name>
     <value>true</value>
   </property>
   <property>
      <name> hbase.regionserver.thrift.compact</name>
      <value>true</value>
   </property>
 

实现连接

 
HBASE的python接口之参数指定
                conn = happybase.Connection(host="10.255.111.92",port=9090,protocol='compact',transport='framed')
 
 
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM