我是Spark的新手,我正尝试将我的spring spark申请提交到纱线簇。 spark配置在春季初始化,但在提交时未获取纱线详细信息,并且始终指向局部。我知道缺少要设置的一些配置。
使用的代码如下所示:
SparkConf sparkconf = new SparkConf().setAppName("app name")
.set("spark.port.maxRetries", "100")
.set("spark.ui.port", "4060")
.set("spark.executor.memory", "7g")
.set("spark.executor.cores", "2")
.set("SPARK_YARN_MODE", "true")
.setSparkHome("spark home directory")
.set("SPARK_JAR_HDFS_PATH", "directory of spark-assembly.jar")
.set("SPARK_CONF_DIR", "config directory")
.setMaster("yarn-client");
如下记录,尝试以本地模式运行,[o.a.h.y.c.RMProxy:56]通过/0.0.0.0:8032连接到ResourceManager
Config used,
conf.addResource(new Path(filepath+ "/hbase-site.xml"));
conf.addResource(new Path(filepath+ "/core-site.xml"));
conf.addResource(new Path(filepath+ "/hdfs-site.xml"));
conf.addResource(new Path(filepath+ "/yarn-site.xml"));
原因是因为未正确拾取资源路径中提到的配置文件,尤其是yarn-site.xml文件,所以清理并重建了项目以解决问题。