gpt4 book ai didi

java - 无法从Java客户端创建HBase模式

转载 作者:行者123 更新时间:2023-12-02 21:01:07 26 4
gpt4 key购买 nike

我正在尝试从Java客户端创建HBase架构,但它引发以下异常:

org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:319)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:156)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:212)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:327)
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:302)
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:167)
at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:162)
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:796)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:408)

使用HBase Shell也是一样。以下是我的代码段:
Configuration conf = HBaseConfiguration.create();
Connection connection = ConnectionFactory.createConnection(conf);
Admin admin = connection.getAdmin();
HTableDescriptor table =new HTableDescriptor(TableName.valueOf("xyz"));
table.addFamily(new HColumnDescriptor("default"));
admin.createTable(table);
admin.close();

可能是什么问题?

最佳答案

您应该在配置中添加Zookeeper(集群)地址

conf.set("hbase.zookeeper.quorum","your.zookeeper.address")

关于java - 无法从Java客户端创建HBase模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43178438/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com