标签:style strong io line new table
通过HBase client访问HBase时,配置如下:
Configuration conf = HBaseConfiguration.create();
// Zookeeper地址
conf.set(HConstants.ZOOKEEPER_QUORUM, "master.hadoop");
//Zookeeper端口
conf.set(HConstants.ZOOKEEPER_CLIENT_PORT, "2181");
//Zookeeper节点父目录
conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/hbase-unsecure");
HBaseAdmin admin = new HBaseAdmin(conf);
boolean b = admin.tableExists("表名");
System.out.println(b);
配置准确的Zookeeper才能连接HBase
标签:style strong io line new table
原文地址:http://www.cnblogs.com/wk022/p/3822314.html