2018-09-17 hbase操作 编程 服务组件 建表12345678910111213create 'table1', { NAME => 'card', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROWCOL', REPLICATION_SCOPE => '1', COMPRESSION => 'SNAPPY', VERSIONS => '1', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'false'} 数据操作123put 'table1', 'rowkey1', 'card:col3', 'value3'get 'table1', 'rowkey1', {COLUMN => ['card:col1', 'card:col2']}scan 'table1' java123456789101112131415161718192021public void test() { logger.info("test"); Configuration conf = HBaseConfiguration.create(); conf.set("hbase.master", "172.17.161.5:60000"); conf.set("hbase.zookeeper.property.clientport", "2181"); conf.set("hbase.zookeeper.quorum", "172.17.161.5"); conf.set("zookeeper.znode.parent", "/hbase-rpt"); try { Connection connection = ConnectionFactory.createConnection(conf); Admin admin = connection.getAdmin(); TableName[] names = admin.listTableNames(); for (TableName tableName : names) { logger.info("Table Name is : " + tableName.getNameAsString()); } } catch (IOException e) { e.printStackTrace(); } } python利用文件锁,同时只允许一个实例运行 hdfs设置账号权限