// 创建表:
create 'guanzhu','cf1'
create 'fensi','cf1'
// 测试插入数据
put 'guanzhu','g','cf1:from','j'
put 'fensi','b','cf1:from','a'
// 上传jar包到hdfs
hadoop fs -mkdir /input
hadoop fs -put myhbase.jar /input
hadoop fs -rm -r /input/myhbase.jar
hadoop fs -put sdfjlkjkldsjfkl
// 给guanzhu表添加coprocessor
disable 'guanzhu'
alter'guanzhu',METHOD =>'table_att','coprocessor' =>'hdfs://myha01/input/myhbase.jar|com.ghgj.hbase.coprocessor.IndexObserver|100|'
enable 'guanzhu'
// 给guanzhu表移除coprocessor
disable 'guanzhu'
alter 'guanzhu',METHOD=>'table_att_unset',NAME=>'coprocessor$1'
enable 'guanzhu'
// 查询两张表数据
scan 'guanzhu'
scan 'fensi'
// 删除两张表
disable 'guanzhu'
drop 'guanzhu'
disable 'fensi'
drop 'fensi'
// 查看表结构
desc 'guanzhu'
desc 'fensi'
// 创建表:
create 'mystu','base'
// 插入数据
put 'mystu','rk001','base:name','huangbo'
put 'mystu','rk002','base:name','xuzheng'
put 'mystu','rk003','base:name','wangbaoqiang'
put 'mystu','rk004','base:name','huangxiaoming'
// 上传jar包
hadoop fs -mkdir /input1
hadoop fs -put myhbase.jar /input1
hadoop fs -rm -r /input1/myhbase.jar
// 添加协处理器
disable 'mystu'
alter 'mystu',METHOD =>'table_att','coprocessor' =>'hdfs://myha01/input1/myhbase.jar|com.ghgj.hbase.coprocessor.endpoint.SumEndPoint|1001|'
enable 'mystu'
// 删除表
disable 'mystu'
drop 'mystu'
// 查看表结构
desc 'mystu'
// 查看表数据
scan 'mystu'