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:

 <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:

 ./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:

 ./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)

Is the company's security software causing the application to fail to run? How to troubleshoot and solve it? Is the company's security software causing the application to fail to run? How to troubleshoot and solve it? Apr 19, 2025 pm 04:51 PM

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

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...

How to solve the problem of printing spaces in IDEA console logs? How to solve the problem of printing spaces in IDEA console logs? Apr 19, 2025 pm 09:57 PM

How to solve the problem of printing spaces in IDEA console logs? When using IDEA for development, many developers may encounter a problem: the console printed...

Does Python projects need to be layered? Does Python projects need to be layered? Apr 19, 2025 pm 10:06 PM

Discussion on Hierarchical Structure in Python Projects In the process of learning Python, many beginners will come into contact with some open source projects, especially projects using the Django framework...

How to correctly divide business logic and non-business logic in hierarchical architecture in back-end development? How to correctly divide business logic and non-business logic in hierarchical architecture in back-end development? Apr 19, 2025 pm 07:15 PM

Discussing the hierarchical architecture problem in back-end development. In back-end development, common hierarchical architectures include controller, service and dao...

Why is the return value empty when using RedisTemplate for batch query? Why is the return value empty when using RedisTemplate for batch query? Apr 19, 2025 pm 10:15 PM

Why is the return value empty when using RedisTemplate for batch query? When using RedisTemplate for batch query operations, you may encounter the returned results...

See all articles