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

using python read/write HBase data的更多相关文章

  1. Python Web-第二周-正则表达式(Using Python to Access Web Data)

    0.课程地址与说明 1.课程地址:https://www.coursera.org/learn/python-network-data/home/welcome 2.课程全名:Using Python ...

  2. Restore HBase Data

    方法 1: Restoring HBase data by importing dump files from HDFS The HBase Import utility is used to loa ...

  3. Backing Up and Restoring HBase Data

    There are two strategies for backing up HBase:1> Backing it up with a full cluster shutdown2> ...

  4. /usr/bin/python: can't decompress data; zlib not available 的异常处理

    1. 问题背景 使用Pycharm连接远程服务器端pipenv虚拟环境的python解释器,运行python spark脚本时报错如下错误: 2018-09-12 23:56:00 ERROR Exe ...

  5. 【Python学习笔记】Coursera课程《Using Python to Access Web Data》 密歇根大学 Charles Severance——Week6 JSON and the REST Architecture课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week6 JSON and the REST Architecture 13.5 Ja ...

  6. 【Python学习笔记】Coursera课程《Using Python to Access Web Data 》 密歇根大学 Charles Severance——Week2 Regular Expressions课堂笔记

    Coursera课程<Using Python to Access Web Data > 密歇根大学 Charles Severance Week2 Regular Expressions ...

  7. 《Using Python to Access Web Data》 Week5 Web Services and XML 课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week5 Web Services and XML 13.1 Data on the ...

  8. 《Using Python to Access Web Data》Week4 Programs that Surf the Web 课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week4 Programs that Surf the Web 12.3 Unicod ...

  9. 《Using Python to Access Web Data》 Week3 Networks and Sockets 课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week3 Networks and Sockets 12.1 Networked Te ...

随机推荐

  1. PO & SO Integration By IDOC in CNABB

    PO & SO Integration By IDOC in CNABB 话说博主来ABB一个多月时间了,虽然对ABB系统内的流程和配置不是很了解,但对ABB系统内使用的PO和SO通过idoc ...

  2. 学习 MeteoInfo二次开发教程(四)

    教程四的问题不大. 1.private void AddMapFrame_ChinaSouthSea().private void AddTitle()两个函数和public Form1()函数并列. ...

  3. 用PS做圆角图片

    ps: Adobe Photoshop CS2  如果图片被锁定,请“双击”图层中“背景”解锁,如果没有图层菜单,在最上面导航栏中:窗口—图层.如下图:  点“确定”,解锁.  选用“圆角矩形工具”. ...

  4. 来自Github的优秀源码(python操作iframe框架网页)

    #Please use your username and password for academia in codeimport timefrom selenium import webdriver ...

  5. Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]

    今天在测试项目代码时,在idea中配置tomcat7插件运行后一直报如下错误: 解决方案:看了网上大多数办法都是修改xml文件配置,感觉并不适用,最后看到比较靠谱解释如下: pom.xml中jar包发 ...

  6. STL里的内存池实现

    这个貌似有点复杂,解决的主要问题 就是 减少 内存分配次数,减少用户态核心态切换中断次数,提高运行速度,预分配 和线程池一个道理,预分配 ////////////////////自由链表 union ...

  7. intellij idea设置ss代理

  8. jQuery.extend 与 jQuery.fn.extend

    extend方法为jQuery对象的核心之一,语法如下: jQuery.extend([deep], target, object1, [objectN]),返回值Object. 概述:用一个或多个其 ...

  9. netty 为什么用nio 不用 aio

    NIO模型 同步非阻塞 NIO有同步阻塞和同步非阻塞两种模式,一般讲的是同步非阻塞,服务器实现模式为一个请求一个线程,但客户端发送的连接请求都会注册到多路复用器上,多路复用器轮询到连接有I/O请求时才 ...

  10. 搭建EOS环境

    [搭建EOS环境] 1.Ubuntu 18.04 下安装eosio wget https://github.com/eosio/eos/releases/download/v1.4.4/eosio_1 ...