2017-05-05 98 views
5

我在單臺機器上運行帶有Spark(1.6.1)的JanusGraph(0.1.0)。 我的配置如here所述。 當使用SparkGraphComputer訪問gremlin控制檯上的圖時,它始終爲空。我在日誌文件中找不到任何錯誤,它只是一個空圖。爲Spark集羣和Cassandra設置和配置JanusGraph

是否有人使用JanusGraph和Spark並可以分享他的配置和屬性?

使用JanusGraph,我得到預期的輸出:

gremlin> graph=JanusGraphFactory.open('conf/test.properties') 
==>standardjanusgraph[cassandrathrift:[127.0.0.1]] 
gremlin> g=graph.traversal() 
==>graphtraversalsource[standardjanusgraph[cassandrathrift:[127.0.0.1]], standard] 
gremlin> g.V().count() 
14:26:10 WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [()]. For better performance, use indexes 
==>1000001 
gremlin> 

使用HadoopGraph星火爲GraphComputer,圖形是空的:

gremlin> graph=GraphFactory.open('conf/test.properties') 
==>hadoopgraph[cassandrainputformat->gryooutputformat] 
gremlin> g=graph.traversal().withComputer(SparkGraphComputer) 
==>graphtraversalsource[hadoopgraph[cassandrainputformat->gryooutputformat], sparkgraphcomputer] 
gremlin> g.V().count() 
      ==>0==============================================> (14 + 1)/15] 

我的conf/test.properties:

# 
# Hadoop Graph Configuration 
# 
gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph 
gremlin.hadoop.graphInputFormat=org.janusgraph.hadoop.formats.cassandra.CassandraInputFormat 
gremlin.hadoop.graphOutputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat 
gremlin.hadoop.memoryOutputFormat=org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat 
gremlin.hadoop.memoryOutputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat 

gremlin.hadoop.deriveMemory=false 
gremlin.hadoop.jarsInDistributedCache=true 
gremlin.hadoop.inputLocation=none 
gremlin.hadoop.outputLocation=output 

# 
# Titan Cassandra InputFormat configuration 
# 
janusgraphmr.ioformat.conf.storage.backend=cassandrathrift 
janusgraphmr.ioformat.conf.storage.hostname=127.0.0.1 
janusgraphmr.ioformat.conf.storage.keyspace=janusgraph 
storage.backend=cassandrathrift 
storage.hostname=127.0.0.1 
storage.keyspace=janusgraph 

# 
# Apache Cassandra InputFormat configuration 
# 
cassandra.input.partitioner.class=org.apache.cassandra.dht.Murmur3Partitioner 
cassandra.input.keyspace=janusgraph 
cassandra.input.predicate=0c00020b0001000000000b000200000000020003000800047fffffff0000 
cassandra.input.columnfamily=edgestore 
cassandra.range.batch.size=2147483647 

# 
# SparkGraphComputer Configuration 
# 
spark.master=spark://127.0.0.1:7077 
spark.serializer=org.apache.spark.serializer.KryoSerializer 
spark.executor.memory=100g 

gremlin.spark.persistContext=true 
gremlin.hadoop.defaultGraphComputer=org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer 

HDFS似乎配置正確here

gremlin> hdfs 
==>storage[DFS[DFSClient[clientName=DFSClient_NONMAPREDUCE_178390072_1, ugi=cassandra (auth:SIMPLE)]]] 

回答

5

嘗試修復這些屬性:

janusgraphmr.ioformat.conf.storage.keyspace=janusgraph 
storage.keyspace=janusgraph 

替換:

janusgraphmr.ioformat.conf.storage.cassandra.keyspace=janusgraph 
storage.cassandra.keyspace=janusgraph 

默認密鑰空間的名稱爲janusgraph,所以儘管在屬性名稱的錯誤,我不除非您使用不同的密鑰空間名稱加載數據,否則您會發現該問題。

後面的屬性在Configuration Reference中描述。另外,請留意此open issue以改進Hadoop-Graph使用的文檔。