Table of Contents
PyFlink job submission failed on YARN: Analysis of the causes of missing Python scripts and solutions
Troubleshooting and resolution steps
Home Java javaTutorial Why does the Python script not be found when submitting a PyFlink job on YARN?

Why does the Python script not be found when submitting a PyFlink job on YARN?

Apr 19, 2025 pm 02:06 PM
python apache Solution python script Why

Why does it report an error when submitting a PyFlink job on YARN?

When submitting a PyFlink job using YARN, you may encounter an error in which the Python script is not found, such as:

1

<code>2024-05-24 16:38:02,030 info org.apache.flink.client.python.pythondriver [] - pyflink181.zip/pyflink181/bin/python: can't open file 'hdfs://nameservice1/pyflink/wc2.py': [errno 2] no such file or directory</code>

Copy after login

This usually happens when using the following commands:

1

2

3

4

5

6

7

./flink run-application -t yarn-application \

-dyarn.application.name=flinkcdctestpython\

-dyarn.provided.lib.dirs="hdfs://nameservice1/pyflink/flink-dist-181" \

-pyarch hdfs://nameservice1/pyflink/pyflink181.zip \

-pyclientexec pyflink181.zip/pyflink181/bin/python \

-pyexec pyflink181.zip/pyflink181/bin/python \

-py hdfs://nameservice1/pyflink/wc2.py

Copy after login

In contrast, Java job submission usually does not have problems:

1

2

3

4

5

6

./flink run-application -t yarn-application \

-djobmanager.memory.process.size=1024m \

-dtaskmanager.memory.process.size=1024m \

-dyarn.application.name=flinkcdctest \

-dyarn.provided.lib.dirs="hdfs://nameservice1/pyflink/flink-dist-181" \

hdfs://nameservice1/pyflink/statemachineexample.jar

Copy after login

The Java job was successfully submitted, indicating that the HDFS configuration is correct. The problem is the Python script path or configuration of the PyFlink job.

Troubleshooting and resolution steps

  1. Verify the Python script path: Use hdfs dfs -ls hdfs://nameservice1/pyflink/wc2.py command to check whether the script wc2.py exists in the specified HDFS path. If it does not exist, make sure the script is uploaded to the path correctly.

  2. Check PyFlink configuration: Double-check -pyarch , -pyclientexec and -pyexec parameters to make sure they point exactly to the PyFlink environment and the Python interpreter. pyflink181.zip must contain all necessary Python libraries and execution environments.

  3. Permissions issue: Use hdfs dfs -ls -h hdfs://nameservice1/pyflink/wc2.py to view the HDFS permissions of the script. If the permissions are insufficient, use hdfs dfs -chmod 755 hdfs://nameservice1/pyflink/wc2.py to modify the permissions to ensure that YARN and Flink users have read permissions.

  4. Log Analysis: Enable detailed logging of Flink and YARN, analyze error logs for more specific error information and where it occurs.

  5. Python environment compatibility: Ensure that the Python version used by PyFlink is consistent with the version used when developing scripts, and avoid incompatible versions that cause the script to be unrecognized or executed.

Through the above steps, systematically troubleshooting the problem and adjusting the configuration according to the actual situation, you can solve the problem that the Python script cannot be found when the PyFlink job is submitted on YARN. If the problem persists, provide more detailed Flink and YARN log information for further analysis.

The above is the detailed content of Why does the Python script not be found when submitting a PyFlink job on YARN?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to display child categories on archive page of parent categories How to display child categories on archive page of parent categories Apr 19, 2025 pm 11:54 PM

Do you want to know how to display child categories on the parent category archive page? When you customize a classification archive page, you may need to do this to make it more useful to your visitors. In this article, we will show you how to easily display child categories on the parent category archive page. Why do subcategories appear on parent category archive page? By displaying all child categories on the parent category archive page, you can make them less generic and more useful to visitors. For example, if you run a WordPress blog about books and have a taxonomy called "Theme", you can add sub-taxonomy such as "novel", "non-fiction" so that your readers can

Why does the Spring project cause randomness problems due to circular dependencies when starting? Why does the Spring project cause randomness problems due to circular dependencies when starting? Apr 19, 2025 pm 11:21 PM

Understand the randomness of circular dependencies in Spring project startup. When developing Spring project, you may encounter randomness caused by circular dependencies at project startup...

Why is the rise or fall of virtual currency prices? Why is the rise or fall of virtual currency prices? Why is the rise or fall of virtual currency prices? Why is the rise or fall of virtual currency prices? Apr 21, 2025 am 08:57 AM

Factors of rising virtual currency prices include: 1. Increased market demand, 2. Decreased supply, 3. Stimulated positive news, 4. Optimistic market sentiment, 5. Macroeconomic environment; Decline factors include: 1. Decreased market demand, 2. Increased supply, 3. Strike of negative news, 4. Pessimistic market sentiment, 5. Macroeconomic environment.

Python vs. C  : Which Language to Choose for Your Project? Python vs. C : Which Language to Choose for Your Project? Apr 21, 2025 am 12:17 AM

Choosing Python or C depends on project requirements: 1) If you need rapid development, data processing and prototype design, choose Python; 2) If you need high performance, low latency and close hardware control, choose C.

How to process and display percentage numbers in Java? How to process and display percentage numbers in Java? Apr 19, 2025 pm 10:48 PM

Display and processing of percentage numbers in Java In Java programming, the need to process and display percentage numbers is very common, for example, when processing Excel tables...

Python vs. JavaScript: Use Cases and Applications Compared Python vs. JavaScript: Use Cases and Applications Compared Apr 21, 2025 am 12:01 AM

Python is more suitable for data science and automation, while JavaScript is more suitable for front-end and full-stack development. 1. Python performs well in data science and machine learning, using libraries such as NumPy and Pandas for data processing and modeling. 2. Python is concise and efficient in automation and scripting. 3. JavaScript is indispensable in front-end development and is used to build dynamic web pages and single-page applications. 4. JavaScript plays a role in back-end development through Node.js and supports full-stack development.

Choosing Between Python and C  : The Right Language for You Choosing Between Python and C : The Right Language for You Apr 20, 2025 am 12:20 AM

Python is suitable for beginners and data science, and C is suitable for system programming and game development. 1. Python is simple and easy to use, suitable for data science and web development. 2.C provides high performance and control, suitable for game development and system programming. The choice should be based on project needs and personal interests.

Python vs. C  : Understanding the Key Differences Python vs. C : Understanding the Key Differences Apr 21, 2025 am 12:18 AM

Python and C each have their own advantages, and the choice should be based on project requirements. 1) Python is suitable for rapid development and data processing due to its concise syntax and dynamic typing. 2)C is suitable for high performance and system programming due to its static typing and manual memory management.

See all articles