![](/img/trans.png)
[英]Exception :org.apache.hadoop.hbase.masternotrunningexception
[英]org.apache.hadoop.hbase.MasterNotRunningException
在這里,我試圖使用hbase創建表。 此處將出現org.apache.hadoop.hbase.MasterNotRunningException。
HBaseConfiguration hbaseConfiguration = new HBaseConfiguration(new Configuration());
HTableDescriptor htable = new HTableDescriptor("Test");
htable.addFamily(new HColumnDescriptor("Id"));
htable.addFamily(new HColumnDescriptor("Name"));
HBaseAdmin hbaseAdmin = new HBaseAdmin(hbaseConfiguration);
hbaseAdmin.createTable(htable);
如果能夠從hbase shell創建hbase表,那么hbase運行良好,您可以通過在代碼中指定zookeeper仲裁來修改代碼。
Configuration hbaseConfiguration = HBaseConfiguration.create();
hbaseConfiguration.addResource("<HBASE_CONF_DIR_PATH>/hbase-site.xml");
要么
Configuration hbaseConfiguration = HBaseConfiguration.create();
hbaseConfiguration.set("hbase.zookeeper.quorum","<ZK-QUORUM>");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.