1
我有7个datanodes和1个namenode。我们的每个节点都有32 Gb的内存和20个内核。因此,我将容器内存设置为30 Gb,将容器虚拟CPU内核设置为18.为什么只有很少的节点在apache的纱线上工作?
但是,只有三个datanode可以工作,其余datanode不能工作。
下面的代码是我的设置。
/opt/spark/bin/spark-submit \
--master yarn \
--deploy-mode cluster \
--driver-memory 4g \
--driver-cores 18 \
--executor-memory 8g \
--executor-cores 18 \
--num-executors 7 \
Java代码
SQLContext sqlc = new SQLContext(spark);
Dataset<Row> df = sqlc.read()
.format("com.databricks.spark.csv")
.option("inferSchema", "true")
.load(traFile);
df.repartition(PartitionSize); //PartitionSize = 7
df.persist(StorageLevel.MEMORY_ONLY());
这是我的数据信息:
,我尝试下面的命令
sudo -u hdfs hdfs balancer
然而,
在HDFS中有这种叫做“数据局部性”的东西... –
哦,没错。谢谢。 – Navieclipse
但我解决了“数据局部性”的问题,但只有三个datanode工作 – Navieclipse