使用JanusGraph Java API和HBase时出现TemporaryBackendException

时间:2018-06-26 08:04:02

标签: java hbase janusgraph

我正在使用JanusGraph Java API,并将HBase作为存储后端

我要提到的一件事是,我可以在JanusGraph shell gremlin.sh

中成功运行相同的命令

下面是错误之前的日志,该日志在打开图实例JanusGraphFactory.open(jg.properties)

期间发生
07:20:46.169 [main-SendThread(cdh-master1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - 
Reading reply sessionid:0x263f89ba9d56ce2, 
packet:: clientPath:null serverPath:null finished:false header:: 3,8  replyHeader:: 3,55834924519,0  
request:: '/hbase,F  response:: v{'replication,'meta-region-server,'rs,'splitWAL,'backup-masters,
'table-lock,'flush-table-proc,'region-in-transition,'online-snapshot,'master,'running,'recovering-regions,'draining,'namespace,'hbaseid,'table} 
07:20:46.182 [main] WARN  o.j.d.hbase.HBaseStoreManager - Unexpected exception during getDeployment()

,错误是

java.lang.RuntimeException: org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
at org.janusgraph.diskstorage.hbase.HBaseStoreManager.getDeployment(HBaseStoreManager.java:364) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
at org.janusgraph.diskstorage.hbase.HBaseStoreManager.getFeatures(HBaseStoreManager.java:403) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1377) [jar:rsrc:janusgraph-core-0.2.0.jar!/:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:164) [jar:rsrc:janusgraph-core-0.2.0.jar!/:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:133) [jar:rsrc:janusgraph-core-0.2.0.jar!/:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:80) [jar:rsrc:janusgraph-core-0.2.0.jar!/:na]

我对这个TemporaryBackendException一无所知,以前有没有人见过这个?

janusgraph配置的一部分是

gremlin.graph=org.janusgraph.core.JanusGraphFactory
cluster.max-partitions=64
storage.backend=hbase
storage.batch-loading=true
storage.hostname=cdh-master1,cdh-master2,cdh-master3

其中cdh-master1,2,3是Zookeeper仲裁,版本JanusGraph 2.0,HBase 1.2

完整堆栈跟踪为

at my.graph.Graph.<clinit>(Graph.java:7) [rsrc:./:na]
at my.graph.App.main(App.java:24) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) [janus.jar:na]
Caused by: org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
at org.janusgraph.diskstorage.hbase.HBaseStoreManager.ensureTableExists(HBaseStoreManager.java:739) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
at org.janusgraph.diskstorage.hbase.HBaseStoreManager.getLocalKeyPartition(HBaseStoreManager.java:524) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
at org.janusgraph.diskstorage.hbase.HBaseStoreManager.getDeployment(HBaseStoreManager.java:361) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
... 12 common frames omitted
Caused by: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.<init>()V from class org.apache.hadoop.hbase.zookeeper.MetaTableLocator
at org.apache.hadoop.hbase.client.RpcRetryingCaller.translateException(RpcRetryingCaller.java:229) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:202) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:320) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:295) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:160) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:155) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:821) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:303) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.janusgraph.diskstorage.hbase.HBaseAdmin1_0.tableExists(HBaseAdmin1_0.java:111) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
at org.janusgraph.diskstorage.hbase.HBaseStoreManager.ensureTableExists(HBaseStoreManager.java:716) ~[jar:rsrc:janusgraph-hbase-0.2.0.jar!/:na]
... 14 common frames omitted
Caused by: java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.<init>()V from class org.apache.hadoop.hbase.zookeeper.MetaTableLocator
at org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:596) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:580) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:559) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getMetaRegionLocation(ZooKeeperRegistry.java:61) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateMeta(ConnectionManager.java:1185) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1152) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:300) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:151) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:59) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200) ~[jar:rsrc:hbase-client-1.1.2.jar!/:na]
... 24 common frames omitted
我的pom.mxl中包括依赖项信息的

部分是

<dependency>
    <groupId>org.janusgraph</groupId>
    <artifactId>janusgraph-core</artifactId>
    <version>0.2.0</version>
</dependency>
<dependency>
    <groupId>org.janusgraph</groupId>
    <artifactId>janusgraph-hbase</artifactId>
    <version>0.2.0</version>
</dependency>
<dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase-client</artifactId>
    <version>1.1.2</version>
</dependency>

1 个答案:

答案 0 :(得分:2)

我之前发布了一个答案here

这是Guava版本冲突的问题。由于列出了特定的依赖性以及这些依赖性的顺序,JanusGraph HBase example不会遇到Guava版本错误。

    <dependency>
        <groupId>org.janusgraph</groupId>
        <artifactId>janusgraph-hbase</artifactId>
        <version>${project.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-shaded-client</artifactId>
        <version>${hbase100.version}</version>
        <scope>runtime</scope>
    </dependency>

请注意hbase-shaded-clienthbase-client(用Issue #512固定)的用法,而不是pom.xml中的用法,hbase-shaded-client具有用于HBase的带阴影版本的Guava。阴影重命名了某些依赖项的软件包名称,这使您可以在类路径上使用不同版本的Guava,而不会引起冲突。

Gremlin控制台也使用lib,您可以在发行版的(?<![[:lower:]])[[:lower:]]{5}(?![[:lower:]])目录中找到该jar。