【问题标题】:Unable to launch the receivers in preferred location in spark streaming application无法在火花流应用程序的首选位置启动接收器
【发布时间】:2016-12-24 08:17:55
【问题描述】:

我计划在首选位置发射接收器。我有一个带有 10 个工作节点的 spark 独立集群。我想按照我的规范在所有工作节点中启动 4 个接收器。为此,我在客户接收器中使用以下代码。

@Override
public scala.Option<String> preferredLocation(){
    scala.Option<String> test = null;
    if(this.id == 0 || this.id == 1 || this.id == 2){
        test =  scala.Option.apply("abc1");
    }
    else if(this.id == 3 || this.id == 4 || this.id == 5){
        test =  scala.Option.apply("abc2");
    }
    else if(this.id == 6 || this.id == 7 ){
        test =  scala.Option.apply("abc3");
    }else{
        test =  scala.Option.apply("abc4");
    }
    return test;
}

上面的 id 变量将由驱动程序在启动接收器时设置。 到目前为止,我对主机名进行了硬编码。但我观察到,接收器没有在指定的位置(主机)启动。 Spark 版本是 2.0.1。

【问题讨论】:

    标签: spark-streaming


    【解决方案1】:

    我已将主机名替换为 IP 地址。然后问题就解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-05
      • 1970-01-01
      • 1970-01-01
      • 2015-04-16
      相关资源
      最近更新 更多