java yarn 应用程序的高可用性

High availability for a java yarn application

谁能告诉我确保 yarn 应用程序高可用性的推荐方法是什么?

例如,假设我有 3 个物理节点。 yarn java 应用程序需要 3 个容器,每个物理节点都有足够的资源来容纳 3 个 yarn 容器。推荐的方法是什么来确保所有的容器都不会落在同一个物理节点上从而成为 'Single Point of Failure'?

这已在 hadoop-mailing list 中得到解答。在这里重新发布答案以防止 link rot

You can use Placements Constraints(https://hadoop.apache.org/docs/r3.1.0/hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html) or set yarn.scheduler.capacity.per-node-heartbeat.maximum-container-assignments to 1 if you RM config with capacityscheduler.

另一种方法 -

I think you can use the reservation system in Hadoop 2.8.x as well: https://hadoop.apache.org/docs/r2.8.5/hadoop-yarn/hadoop-yarn-site/ReservationSystem.html