linux “内存低于1 MB,或在内存规格末尾缺少M/G”的原因是什么?

whhtz7ly  于 2022-11-22  发布在  Linux
关注(0)|答案(1)|浏览(148)

我正在我的Linux操作系统上构建一个spark集群。但当我使用./sbin/start-all.sh启动它时,从节点发生了以下错误。

Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
Exception in thread "main" java.lang.IllegalStateException: Memory is below 1MB, or missing an M/G at the end of the memory specification?
        at org.apache.spark.deploy.worker.WorkerArguments.checkWorkerMemory(WorkerArguments.scala:181)
        at org.apache.spark.deploy.worker.WorkerArguments.<init>(WorkerArguments.scala:66)
        at org.apache.spark.deploy.worker.Worker$.main(Worker.scala:742)
        at org.apache.spark.deploy.worker.Worker.main(Worker.scala)

我检查了环境配置cat /etc/profile并重新加载了它source /etc/profile
以下是www.example.com的内容spark-env.sh

export JAVA_HOME=/root/apps/jdk1.8.0_60
export SCALA_HOME=/root/apps/scala
export SPARK_MASTER_HOST=hdp-01
export SPARK_WORKER_MEMORY=512
export SPARK_WORKER_CORES=2
export SPARK_WORKER_INSTANCES=1
export SPARK_MASTER_PORT=7077

但我没有发现任何问题,我能做些什么来解决它呢?

mbyulnm0

mbyulnm01#

我试着研究配置文件,发现一些配置项是错误的。

  1. SPARK_WORKER_MEMORY,设置工作进程必须为执行器提供的总内存量(例如1000 m、2g)。
  2. SPARK_MASTER_OPTS,仅为主设备设置配置属性(例如“-Dx=y”)。
  3. SPARK_WORKER_CORES,设置要在此计算机上使用的内核数。...
    因此我将配置修改为:
export SPARK_WORKER_MEMORY=512M
    export SPARK_WORKER_CORES=2
    #export SPARK_WORKER_INSTANCES=1  # default 1
    #export SPARK_MASTER_PORT=7077    # default 7077

相关问题