HBase Rest客戶端使用

jopen 8年前發布 | 16K 次閱讀 HBase NoSQL數據庫

REST Server默認監聽8080端口,如果8080端口被占用,可以修改HBase的hbase-site.xml文件,添加下列屬性:

<property>
        <name>hbase.rest.port</name>
        <value>8090</value>
 </property>

啟動rest server

bin/hbase-daemon.sh start rest

查看server是否正常

curl http://192.168.56.100:8080/version

實例查詢

http://192.168.56.100:8080/xyz/rk1

返回json格式:

curl -H "Accept: application/json" http://192.168.56.100:8080/xyz/rk1

返回xml格式:

curl http://192.168.56.100:8080/xyz/rk1

Protocol Buffer (application/x-protobuf):

 curl -H "Accept: application/x-protobuf" http://192.168.56.100:8080/xyz/rk1 | hexdump -C

Raw binary (application/octet-stream): (一次request只能對一個column)

curl -H "Accept: application/octet-stream" http://192.168.56.100:8080/xyz/rk1/cf1:name

來自: http://www.adintellig.com/hbase-rest-client/

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!