hbase常用命令

hbase常用命令

创建namespace:

1
create_namespace 'ssdTable'

建表:

1
create 'ssdTable:table_name', {NAME => 'info', COMPRESSION => 'snappy',TTL=> '63072000'}, SPLITS_FILE => '/root/splits_file.txt'

设置HDFS表文件存储策略:

1
bin/hdfs storagepolicies -setStoragePolicy -path hdfs://node001:8020/hbase/data/ssdTable/table_name -policy ALL_SSD

shell命令中执行:

1
echo "create 'ssdTable:table_name', {NAME => 'info'}" | bin/hbase shell -n

查看文件位置:

1
bin/hadoop fsck /file/dir -files -blocks -locations