我是新手,并试图在版本为1.3.1的Amazon集群上安装spark . 当我做
SparkConf sparkConfig = new SparkConf().setAppName("SparkSQLTest").setMaster("local[2]");
它对我有用,但我知道这是为了测试目的我可以设置本地[2]
当我尝试使用群集模式时,我将其更改为
SparkConf sparkConfig = new SparkConf().setAppName("SparkSQLTest").setMaster("spark://localhost:7077");
有了这个我得到低于错误
试图与无法访问的远程地址关联[akka.tcp:// sparkMaster @ localhost:7077] . 地址现在被封闭了5000毫秒,所有发送到此地址的消息都将被发送到死信 . 原因:连接被拒绝15/06/10 15:22:21 INFO client.AppClient $ ClientActor:连接到master akka.tcp:// sparkMaster @ localhost:7077 / user / Master ..
有人可以让我如何设置主网址 .
1 回答
如果您正在使用https://github.com/awslabs/emr-bootstrap-actions/tree/master/spark中的引导操作,则会在YARN上为Spark设置配置 . 所以只需将master设置为
yarn-client
或yarn-cluster
. 确保定义具有内存和内核的执行程序的数量 . 有关Spark on YARN的更多详情,请致电https://spark.apache.org/docs/latest/running-on-yarn.htmlAddition regarding executor settings for memory and core sizing:
查看http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/TaskConfiguration_H2.html中每种类型的默认YARN节点管理器配置,特别是
yarn.scheduler.maximum-allocation-mb
. 您可以从基本EC2信息URL(http://aws.amazon.com/ec2/instance-types/)确定核心数 . 执行程序内存的最大大小必须符合最大分配,减去Spark的开销,增量为256MB . 这个计算的一个很好的描述是在http://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-2/ . 不要忘记,执行程序内存的一半以上可以用于RDD缓存 .