2
回答
HBase接口API:一直卡在admin.createTable(htd);
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   
[zkpk @master ~]$ jps
10940 QuorumPeerMain
11289 HMaster
9876 NameNode
10059 SecondaryNameNode
10203 ResourceManager
12039 Jps

Hbase zookeeper hdfs都正常,就是不能通过api建表

代码:

public static void main(String[] args) throws Exception
{
		Configuration conf = HBaseConfiguration.create();
		conf.set("hbase.zookeeper.quorum", "192.168.37.129");//连接zookeeper//192.168.37.129
		//conf.set("hbase.zookeeper.property.clientPort", "2181");
		
		System.out.println("a");
		
		HBaseAdmin admin = new HBaseAdmin(conf);//通过conf  知道操作master slave集群
		
		System.out.println("b");
		
		HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("account"));
		
		System.out.println("c");
		
		HColumnDescriptor hcd_info = new HColumnDescriptor("info");
		hcd_info.setMaxVersions(3);//设置info列族属性
		
		System.out.println("d");
		
		HColumnDescriptor hcd_data = new HColumnDescriptor("data");
		
		htd.addFamily(hcd_info);
		htd.addFamily(hcd_data);
		
		System.out.println("e");
		
		admin.createTable(htd);
		
		System.out.println("f");
		
		admin.close();
		System.out.println("g");

}



举报
BluesMao
发帖于2年前 2回/595阅
顶部