我在
上运行了一个火花丛spark://host1:7077
spark://host2:7077
spark://host3:7077
并通过/bin/spark-shell --master spark://host1:7077
连接
尝试使用以下内容读取文件时
val textFile = sc.textFile("README.md")
textFile.count()
提示说
WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
在host1:8080
上通过Web ui检查时显示:
Workers: 0
Cores: 0 Total, 0 Used
Memory: 0.0 B Total, 0.0 B Used
Applications: 0 Running, 2 Completed
Drivers: 0 Running, 0 Completed
Status: ALIVE
我的问题是如何在spark-shell集群模式下运行时指定内核和内存?或者我必须将我的scala代码打包到.jar
文件中,然后将作业提交给spark?
由于