SparkGraphComputer를 사용하여 클러스터의 Titan 그래프에서 정점 수를 계산할 때 오류가 발생합니다. 나는 어떻게 대처해야할지 모른다. 내 코드에서 tinkerpop 3.1.1-incubating 및 Titan 1.1.0-SNAPSHOT을 사용 중이며 클러스터에서 datastax 커뮤니티 에디션 2.1.11을 설치하고 1.5.2-bin-hadoop2.6을 실행했습니다.SparkGraphComputer를 사용하여 타이탄 그래프에서 꼭짓점을 계산하면 org.apache.spark.SparkException이 발생합니다. 스테이지 실패로 인해 작업이 중단되었습니다.
FulgoraGraphComputer와 OLAP를 OLTP를 사용하여
private void strippedDown() {
// a normal titan cluster
String titanClusterConfig = "titan-cassandra-test-cluster.properties";
// a hadoop graph with cassandra as input and gryo as output
String sparkClusterConfig = "titan-cassandra-test-spark.properties";
String edgeLabel = "blank";
// add a graph
int n = 100;
Graph titanGraph = GraphFactory.open(titanClusterConfig);
Vertex superNode = titanGraph.addVertex(T.label, String.valueOf(0));
for (int i=1;i<n;i++) {
Vertex currentNode = titanGraph.addVertex(T.label, String.valueOf(i));
currentNode.addEdge(edgeLabel,superNode);
}
titanGraph.tx().commit();
//count with titan
Long count = titanGraph.traversal().V().count().next();
System.out.println("The number of vertices in the graph is: "+count);
// count the graph using titan graph computer
count = titanGraph.traversal(GraphTraversalSource.computer(FulgoraGraphComputer.class)).V().count().next();
System.out.println("The number of vertices in the graph is: "+count);
// count the graph using spark graph computer
Graph sparkGraph = GraphFactory.open(sparkClusterConfig);
count = sparkGraph.traversal(GraphTraversalSource.computer(SparkGraphComputer.class)).V().count().next();
System.out.println("The number of vertices in the graph is: "+count);
}
카운트는 정답을 반환 : 함께 최소한의 자바 예를 들어 내 문제를 재현한다. 그러나 SparkGraphComputer를 사용하는 OLAP 카운트는 org.apache.spark.SparkException을 throw합니다. 스테이지 실패로 인해 작업이 중단되었습니다.
재미있는 점은 Titan과 함께 패키지 된 gremlin 콘솔을 통해 유사한 스크립트를 실행하면 다른 오류가 발생합니다. 같은 알고리즘 :
graph = GraphFactory.open('titan-cassandra-test-cluster.properties')
graph.addVertex(T.label,"0")
graph.addVertex(T.label,"1")
graph.addVertex(T.label,"2")
graph.tx().commit()
sparkGraph = GraphFactory.open('titan-cassandra-test-spark.properties')
sparkGraph.traversal(computer(SparkGraphComputer)).V().count()
이 코드는 org.apache.thrift.protocol.TProtocolException: Required field 'keyspace' was not present! Struct: set_keyspace_args(keyspace:null)
을 두 번 던지지만 완료하고 0을 반환합니다.
메일 링리스트에 this article을 알고 있지만 문제를 이해하거나 문제를 해결하는 데 어려움이 있습니다. 아무도 나에게 무슨 일이 일어나고 있고 어떻게 해결할 수 있는지 설명해 주시겠습니까? 아래에 내 구성을 붙여 넣었습니다.
gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
storage.backend=cassandrathrift
storage.hostname=node1
storage.cassandra.keyspace=mindmapstest
storage.cassandra.replication-factor=3
cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.5
및
gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
gremlin.hadoop.graphInputFormat=com.thinkaurelius.titan.hadoop.formats.cassandra.CassandraInputFormat
gremlin.hadoop.graphOutputFormat=org.apache.hadoop.mapreduce.lib.output.NullOutputFormat
gremlin.hadoop.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=none
gremlin.hadoop.outputLocation=none
####################################
# Cassandra Cluster Config #
####################################
titanmr.ioformat.conf.storage.backend=cassandrathrift
titanmr.ioformat.conf.storage.cassandra.keyspace=mindmapstest
titanmr.ioformat.conf.storage.hostname=node1,node2,node3
####################################
# SparkGraphComputer Configuration #
####################################
spark.master=spark://node1:7077
spark.executor.memory=250m
spark.serializer=org.apache.spark.serializer.KryoSerializer
####################################
# Apache Cassandra InputFormat configuration
####################################
cassandra.input.partitioner.class=org.apache.cassandra.dht.Murmur3Partitioner
편집 :이 스크립트 오류를 parameters 당신의 HadoopGraph 구성에 이러한 추가
graph = TitanFactory.open('titan-cassandra-test-cluster.properties')
superNode = graph.addVertex(T.label,"0")
for(i in 1..100) {
currentNode = graph.addVertex(T.label,i.toString())
currentNode.addEdge("blank",superNode)
}
graph.tx().commit()
graph.traversal().V().count()
graph.traversal(computer()).V().count()
sparkGraph = GraphFactory.open('titan-cassandra-test-spark.properties')
sparkGraph.traversal(computer(SparkGraphComputer)).V().count()
일반적으로 속성 파일에'fs.defaultFS'가 없습니다. 대신'gremlin.sh'를 시작하기 전에 classpath에 $ HADOOP_CONF_DIR을 포함시킵니다. 그런 다음 HDFS에 액세스 할 수 있는지 확인하기위한 또 다른 예방책으로, 콘솔을 시작한 후 'hdfs.ls()'를 실행하여 로컬 파일 시스템이 아닌 HDFS의 파일을 나열하는지 확인합니다. –
'cassandra.input. *'속성에 관해서는 올바른 설정 속성이 전달되는 것처럼 보이지 않으므로 타이탄에 버그가있을 가능성이 있습니다. 2 개의 소스 코드 파일 ('ConfigHelper.java'와'CassandraBinaryInputFormat.java')을 참조하여 그들이하는 일을 볼 수 있습니다. 특히, '술어'는 전 범위 스 드리프트 슬라이스 쿼리 술어의 직렬화 된 버전입니다. –