设为首页 加入收藏

TOP

hbase使用restful接口进行数据操作
2019-03-16 13:48:30 】 浏览:100
Tags:hbase 使用 restful 接口 进行 数据 操作

全栈工程师开发手册 (作者:栾鹏)
架构系列文章

HBase Rest 是建立在HBase java 客户端基础之上的,提供的web 服务。它存在的目的是给开发者一个更多的选择。

在这里插入图片描述

1.启动rest 服务

(1)hbase rest start

用默认的方式启动rest服务,端口是8080。

(2)hbase rest start 8585

这种方式以端口8585方式启动。

(3)以daemon方式启动

hbase-daemon.sh start rest -p 8585

停止rest服务

hbase-daemon.sh stop rest

2.url

(1)查看表

http://hadoop0:8585/

(2)查看表的schema

http://hadoop0:8585/test/

(3)HBase操作对于的HTTP请求方式

Database Operations REST/HTTP Equivalents
CREATE PUT
READ GET
UPDATE POST (update) or PUT (replace)
DELETE DELETE

数据的增删查改

get方式读取数据 cell or row

下面()内表示可有可无

path := '/' <table>
            '/' <row>
            ( '/' ( <column> ( ':' <qualifier> )
                    ( ',' <column> ( ':' <qualifier> ) )+ )
                ( '/' ( <start-timestamp> ',' ) <end-timestamp> ) )
    query := ( '' 'v' '=' <num-versions> )

put方式存储数据

 path := '/' <table> '/' <row> '/' <column> ( ':' <qualifier> )
              ( '/' <timestamp> )

put方式存储多个或一批数据

path := '/' <table> '/' <false-row-key>

DELETE方式删除指定行、指定列、或指定cell数据

path := '/' <table> 
            '/' <row>
            ( '/' <column> ( ':' <qualifier> )
              ( '/' <timestamp> ) )

表格或schema的增删查改

table creation or schema update(PUT or POST), schema query(GET), or delete (DELETE)

path := '/' <table> / 'schema'

scanner creation (POST)

path := '/' <table> '/' 'scanner'

scanner next item (GET)

path := '/' <table> '/' 'scanner' '/' <scanner-id>

scanner deletion (DELETE)

path := '/' <table> '/' '%scanner' '/' <scanner-id>

其他元信息查询

查询版本信息

/version

查询集群信息

/version/cluster      

查询集群状态

/status/cluster

创建和更新表的schema

put  /table/shcema
Post  /table/schema

查询表元数据

get /table/resions

删除表

delete   /table/schema 

cell 查询

GET /<table>/<row>/<column> ( : <qualifier> )( / <timestamp> )

scan

put/post /table/scanner 
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇启动hbase自动关闭,查看日志连接.. 下一篇往hbase写数据时报错原因之一

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目