具有Hbase 2.0.x和2.1.x的JanusGraph

时间:2019-03-27 10:20:45

标签: hbase janusgraph

我试图弄清楚如何用Hbase 2.0.x或2.1.x插入janusGraph

我在https://github.com/JanusGraph/janusgraph/issues/915中看到,在0.3.1版本中有可能,但默认情况下未启用。

我试图测试它是否在使用hbase表创建过程中卡住了:

  

线程“主”中的异常java.lang.NoSuchMethodError:org.apache.hadoop.hbase.client.Admin.createTable(Lorg / apache / hadoop / hbase / HTableDescriptor;)V       在org.janusgraph.diskstorage.hbase.HBaseAdmin1_0.createTable(HBaseAdmin1_0.java:117)       在org.janusgraph.diskstorage.hbase.HBaseStoreManager.createTable(HBaseStoreManager.java:780)       在org.janusgraph.diskstorage.hbase.HBaseStoreManager.ensureTableExists(HBaseStoreManager.java:744)       在org.janusgraph.diskstorage.hbase.HBaseStoreManager.getLocalKeyPartition(HBaseStoreManager.java:536)       在org.janusgraph.diskstorage.hbase.HBaseStoreManager.getDeployment(HBaseStoreManager.java:375)       在org.janusgraph.diskstorage.hbase.HBaseStoreManager.getFeatures(HBaseStoreManager.java:417)       在org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration。(GraphDatabaseConfiguration.java:1256)       在org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:160)       在org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:131)       在org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:121)       在org.janusgraph.core.JanusGraphFactory $ Builder.open(JanusGraphFactory.java:260)

如何启用Hbase 2.0支持?

这是我的代码示例:

public static void main(String[] args) throws BackendException {
        JanusGraph graph = JanusGraphFactory.build()
                .set("storage.backend", "hbase")
                .set("gremlin.graph", "org.janusgraph.core.JanusGraphFactory")
                .set("storage.hostname", "vmdev")
                .set("cache.db-cache", "true")
                .set("cache.db-cache-clean-wait","20")
                .set("cache.db-cache-time","180000")
                .set("cache.db-cache-size", "0.5").open();
        GraphTraversalSource g = graph.traversal();
        if (g.V().count().next() == 0) {
            tracer.info("empty graph, building DM");
            buildDM(graph);
        }
        System.exit(0);

    }

1 个答案:

答案 0 :(得分:1)

您是否尝试过使用最新版本?最新版本说明指出,它们支持HBase 2.1 https://docs.janusgraph.org/latest/version-compat.html

大约2.0,我不确定,但是我将对其进行测试。我的同事声称,我们以前曾运行过HBase 2.0,但它确实有效...