国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Hbase的常用shell操作

2019-11-08 21:00:13
字體:
來源:轉載
供稿:網友
1.進入hbase的shell界面:[root@lijie bin]# ./hbase shell2.創建表hbase(main):002:0> create 'tablename','cf1','cf2'0 row(s) in 0.5830 seconds=> Hbase::Table - tablename3.列出所有表hbase(main):003:0> listTABLE stu t1 tablename 3 row(s) in 0.0100 seconds=> ["stu", "t1", "tablename"]4.插入數據hbase(main):005:0> put 'tablename','rowkey01','cf1:name','lijie'0 row(s) in 0.0570 secondshbase(main):006:0> put 'tablename','rowkey01','cf1:addr','chongqing'0 row(s) in 0.0070 seconds5.查看表的所有數據hbase(main):012:0> scan 'tablename'ROW COLUMN+CELL rowkey01 column=cf1:addr, timestamp=1486547683853, value=chongqing rowkey01 column=cf1:name, timestamp=1486547607486, value=lijie rowkey02 column=cf1:addr, timestamp=1486547771954, value=shenzhen rowkey02 column=cf1:name, timestamp=1486547737573, value=zhangsan 2 row(s) in 0.0280 seconds6.根據rowkey查看數據hbase(main):015:0> get 'tablename','rowkey01'COLUMN CELL cf1:addr timestamp=1486547683853, value=chongqing cf1:name timestamp=1486547607486, value=lijie 2 row(s) in 0.0250 seconds7.查詢數據的條數hbase(main):016:0> count 'tablename'2 row(s) in 0.0410 seconds=> 28.獲取一行指定列族的數據hbase(main):017:0> get 'tablename','rowkey01','cf1'COLUMN CELL cf1:addr timestamp=1486547683853, value=chongqing cf1:name timestamp=1486547607486, value=lijie 2 row(s) in 0.0120 seconds9.獲取一行指定列族某列數據hbase(main):021:0> get 'tablename','rowkey01','cf1:name'COLUMN CELL cf1:name timestamp=1486547607486, value=lijie 1 row(s) in 0.0080 seconds10.刪除列族hbase(main):027:0> delete 'tablename','rowkey01','cf1:addr'0 row(s) in 0.0030 seconds11.刪除一整行數據hbase(main):029:0> deleteall 'tablename','rowkey01' 0 row(s) in 0.0090 seconds12.更新一條數據hbase(main):032:0> put 'tablename','rowkey02','cf1:addr','shanghai'0 row(s) in 0.0040 seconds13.是否enable或者disablehbase(main):034:0> is_enabled 'tablename'true 0 row(s) in 0.0070 secondshbase(main):035:0> is_disabled 'tablename'false 0 row(s) in 0.0050 seconds14.查看表是否存在hbase(main):036:0> exists 'tablename'Table tablename does exist 0 row(s) in 0.0050 seconds15.服務器狀態hbase(main):037:0> status1 servers, 0 dead, 5.0000 average load16.hbase版本hbase(main):039:0> version1.0.3, rf1e1312f9790a7c40f6a4b5a1bab2ea1dd559890, Tue Jan 19 19:26:53 PST 201617.刪除一個列族hbase(main):040:0> disable 'tablename'0 row(s) in 1.2310 secondshbase(main):041:0> alter 'tablename',{NAME => 'cf1',METHOD => 'delete'} Updating all regions with the new schema...1/1 regions updated.Done.0 row(s) in 1.1460 secondshbase(main):042:0> enable 'tablename'0 row(s) in 0.1550 seconds18.獲得表的描述hbase(main):044:0> describe 'tablename'Table tablename is ENABLED tablename COLUMN FAMILIES DESCRipTION {NAME => 'cf2', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => 'FOREVER', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} 1 row(s) in 0.0150 secondshbase(main):045:0> desc 'tablename'Table tablename is ENABLED tablename COLUMN FAMILIES DESCRIPTION {NAME => 'cf2', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => 'FOREVER', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} 1 row(s) in 0.0240 seconds19.清空整個表hbase(main):046:0> truncate 'tablename'Truncating 'tablename' table (it may take a while): - Disabling table... - Truncating table...0 row(s) in 1.3600 seconds20.刪除整個表hbase(main):048:0> disable 'tablename'0 row(s) in 1.1720 secondshbase(main):049:0> drop 'tablename'0 row(s) in 0.1720 secondshbase(main):050:0> listTABLE stu t1 2 row(s) in 0.0100 seconds=> ["stu", "t1"]

下次更新filter操作,未完待續。。。。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 织金县| 沈阳市| 霍城县| 永康市| 新丰县| 平果县| 马公市| 当阳市| 青岛市| 阜宁县| 云霄县| 西林县| 遵化市| 鹤岗市| 宝丰县| 临朐县| 平阳县| 邢台县| 疏勒县| 利川市| 曲麻莱县| 甘洛县| 林甸县| 西林县| 白水县| 封丘县| 华池县| 南昌县| 金乡县| 平昌县| 中宁县| 兴安县| 东莞市| 罗定市| 盘锦市| 霞浦县| 莱阳市| 北辰区| 宿州市| 慈利县| 慈利县|