CDH yarn Fair 队列最大资源使用限制,任务无法提交

一、问题背景描述

1.任务提交异常日志

2023-06-29 15:48:20,877 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:21,129 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:21,381 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:21,633 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:21,885 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:22,137 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:22,389 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:22,641 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2023-06-29 15:48:22,894 INFO  org.apache.flink.yarn.YarnClusterDescriptor  [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster

 2.问题描述

集群剩余资源:集群可用为180cpu、可用内存为228GB,当前只剩余196G内存、120G内存。

还剩余32G内存、60cpu,却无法继续提交任务,异常日志上图所示。

 

二、处理过程

1.描述

     默认情况,Fair队列资源使用策略,  不能使用全部队列资源,有个公式可以计算。以下是我粗暴的解决问题赶进度了。 后续有时间在细细研究了!  其他更多详细解释可以参考这位博主的文章 yarn队列之fair队列 、YARN三种资源调度器解析

2.操作

可通过在cdh yarn的配置输入框 搜索 “MaxAMShare” 关键词,结果如下

 fair 配置文件格式化后如下:

{
    "defaultFairSharePreemptionThreshold":null,
    "defaultFairSharePreemptionTimeout":null,
    "defaultMinSharePreemptionTimeout":null,
    "defaultQueueSchedulingPolicy":"fair",
    "queueMaxAMShareDefault":1,
    "queueMaxAppsDefault":null,
    "queuePlacementRules":[
        {
            "create":true,
            "name":"specified",
            "queue":null,
            "rules":null
        },
        {
            "create":true,
            "name":"nestedUserQueue",
            "queue":null,
            "rules":[
                {
                    "create":true,
                    "name":"default",
                    "queue":"users",
                    "rules":null
                }
            ]
        },
        {
            "create":null,
            "name":"default",
            "queue":null,
            "rules":null
        }
    ],
    "queues":[
        {
            "aclAdministerApps":"*",
            "aclSubmitApps":"*",
            "allowPreemptionFrom":null,
            "fairSharePreemptionThreshold":null,
            "fairSharePreemptionTimeout":null,
            "minSharePreemptionTimeout":null,
            "name":"root",
            "queues":[
                {
                    "aclAdministerApps":null,
                    "aclSubmitApps":null,
                    "allowPreemptionFrom":null,
                    "fairSharePreemptionThreshold":null,
                    "fairSharePreemptionTimeout":null,
                    "minSharePreemptionTimeout":null,
                    "name":"users",
                    "queues":[
                        {
                            "aclAdministerApps":null,
                            "aclSubmitApps":null,
                            "allowPreemptionFrom":null,
                            "fairSharePreemptionThreshold":null,
                            "fairSharePreemptionTimeout":null,
                            "minSharePreemptionTimeout":null,
                            "name":"admin",
                            "queues":[

                            ],
                            "schedulablePropertiesList":[
                                {
                                    "impalaClampMemLimitQueryOption":null,
                                    "impalaDefaultQueryMemLimit":null,
                                    "impalaDefaultQueryOptions":null,
                                    "impalaMaxMemory":null,
                                    "impalaMaxQueryMemLimit":null,
                                    "impalaMaxQueuedQueries":null,
                                    "impalaMaxRunningQueries":null,
                                    "impalaMinQueryMemLimit":null,
                                    "impalaQueueTimeout":null,
                                    "maxAMShare":1,
                                    "maxChildResources":null,
                                    "maxResources":null,
                                    "maxRunningApps":null,
                                    "minResources":null,
                                    "scheduleName":"default",
                                    "weight":100
                                }
                            ],
                            "schedulingPolicy":"drf",
                            "type":null
                        }
                    ],
                    "schedulablePropertiesList":[
                        {
                            "impalaClampMemLimitQueryOption":null,
                            "impalaDefaultQueryMemLimit":null,
                            "impalaDefaultQueryOptions":null,
                            "impalaMaxMemory":null,
                            "impalaMaxQueryMemLimit":null,
                            "impalaMaxQueuedQueries":null,
                            "impalaMaxRunningQueries":null,
                            "impalaMinQueryMemLimit":null,
                            "impalaQueueTimeout":null,
                            "maxAMShare":1,
                            "maxChildResources":null,
                            "maxResources":null,
                            "maxRunningApps":null,
                            "minResources":null,
                            "scheduleName":"default",
                            "weight":1
                        }
                    ],
                    "schedulingPolicy":"drf",
                    "type":"parent"
                }
            ],
            "schedulablePropertiesList":[
                {
                    "impalaClampMemLimitQueryOption":null,
                    "impalaDefaultQueryMemLimit":null,
                    "impalaDefaultQueryOptions":null,
                    "impalaMaxMemory":null,
                    "impalaMaxQueryMemLimit":null,
                    "impalaMaxQueuedQueries":null,
                    "impalaMaxRunningQueries":null,
                    "impalaMinQueryMemLimit":null,
                    "impalaQueueTimeout":null,
                    "maxAMShare":1,
                    "maxChildResources":null,
                    "maxResources":null,
                    "maxRunningApps":null,
                    "minResources":null,
                    "scheduleName":"default",
                    "weight":1
                }
            ],
            "schedulingPolicy":"drf",
            "type":null
        }
    ],
    "userMaxAppsDefault":null,
    "users":[

    ]
}

关键配置修改:我主要是对 "queues":[]中相关maxAMShare 参数的修改为1,表示可以全部使用分配给队列的资源。以上是我的修改。修改后,保存即可!

3.修改后,重新继续提交资源,正常提交所有资源

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: 要将作业提交CDH6.3.2的YARN集群上,需要使用以下命令: ``` spark-submit --master yarn --deploy-mode client --class <main-class> <application-jar> <application-arguments> ``` 其中,`<main-class>`是你的应用程序的主类,`<application-jar>`是你的应用程序的jar包路径,`<application-arguments>`是你的应用程序的参数。 例如,如果你的应用程序的主类是`com.example.MyApp`,jar包路径是`/path/to/myapp.jar`,应用程序需要传递两个参数`arg1`和`arg2`,则提交作业的命令如下: ``` spark-submit --master yarn --deploy-mode client --class com.example.MyApp /path/to/myapp.jar arg1 arg2 ``` 提交作业后,Spark将在YARN集群上启动应用程序,并将日志输出到YARN的应用程序日志中。你可以使用YARN的命令行工具或Web UI来监视应用程序的运行状态和日志输出。 ### 回答2: 在CDH6.3.2框架中,使用spark-submit命令可以将作业提交YARN资源管理器,实现分布式部署执行作业的功能。 具体步骤如下: 1. 在终端中使用spark-submit命令,指定主类名、执行参数等信息。 例如: ```bash spark-submit \ --class org.apache.spark.examples.SparkPi \ --master yarn \ --deploy-mode cluster \ --num-executors 3 \ --driver-memory 4g \ --executor-memory 2g \ --executor-cores 2 \ /path/to/examples.jar 100 ``` --class参数指定执行的主类名,对应的jar文件已经上传至HDFS上。 --master参数指定使用YARN作为资源管理器,--deploy-mode参数指定执行模式为集群模式。 --num-executors参数指定申请的Executor个数。 --driver-memory参数指定Driver进程需要使用的内存大小,同样可以指定Executor进程的内存和核数。 2. 执行以上命令后,YARN资源管理器会为任务分配相应的资源,并启动作业执行。 3. 可以通过YARN界面查看作业的运行状况,包括Container的个数、启动时间、资源使用情况等。 4. 执行完成后,可以在日志文件和任务的输出目录中查看作业的输出结果。 总的来说,通过spark-submit命令提交作业到YARN非常方便,只需指定相应的参数即可实现作业的分布式部署,提高执行效率并节省时间。 ### 回答3: CDH 6.3.2 是包含了 Hadoop、Hive、Spark 等组件的大数据平台。要提交 Spark 作业到 YARN 集群,需要使用 spark-submit 命令。 首先,要确保已经安装了 CDH 6.3.2 和 Spark。然后,在本地编写好 Spark 作业代码,并上传到集群中的一个路径。 接下来,通过以下命令提交 Spark 作业: ``` spark-submit \ --class com.example.YourMainClass \ --master yarn \ --deploy-mode client \ --num-executors 4 \ --executor-memory 4g \ --executor-cores 2 \ /path/to/your/spark/job.jar \ arg1 arg2 ``` 其中,`--class` 参数指定主类,`--master yarn` 表示使用 YARN 集群作为 Spark 的资源管理器,`--deploy-mode client` 表示客户端模式, `--num-executors`、`--executor-memory` 和 `--executor-cores` 分别是设定 Spark 应用程序执行所需的 executor 数量、每个 executor 占用的内存和 CPU 核心数量。`/path/to/your/spark/job.jar` 是你上传的 Spark 作业包的路径,`arg1` 和 `arg2` 是你的应用程序所需要的参数。 提交成功后,Spark 应用程序就会在 YARN 上执行,输出结果会被打印到标准输出中或者存储到指定路径。 需要注意的是,提交的 Spark 作业路径和参数是相对于 YARN 集群上的路径和参数,而不是本地路径和参数。另外,如果采用了集群管理工具 Cloudera Manager 管理 CDH 6.3.2,也可以通过其提供的界面来提交 Spark 作业,更加方便快捷。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

潘永青

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值