我在 4 个虚拟机上安装了 hadoop 3.1.0 和 spark 2.4.7。我总共有 32 个内核,128G 内存。我一直在运行 spark-shell 测试
[hadoop@hadoop1 bin]$hadoop fs -mkdir -p /user/hadoop/testdata
[hadoop@hadoop1 bin]$hadoop fs -put /app/hadoop/hadoop-2.2.0/etc/hadoop/core-site.xml /user/hadoop/testdata
[hadoop@hadoop1 bin]$ spark-shell --master spark://hadoop1:7077
scala>val rdd=sc.textFile("hdfs://hadoop1:9000/user/hadoop/testdata/core-site.xml")
scala>rdd.cache()
scala>val wordcount=rdd.flatMap(_.split(" ")).map(x=>(x,1)).reduceByKey(_+_)
scala>wordcount.take(10)
scala>val wordsort=wordcount.map(x=>(x._2,x._1)).sortByKey(false).map(x=>(x._2,x._1))
scala>wordsort.take(10)
我一直在玩以下参数
spark.core.connection.ack.wait.timeout 600s
spark.default.parallelism 4
spark.driver.memory 6g
spark.executor.memory 6g
spark.cores.max 21
spark.executor.cores 3
撞到org.apache.spark.shuffle.FetchFailedException Failed to connect 192.168.0.XXX
或WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
是否有微调这些参数和任何其他参数的一般指南?