HBASE(一)—— HBase的基本操作命令,
安装好 HBase 之后,首先启动 HBase,执行 start-hbase.sh
命令,然后再执行 hbase shell
命令,进入 HBase 的交互界面:
一、创建表
创建一个 student 表,两个列族:info,grade
create 'student','info','grade'
二、插入数据
向学生表的 info 列族添加一列 name,并设定其值为 Tom,rowkey 为 stu001:
put 'student','stu001','info:name','Tom'
向学生表的 info 列族添加一列 age,并设定其值为 24,rowkey 为 stu001:
put 'student','stu001','info:age','24'
向学生表的 info 列族添加一列 gender,并设定其值为 Male,rowkey 为 stu001:
put 'student','stu001','info:gender','Male'
向学生表的 grade 列族添加一列 math,并设定其值为 80,rowkey 为 stu001:
put 'student','stu001','grade:math','80'
向学生表的 info 列族添加一列 name,并设定其值为 Mike,rowkey 为 stu002:
put 'student','stu002','info:name','Mike'
三、查询
四、删除表
表在删除之前首先要禁用,否则不能删除。
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。