【问题标题】:Why Apache Ignite (version 2.3.0) Spark SharedRDD forgot some (20-30%) of entries为什么 Apache Ignite(2.3.0 版)Spark SharedRDD 忘记了一些(20-30%)条目
【发布时间】:2018-05-14 18:37:00
【问题描述】:

我在 Docker 中有一个 Spark 集群,有 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)
...

有人知道为什么会这样吗?

【问题讨论】:

    标签: scala apache-spark ignite


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-25
      • 1970-01-01
      • 2016-07-02
      • 1970-01-01
      • 1970-01-01
      • 2018-07-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多