


Why does the Python script not be found when submitting a PyFlink job on YARN?
PyFlink job submission failed on YARN: Analysis of the causes of missing Python scripts and solutions
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>
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
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
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
Verify the Python script path: Use
hdfs dfs -ls hdfs://nameservice1/pyflink/wc2.py
command to check whether the scriptwc2.py
exists in the specified HDFS path. If it does not exist, make sure the script is uploaded to the path correctly.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.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, usehdfs dfs -chmod 755 hdfs://nameservice1/pyflink/wc2.py
to modify the permissions to ensure that YARN and Flink users have read permissions.Log Analysis: Enable detailed logging of Flink and YARN, analyze error logs for more specific error information and where it occurs.
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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

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

JDBC...

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? When using IDEA for development, many developers may encounter a problem: the console printed...

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

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? When using RedisTemplate for batch query operations, you may encounter the returned results...
