How-to: enable hbase ACL and verify
阿新 • • 發佈:2019-02-10
Grant RW(read+write) to chenfangfang:
- Run as admin user:
hbase(main):010:0> grant 'chenfangfang', 'RW', 'employee2'
0 row(s) in 0.4670 seconds
hbase(main):012:0> user_permission 'employee2'
User Namespace,Table,Family,Qualifier:Permission
hadoop default,employee2,,: [Permission: actions=READ,WRITE,EXEC,CREATE,ADMIN]
chenfangfang default,employee2,,: [Permission: actions=READ,WRITE]
2 row(s) in 0.3000 seconds
- Run as user chenfangfang: could scan and put
hbase(main):003:0> scan 'employee2'
ROW COLUMN+CELL
BeiJing column=address:country, timestamp=1436947463771, value=China
Hong column=address:country, timestamp=1436947135888, value=China
2 row(s) in 0.0440 seconds
hbase(main):004:0> put 'employee2', 'BJ', 'address:country', 'China'
0 row(s) in 0.0690 seconds
hbase(main):005:0> put 'employee2', 'BJ', 'address:country', 'China'scan 'employee2'
ROW COLUMN+CELL
BJ column=address:country, timestamp=1436956463818, value=China
BeiJing column=address:country, timestamp=1436947463771, value=China
Hong column=address:country, timestamp=1436947135888, value=China
3 row(s) in 0.0140 seconds
- Run as admin user:
hbase(main):010:0> grant 'chenfangfang', 'RW', 'employee2'
0 row(s) in 0.4670 seconds
hbase(main):012:0> user_permission 'employee2'
User Namespace,Table,Family,Qualifier:Permission
hadoop default,employee2,,: [Permission: actions=READ,WRITE,EXEC,CREATE,ADMIN]
chenfangfang default,employee2,,: [Permission: actions=READ,WRITE]
2 row(s) in 0.3000 seconds
- Run as user chenfangfang: could scan and put
hbase(main):003:0> scan 'employee2'
ROW COLUMN+CELL
BeiJing column=address:country, timestamp=1436947463771, value=China
Hong column=address:country, timestamp=1436947135888, value=China
2 row(s) in 0.0440 seconds
hbase(main):004:0> put 'employee2', 'BJ', 'address:country', 'China'
0 row(s) in 0.0690 seconds
hbase(main):005:0> put 'employee2', 'BJ', 'address:country', 'China'scan 'employee2'
ROW COLUMN+CELL
BJ column=address:country, timestamp=1436956463818, value=China
BeiJing column=address:country, timestamp=1436947463771, value=China
Hong column=address:country, timestamp=1436947135888, value=China
3 row(s) in 0.0140 seconds