Yarn 生產環境核心配置參數
ResourceManager
配置調度器
yarn.resourcemanager.scheduler.class
默認是容量調度器
ResourceManager處理調度器請求的線程數量
ResourceManager處理client請求的線程數量
yarn.resourcemanager.scheduler.client.thread-count
默認是50
NodeManager
是否讓yarn自己檢測硬件進行配置
yarn.nodemanager.resource.detect-hardware-capabilities
默認是false
類似安裝軟件時的自動安裝
是否將虛擬核數當作CPU核數
配置都是針對某一個NodeManager
yarn.nodemanager.resource.count-logical-processors-as-cores
默認false
應用場景:每個NodeManager真實的CPU處理能力不一樣時,如A i7 B i5 C i3
虛擬核數和物理核數乘數
如果把虛擬核數當作CPU核數,也就是上述參數設置為true
yarn.nodemanager.resource.pcores-vcores-multiplier
比如:4核8線程,該參數就應設為2
默認1.0
以下兩個參數配置配置一個就行,通常需要配置
NodeManager使用內存
yarn.nodemanager.resource.memory-mb
默認8G
NodeManager為系統保留多少內存
yarn.nodemanager.resource.system-reserved-memory-mb
如總內存8G 該參數為2G也就是為系統留2G 剩余nodemanage可以使用6G
NodeManager使用CPU核數
yarn.nodemanager.resource.cpu-vcores
默認8個
是否開啟物理內存檢測限制container
ResourceManager會監控NodeManager的使用情況,監控機制。
比如A總共有8G內存,當A快超過8G時,會通知內存快使用完了
yarn.nodemanager-pvmem-check-enabled
默認打開
是否開啟虛擬內存檢測限制container
yarn.nodemanager.vmem-check-enabled
默認打開
虛擬內存和物理內存比例
假設物理內存8G,虛擬內存2.1*8=16.8G
yarn.nodemanager.vmem-pmem-ratio
默認2.1
Container
容器最小內存
yarn.scheduler.minimum-allocation-mb 容器最小內存,默認1G
容器最大內存
yarn.scheduler.maximum-allocation-mb 容器最小內存,默認8G
容量最小CPU核數
yarn.scheduler.minimum-allocation-vcores
默認1個
容器最大CPU核數
yarn.scheduler.maximum-allocation-vcores
默認4個