A. operations on Server side

1. ensure hadoop and hbase are working properly

2. install thrift:  apt-get install thrift

3. download hbase source code package: HERE(hbase 0.98 src) . Then extract package to /home/hadoop/hbase-0.98.12.1

4. cd /home/hadoop/hbase-0.98.12.1

thrift --gen py /hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift

5. cd /hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/

cp -r gen-py/ /usr/lib/python2.7/

6. RUN HBase Thrift:  hbase thrift -p 9090 start

B. operation on Client side

1. pip install thrift

pip install hbase-thrift

C. TEST

1. on Server side, enter hbase shell

create'member','member_id','address','info'
create 'member1','member_id','address','info'
create 'member2','member_id','address','info'

2. on Client side,

from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from hbase import Hbase
from hbase.ttypes import * transport =TSocket.TSocket('192.168.2.107', 9090)
transport =TTransport.TBufferedTransport(transport)
protocol =TBinaryProtocol.TBinaryProtocol(transport)
client = Hbase.Client(protocol)
transport.open()
print(client.getTableNames())

3. run

REF:

http://www.cnblogs.com/hitandrew/archive/2013/01/21/2870419.html

http://edu.dataguru.cn/thread-354800-1-1.html

http://blog.csdn.net/a1368783069/article/details/51019835

最新文章

  1. Matlab的68个小常识
  2. Javascript快速入门(下篇)
  3. js断点调试心得
  4. Android Studio Gradle Build Running 特别慢的问题探讨
  5. php-fpm.conf两个至关重要的参数
  6. BZOJ3924 [Zjoi2015]幻想乡战略游戏
  7. centos 不支持mysql
  8. CentOS下安装配置Cacti
  9. 在Web.Config文件中使用configSource,避免动态修改web.config导致asp.net重启(另添加一个Config文件用于管理用户数据)
  10. NYOJ--513--A+B Problem IV(大数)
  11. 用html和css轻松实现康奈尔笔记(5R笔记)模板
  12. 超高速前端开发工具——Emmet
  13. 你应该学会的Python多版本管理工具Pyenv
  14. 使用lld自动发现监控多实例redis
  15. How to create your iOS team provisioning profile ?
  16. 算法(JAVA)----两道小小课后题
  17. 获取oracle 随机数
  18. Map 与 JavaBean 的相互装换
  19. 《剑指offer》第二十二题(链表中倒数第k个结点)
  20. 算法笔记_025:字符串的全排列(Java)

热门文章

  1. docker network基础
  2. centos 支持安装libsodium
  3. List 的add()与addAll()的区别
  4. Python有趣时刻,这些代码让你大呼"卧槽,怎么会这样"
  5. java 错误
  6. 学习:D3
  7. threading 多线程类继承方式调用
  8. This iPhone 6s is running iOS 11.3.1 (15E302), which may not be supported by this version of Xcode.
  9. AOP方法增强自身内部方法调用无效 SpringCache 例子
  10. Halcon示例:print_quality 字符验证