集群規(guī)模:
Active Nodes: 2(172.24.5.101、172.24.5.102)
VCores Total: 14
Memory Tota:30GB
測試步驟
1: 啟動spark streaming job
待程序穩(wěn)定運行后可以看到如下所示
Executor ID Address Status
driver 172.24.5.101:35917 Active
1 172.24.5.102:35917 Active
2:關(guān)閉 172.24.5.101 node manager
首先對應(yīng)的節(jié)點狀態(tài) DEAD,但是該executor依然接收Batch,并且處于queued
Executor ID Address Status
driver 172.24.5.101:35917 Active
1 172.24.5.102:35917 DEAD
3:啟動 172.24.5.101 node manager
待節(jié)點恢復(fù)后,executors 分布狀況如下:
Executor ID Address Status
driver 172.24.5.101:35917 Active
1 172.24.5.102:35917 DEAD
2 172.24.5.102:45917 Active
可以看到executor重新分配;處于 queued 中的Batch 也已經(jīng)正確處理;截圖如下:

Executors
Issue
Q1: 當一臺node manager 掛掉, executor 并未在存活的data node重新啟動,而是在該節(jié)點恢復(fù)后,executor才恢復(fù),這是為何?
重新測試,下線其他streaming job, 重復(fù)上述操作發(fā)現(xiàn) executor 可以分布在其他存活的node manager上,截圖如下:

Executors
當時有可能集群資源有限, 沒有合適的 node manager 接受 executor,接下來會重復(fù)驗證
Q2:當所有 node manager 掛掉, executor是怎樣恢復(fù)?