Yarn state machine Visualization

Source: Internet
Author: User

Multiple state machine objects are implemented in yarn, including scheduler, rmapp-attemptimpl, scheduler, rmnodeimpl in ResourceManager, applicationimpl, scheduler, localizedresource in nodemanager, jobimpl, taskimpl, and scheduler in mrappmaster. Yarn provides a state machine visualization tool to help you view the state changes and related events of these state machines. The procedure is as follows.

Step 1. Convert the state machine to a file in graphviz (. gv) format and run the following command in the source code root directory:

MVN compile-pvisualize

After this step, three graphviz files, ResourceManager. gv, nodemanager. gv, and mapreduce. gv, are generated in the local directory. The content of the localizedresource state machine in the nodemanager. gv file is as follows:

subgraph cluster_LocalizedResource {label="LocalizedResource"  "LocalizedResource.FAILED" [ label = FAILED ];  "LocalizedResource.DOWNLOADING" [ label = DOWNLOADING ];  "LocalizedResource.DOWNLOADING" -> "LocalizedResource.DOWNLOADING" [ label = "REQUEST,\nRELEASE" ];  "LocalizedResource.DOWNLOADING" -> "LocalizedResource.FAILED" [ label = "LOCALIZATION_FAILED" ];  "LocalizedResource.DOWNLOADING" -> "LocalizedResource.LOCALIZED" [ label = "LOCALIZED" ];  "LocalizedResource.INIT" [ label = INIT ];  "LocalizedResource.INIT" -> "LocalizedResource.DOWNLOADING" [ label = "REQUEST" ];  "LocalizedResource.LOCALIZED" [ label = LOCALIZED ];  "LocalizedResource.LOCALIZED" -> "LocalizedResource.LOCALIZED" [ label = "REQUEST,\nRELEASE" ];}

Step 2. Use the relevant commands in graphviz to generate a state machine diagram. The shell command is as follows:

Dot-tpng nodemanager. gv> nodemanager.png

If you have not installed the graphviz package, you must install the package before performing this step. The installation command of cent OS is as follows:

Sudo Yum install graphviz

Open nodemanager.png, as shown in (two charts are split for ease of display ):




Yarn state machine Visualization

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.