Windows下Eclipse连接Hbase报错Will not attempt to authenticate using SASL (unknown err
版本:hbase0.98 hadoop2.3.0
环境:window7 Eclipse
java代码:
package hb;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.util.Bytes;
public class OperateTable {
public static void main(String[] args) throws IOException {
System.setProperty("hadoop.home.dir", "E:\\hadoop\\hadoop-2.3.0");
Configuration conf = HBaseConfiguration.create();
// conf.set("hbase.zookeeper.quorum", "master");//使用eclipse时必须添加这个,否则无法定位
conf.set("hbase.zookeeper.quorum", "master");
conf.set("hbase.zookeeper.property.clientPort", "2181");
conf.set("hbase.master", "192.168.52.128:60010");
HBaseAdmin admin = new HBaseAdmin(conf);// 新建一个数据库管理员//新api
HTableDescriptor desc=new HTableDescriptor(TableName.valueOf("blog"));
//HTableDescriptor desc = new HTableDescriptor("blog");
desc.addFamily(new HColumnDescriptor("article"));
desc.addFamily(new HColumnDescriptor("author"));
admin.createTable(desc );
admin.close();
//admin.disableTable("blog");
//admin.deleteTable("blog");
//assertThat(admin.tableExists("blog"),is(false));
}
}