2014-06-30 58 views
0
創建表

我是新來HBase的,並試圖建立與下面的命令hortonworks沙箱殼的HBase表:錯誤在HBase的

create 'testtable', 'colfam1' 

這樣做時,我不斷收到此錯誤:

hbase(main):002:0> create 'testtable', 'colfam1' 

ERROR: Can't get master address from ZooKeeper; znode data == null 

Here is some help for this command: 
Creates a table. Pass a table name, and a set of column family 
specifications (at least one), and, optionally, table configuration. 
Column specification can be a simple string (name), or a dictionary 
(dictionaries are described below in main help output), necessarily 
including NAME attribute. 
Examples: 

hbase> create 't1', {NAME => 'f1', VERSIONS => 5} 
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'} 
hbase> # The above in shorthand would be the following: 
hbase> create 't1', 'f1', 'f2', 'f3' 
hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => 
true } 
hbase> create 't1', {NAME => 'f1', CONFIGURATION =>  
{'hbase.hstore.blockingStoreFiles' => '10'}} 
Table configuration options can be put at the end. 
Examples: 

hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40'] 
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe' 
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 
'myvalue' } 
hbase> # Optionally pre-split the table into NUMREGIONS, using 
hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname) 
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'} 
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit',  
REGION_REPLICATION => 2, CONFIGURATION => REGION_REPLICATION => 2, CONFIGURATION = 
=> {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}} 

You can also keep around a reference to the created table: 

hbase> t1 = create 't1', 'f1' 

Which gives you a reference to the table named 't1', on which you can then 
call methods. 

我複製這條線直接從HBase的權威指南,那麼爲什麼不在create聲明的工作?該語法有什麼問題嗎?

回答

0

您是在本地安裝HBase還是安裝在羣集上?如果是前者,是否使用start-hbase.sh腳本啓動HBase?如果是後者,則必須啓動HBase和Zookeeper。

+0

不,我沒有在本地安裝,HBase預安裝在虛擬機上,我也沒有集羣,只有一個虛擬設備在我的筆記本電腦上。我找不到start-hbase.sh腳本,還有什麼我應該嘗試的? – nickshoe

+0

好的。那麼你使用的是Cloudera VM還是Hortonworks?如果您使用的是Cloudera,那麼您應該可以訪問Cloudera Manager,它會告訴您服務的狀態。 – aa8y

+0

不,這是Hortonworks,那麼我應該怎麼做呢? – nickshoe

0

嘗試進入您的locahost中的Ambari並登錄。單擊HBASE,然後在摘要下單擊ActiveHbaseMaster。然後只需從左側的列中啓動ActiveHbaseMaster和RegionServer/Hbase!這對我有用