繁体   English   中英

为什么Apache Ignite(版本2.3.0)Spark SharedRDD忘记了一些(20-30%)条目

[英]Why Apache Ignite (version 2.3.0) Spark SharedRDD forgot some (20-30%) of entries

我在Docker中有一个Spark Cluster,有1个Master和2个Worker。 在每个工作者上运行Apache Ignite软件。

如果我打开spark-shell并执行以下命令(我打开缓存存储一些值并从缓存中读出数据):

import org.apache.ignite.spark._
import org.apache.ignite.configuration._
val ic = new IgniteContext(sc, () => new IgniteConfiguration())
val sharedRDD: IgniteRDD[Integer, Integer] = ic.fromCache[Integer, Integer]("partitioned")
sharedRDD.savePairs(sc.parallelize(1 to 100, 10).map(i => (i, i)))
sharedRDD.count

然后我收到:

res3: Long = 100

如果我执行sharedRDD.collect().foreach(println) ,列表中的每个数字对都是100

(1,1)
(2,2)
(3,3)
(4,4)
(5,5)
(6,6)
(7,7)
(8,8)
(9,9)
(10,10)
...
(100,100)

这是完美的。

但是当我退出sys.exit并再次重新打开spark-shell时,执行以下代码(我从缓存中读出数据):

import org.apache.ignite.spark._
import org.apache.ignite.configuration._
val ic = new IgniteContext(sc, () => new IgniteConfiguration())
val sharedRDD: IgniteRDD[Integer, Integer] = ic.fromCache[Integer, Integer]("partitioned")
sharedRDD.count
sharedRDD.collect().foreach(println)

然后结果是

res0: Long = 60

并且缺少一些数字对。 (例如4,9,10)

(1,1)
(2,2)
(3,3)
(5,5)
(6,6)
(7,7)
(8,8)
(11,11)
(12,12)
(13,13)
(14,14)
(15,15)
...

有谁知道为什么会这样?

有一个问题会导致嵌入到执行程序中的节点以服务器模式启动[1],这很可能就是原因所在。 作为一种解决方法,您可以强制IgniteContext以客户端模式启动所有内容:

val ic = new IgniteContext(sc, () => new IgniteConfiguration().setClientMode(true))

当然,这假设您使用单独运行的Ignite群集以独立模式启动。

[1] https://issues.apache.org/jira/browse/IGNITE-5981

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM