newBloggzh 2017-04-12
一、要求
在Hbase 数据库中创建带有snappy压缩属性的表。
二、登陆到hbase 数据库执行建表操作
hbase(main):016:0> create 'dcs:t_dev_history',{NAME => 'f', DATA_BLOCK_ENCODING => 'PREFIX_TREE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'SNAPPY', MIN_VERSIONS => '0', TTL => '2678400', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
channel 6: open failed: administratively prohibited: open failed
之前创建的表都没有使用snappy压缩,怀疑是snappy没有安装
三、检查所有hbase节点
Master1节点snappy安装正确
[Hadoop@hadoop-test-Master1 lib]$ cd $HBASE_HOME/lib/native/Linux-amd64-64/
[hadoop@hadoop-test-Master1 Linux-amd64-64]$ ls
libhadoop.a libhadoopsnappy.so.0 libhadoop.so.1.0.0 libhdfs.so libpython2.7.so libsnappy.so.1
libhadooppipes.a libhadoopsnappy.so.0.0.1 libhadooputils.a libhdfs.so.0.0.0 libpython2.7.so.1.0 libsnappy.so.1.2.0
libhadoopsnappy.so libhadoop.so libhdfs.a libjvm.so libsnappy.so
Master2节点snappy安装错误,猜测当时安装的时候scp的路径错误
[hadoop@hadoop-test-Master2 ~]$ cd /var/lib/hbase/lib/native/ --发现没有Linux-amd64-64 目录
[hadoop@hadoop-test-Master2 native]$ ls
libhadoop.a libhadoopsnappy.so.0 libhadoop.so.1.0.0 libhdfs.so libpython2.7.so libsnappy.so.1
libhadooppipes.a libhadoopsnappy.so.0.0.1 libhadooputils.a libhdfs.so.0.0.0 libpython2.7.so.1.0 libsnappy.so.1.2.0
libhadoopsnappy.so libhadoop.so libhdfs.a libjvm.so
libsnappy.so
四、处理过程
1.把文件传输到指定节点
scp -rp Linux-amd64-64 hadoop-test-Master2:/var/lib/hbase/lib/native/
scp -rp Linux-amd64-64 hadoop-test-Node1:/var/lib/hbase/lib/native/
2.然后重启hbase集群
./stop-hbase.sh
./start-hbase.sh
3.重新创建表成功。
五、小结
HBase 的详细介绍:请点这里
HBase 的下载地址:请点这里