kundera/hbase/spring:尝试初始化/更新架构时超时

qybjjes1  于 2021-06-09  发布在  Hbase
关注(0)|答案(1)|浏览(408)

我正在使用springboot创建一个web服务,并希望在hbase中持久化我的数据模型。我想用昆德拉来完成这个任务。但是,我不能让它工作。当启动应用程序时,它会启动、冻结大约一分钟并进入超时状态。以下是我的一些配置片段:
my persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0">
    <persistence-unit name="hbase_pu">
        <provider>com.impetus.kundera.KunderaPersistence</provider>     
        <properties>            
            <property name="kundera.nodes" value="my-hbase-server.example.com"/>
            <property name="kundera.port" value="2181"/>
            <property name="kundera.keyspace" value="mykeyspace"/>
            <property name="kundera.dialect" value="hbase"/>
            <property name="kundera.client.lookup.class" value="com.impetus.client.hbase.HBaseClientFactory" />
            <property name="kundera.ddl.auto.prepare" value="update"/>             
        </properties>       
    </persistence-unit>
</persistence>

实体管理器的配置:

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean();
    return bean;
}

当你试着运行这个程序的时候,它看起来很正常:

... many info outputs ...
2014-12-10 09:07:05.682  INFO 5194 --- [ost-startStop-1] org.apache.zookeeper.ZooKeeper           : Initiating client connection, connectString=my-hbase-server.example.com:2181 sessionTimeout=90000 watcher=hconnection-0x556effa0, quorum=my-hbase-server.example.com:2181, baseZNode=/hbase
2014-12-10 09:07:05.694  INFO 5194 --- [ne002.int:2181)] org.apache.zookeeper.ClientCnxn          : Opening socket connection to server my-hbase-server.example.com/x.x.x.x:2181. Will not attempt to authenticate using SASL (unknown error)
2014-12-10 09:07:05.698  INFO 5194 --- [ne002.int:2181)] org.apache.zookeeper.ClientCnxn          : Socket connection established to my-hbase-server.example.com/x.x.x.x:2181, initiating session
2014-12-10 09:07:05.780  INFO 5194 --- [ne002.int:2181)] org.apache.zookeeper.ClientCnxn          : Session establishment complete on server my-hbase-server.example.com/x.x.x.x:2181, sessionid = 0x14a2e04a4ca001f, negotiated timeout = 40000
2014-12-10 09:07:05.820  INFO 5194 --- [ost-startStop-1] o.a.h.hbase.client.ZooKeeperRegistry     : ClusterId read in ZooKeeper is null

然后,它冻结了大约一分钟,之后,它崩溃了:

2014-12-10 09:08:05.703 ERROR 5194 --- [ost-startStop-1] c.i.c.h.s.HBaseSchemaManager             : Either check for network connection or table isn't in enabled state, Caused by:
... large stack trace, interesting section: ...
Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations
    at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:301)
    at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:131)
    at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:56)
    at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:179)
    at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:287)
    at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:267)
    at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:139)
    at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:134)
    at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:763)
    at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:185)
    at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:86)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isTableAvailable(ConnectionManager.java:919)
    at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable(HBaseAdmin.java:1127)
    at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable(HBaseAdmin.java:1135)
    at com.impetus.client.hbase.schemamanager.HBaseSchemaManager.update(HBaseSchemaManager.java:100)
    ... 165 more

这里出了什么问题?我错过了什么吗?如果是的话,是什么?

gzszwxb4

gzszwxb41#

原来跟Zookeeper有关。hbase的入口点硬编码为 /hbase ,并且我的服务器的入口点不同。但是,昆德拉似乎是不完整的, KunderaCriteriaQuery 有很多 // TODO Auto-generated method stub 以及 return null 不幸的是,它不能用于我的任务。

相关问题