【问题标题】:Error creating table in HBase在 HBase 中创建表时出错
【发布时间】:2014-06-30 04:10:57
【问题描述】:

我是 hbase 的新手,并尝试使用以下命令在 hortonworks 沙盒 hbase shell 中创建一个表:

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 语句不起作用?这个语法有问题吗?

【问题讨论】:

    标签: hbase hortonworks-data-platform


    【解决方案1】:

    您是在本地安装 HBase,还是安装在集群上。如果是前者,您是否使用 start-hbase.sh 脚本启动了 HBase。如果是后者,则必须同时启动 HBase 和 Zookeeper。

    【讨论】:

    • 不,我没有在本地安装它,HBase 预装在 VM 上,我也没有集群,只有笔记本电脑上的 virtualbox 中的一个虚拟设备。我找不到 start-hbase.sh 脚本,我还应该尝试什么?
    • 好的。那么您使用的是 Cloudera 虚拟机还是 Hortonworks 虚拟机?如果您使用的是 Cloudera,那么您应该可以访问 Cloudera Manager,它会告诉您服务的状态。
    • 能否请您在终端中尝试jps | grep HMaster 并告诉我输出是什么?
    • 当我尝试 jps | grep HMaster,它没有给出任何输出,它只是转到下一行,所以我尝试了 2 个竖线,所以输出如下: [root@sandbox ~]# jps || grep的HMASTER 2883 JobHistoryServer 2003 QuorumPeerMain 2160 NFS3数据管理部1678 4289个3046 JPS 2761 RunJar 2150 ApplicationHistoryServer 1410端口映射2763 ldap.jar ResourceManager的2765节点管理器1682 SecondaryNameNode 3296 gateway.jar 1995引导程序2516 RunJar 1689的NameNode 2603 RunJar 3995 RunJar [根@沙箱〜]#JPS | grep HMaster [root@sandbox ~]# [/code]
    • 基本上 HBase 没有运行。您需要在线搜索它在 HDP 虚拟机上的位置。
    【解决方案2】:

    尝试在您的本地主机上进入 Ambari 并登录。单击 HBASE,然后在摘要下单击 ActiveHbaseMaster。然后只需从左侧的列启动 ActiveHbaseMaster 和 RegionServer / Hbase!这对我有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-10
      • 1970-01-01
      • 2017-08-06
      • 1970-01-01
      相关资源
      最近更新 更多