hbase shell
create 'user','base_info'
put 'user', 'rowkey_10', 'base_info:username', '张三'
put 'user', 'rowkey_10', 'base_info:birthday', '2014-07-10'
put 'user','rowkey_10','base_info:sex','1'
put 'user','rowkey_10','base_info:address','北京市'
put 'user','rowkey_16','base_info:username','张小明'
put 'user','rowkey_16','base_info:birthday','2014-07-10'
put 'user','rowkey_16','base_info:sex','1'
put 'user','rowkey_16','base_info:address','北京'
put 'user','rowkey_22','base_info:username','陈小明'
put 'user','rowkey_22','base_info:birthday','2014-07-10'
put 'user','rowkey_22','base_info:sex','1'
put 'user','rowkey_22','base_info:address','上海'
put 'user','rowkey_24','base_info:username','张三丰'
put 'user','rowkey_24','base_info:birthday','2014-07-10'
put 'user','rowkey_24','base_info:sex','1'
put 'user','rowkey_24','base_info:address','河南'
put 'user','rowkey_25','base_info:username','陈大明'
put 'user','rowkey_25','base_info:birthday','2014-07-10'
put 'user','rowkey_25','base_info:sex','1'
put 'user','rowkey_25','base_info:address','西安'
scan 'user'
get 'user', 'rowkey_16'
get 'user', 'rowkey_16', 'base_info'
get 'user', 'rowkey_16', 'base_info:username'
get 'user', 'rowkey_16', {COLUMN => ['base_info:username', 'base_info:sex']}
delete 'user', 'rowkey_16', 'base_info:username'
truncate 'user'
alter 'user', NAME => 'f2'
alter 'user', 'delete' => 'f2'
一定要先disable 表, 然后才能删除表
disable 'user'
drop 'user'
可以通过HBaseUI界面查看表的信息
端口60010打不开的情况,是因为HBase 1.0以后的版本,需要自己手动配置,在文件hbase-site
<property>
<name>hbase.master.info.port</name>
<value>60010</value>
</property>