Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache spark Janusgraph+;卡桑德拉公司;ES群集作为后端+;Spark cluster作为分析工具。拓扑学;配置_Apache Spark_Cassandra_Cluster Computing_Tinkerpop3_Janusgraph - Fatal编程技术网

Apache spark Janusgraph+;卡桑德拉公司;ES群集作为后端+;Spark cluster作为分析工具。拓扑学;配置

Apache spark Janusgraph+;卡桑德拉公司;ES群集作为后端+;Spark cluster作为分析工具。拓扑学;配置,apache-spark,cassandra,cluster-computing,tinkerpop3,janusgraph,Apache Spark,Cassandra,Cluster Computing,Tinkerpop3,Janusgraph,我使用链接来设置我的拓扑。我的拓扑结构如下: 虚拟机: 第三点: 每个芯8个 RAM每个16GB 以下是虚拟机的拓扑及其每个虚拟机的组件: 注:在下图中,“主”与“IP X”相同 请注意,根据linked post,Janusgraph 0.2.0不需要hdfs,因为它使用了TP 3.2.6,从而消除了hdfs作为中间存储的使用 现在,如果我的理解是正确的,当我使用Janusgraph将数据推送到我的Cassandra集群时,我们将其复制因子保持为3,这样就可以跨Cassandra的所有节点复

我使用链接来设置我的拓扑。我的拓扑结构如下:

虚拟机: 第三点: 每个芯8个 RAM每个16GB

以下是虚拟机的拓扑及其每个虚拟机的组件:

注:在下图中,“主”与“IP X”相同

请注意,根据linked post,Janusgraph 0.2.0不需要hdfs,因为它使用了TP 3.2.6,从而消除了hdfs作为中间存储的使用

现在,如果我的理解是正确的,当我使用Janusgraph将数据推送到我的Cassandra集群时,我们将其复制因子保持为3,这样就可以跨Cassandra的所有节点复制数据,Spark workers就可以在这些节点上工作

考虑到这一点,我使用下面的属性文件,基于集群Cassandra+Elasticsearch将数据推送到Janusgraph中:

gremlin.graph=org.janusgraph.core.JanusGraphFactory

storage.backend=cassandrathrift
storage.hostname=IP A, IP B, IP C
storage.cassandra.keyspace=testDev
storage.cassandra.replication-factor=3 

index.search.backend=elasticsearch
index.search.hostname=IP A, IP B, IP C
index.search.elasticsearch.client-only=true
数据推送成功,我进行了以下检查以验证:

cqlsh shows keyspace with name testDec
when using same properties file, and doing OLTP based g.V().count, it returns me correctly.
现在,我想把火花图形计算机引入到这个组合中。我测试了一个本地Spark实例,该实例运行并针对cassandra+elasticsearch执行OLAP,所有这些都在单个VM中本地托管。它工作得很好,虽然对于我的测试数据来说速度非常慢,但还行。但当我将cassandra集群引入mix时,我的spark作业/任务simple并没有启动(从UI推断)

以下是我的属性文件,我使用它从Cassandra后端创建Hadoop图形并对其执行OLAP:

#
# 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.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=none
gremlin.hadoop.outputLocation=output

#
# JanusGraph Cassandra InputFormat configuration
#
janusgraphmr.ioformat.conf.storage.backend=cassandrathrift
janusgraphmr.ioformat.conf.storage.hostname=IP A, IP B, IP C
janusgraphmr.ioformat.conf.storage.cassandra.keyspace=testDev
janusgraphmr.ioformat.cf-name=edgestore

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

#
# SparkGraphComputer Configuration
#
spark.master=spark://IP X:7077
spark.executor.cores=3
spark.executor.memory=6g
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.executorEnv.HADOOP_CONF_DIR=/home/hadoop/hadoop/etc/hadoop
spark.executorEnv.SPARK_CONF_DIR=/home/spark/spark/conf
spark.driverEnv.HADOOP_CONF_DIR=/home/hadoop/hadoop/etc/hadoop
spark.driverEnv.SPARK_CONF_DIR=/home/spark/spark/conf
spark.driver.extraLibraryPath=/home/hadoop/hadoop/lib/native
spark.executor.extraLibraryPath=/home/hadoop/hadoop/lib/native

gremlin.spark.persistContext=true

# Default Graph Computer
gremlin.hadoop.defaultGraphComputer=org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer
在和的帖子之后,看起来我的配置还可以(.properties文件),但每次执行OLAP查询时,我的作业都会丢失。我没有看到任何从UI开始的任务,经过很长一段时间后,我发现了错误

我最初认为我设置spark独立集群的方式有一些错误,但后来我尝试通过从文件系统读取图形来执行OLAP

我使用以下属性读取GraphSON文件:

#
# Hadoop Graph Configuration
#
gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
gremlin.hadoop.graphInputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONInputFormat
gremlin.hadoop.graphOutputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONOutputFormat

gremlin.hadoop.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=/opt/JanusGraph/0.2.0/data/grateful-dead.json
gremlin.hadoop.outputLocation=output

#
# SparkGraphComputer Configuration
#
spark.master=spark://IP X:7077
spark.executor.cores=2
spark.executor.memory=4g
spark.serializer=org.apache.spark.serializer.KryoSerializer
gremlin.spark.persistContext=true

# Default Graph Computer
gremlin.hadoop.defaultGraphComputer=org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer
当我将上述属性文件加载为:

graph = GrpahFactory.open(/conf.properties")
g = graph.traversal().withComputer(SparkGraphComputer)
g.V().count()
它返回预期的输出,我能够看到Spark作业在UI上启动,以及阶段。这实际上意味着Spark OLAP查询成功运行

如果是这样的话,看起来像是建立了与Spark的连接,我无法从底层Cassandra节点读入数据。为什么会这样

任何指示都将不胜感激

如果需要更多信息,请告诉我,同样的信息也可以添加到这里

干杯:-)