cd /usr/local/hadoop/
./sbin/start-dfs.sh
cd /usr/local/hbase/
bin/start-hbase.sh
./bin/hbase shell
create 'StudentAdmin','student','course1','course2','course3'
学号作为RowKey即行键,因此插入数据时不必在插入学生编号,同时课程建了三个列族,用于存储同一行键下的不同课程
put 'StudentAdmin','2015001','student:S_Name','Zhangsan'
put 'StudentAdmin','2015001','student:S_Age','23'
put 'StudentAdmin','2015001','student:S_Sex','male'
put 'StudentAdmin','2015001','course1:C_No','123001'
put 'StudentAdmin','2015001','course1:C_Name','Math'
put 'StudentAdmin','2015001','course1:C_Credit','2.0'
put 'StudentAdmin','2015001','course1:Score','86'
put 'StudentAdmin','2015001','course3:C_No','123003'
put 'StudentAdmin','2015001','course3:C_Name','English'
put 'StudentAdmin','2015001','course3:C_Credit','3.0'
put 'StudentAdmin','2015001','course3:Score','69'
put 'StudentAdmin','2015002','student:S_Name','Mary'
put 'StudentAdmin','2015002','student:S_Age','22'
put 'StudentAdmin','2015002','student:S_Sex','female'
put 'StudentAdmin','2015002','course2:C_No','123002'
put 'StudentAdmin','2015002','course2:C_Name','Computer Science'
put 'StudentAdmin','2015002','course2:C_Credit','5.0'
put 'StudentAdmin','2015002','course2:Score','77'
put 'StudentAdmin','2015002','course3:C_No','123003'
put 'StudentAdmin','2015002','course3:C_Name','English'
put 'StudentAdmin','2015002','course3:C_Credit','3.0'
put 'StudentAdmin','2015002','course3:Score','99'
put 'StudentAdmin','2015003','student:S_Name','Lisi'
put 'StudentAdmin','2015003','student:S_Age','24'
put 'StudentAdmin','2015003','student:S_Sex','male'
put 'StudentAdmin','2015003','course1:C_No','123001'
put 'StudentAdmin','2015003','course1:C_Name','Math'
put 'StudentAdmin','2015003','course1:C_Credit','2.0'
put 'StudentAdmin','2015003','course1:Score','98'
put 'StudentAdmin','2015003','course2:C_No','123002'
put 'StudentAdmin','2015003','course2:C_Name','Computer Science'
put 'StudentAdmin','2015003','course2:C_Credit','5.0'
put 'StudentAdmin','2015003','course2:Score','95'
get 'StudentAdmin','2015001'
get 'StudentAdmin','2015002'
get 'StudentAdmin','2015003'