前言
Spark应用程序是粗粒度的,也就是说在提交的时候就得规划好需要多少资源,设定了不合适的资源也会影响整体性能。
这里先说一下Yarn中的两个配置参数:
- yarn.nodemanager.resource.memory-mb 每个nodemanager分配的内存,也就是该节点上YARN可使用的物理内存总量。
官方解释: Amount of physical memory, in MB, that can be allocated for containers. If set to -1 and yarn.nodemanager.resource.detect-hardware-capabilities is true, it is automatically calculated(in case of Windows and Linux). In other cases, the default is 8192MB.
可以分配给容器的物理内存量,单位为MB