Closed ziqiang-wang closed 1 year ago
What's new:
This problem should be caused by inconsistent coding between the platform and the production environment running.
Fields in the new virtual table sentences in my flink sql are often described in Chinese. After the tasks are scheduled to yarn, Chinese characters corresponding to the log of JobManager on the Flink UI are garbled. The screenshot is as follows:
In addition, all Chinese characters related to sql in the yarn task log are garbled characters. The screenshot is as follows:
At present, I do not know how to solve this problem.
Add flowing configuration to the conf/flink-conf.yaml file:
env.java.opts: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
Search before asking
What happened
The name of the flink SQL application circled in the above figure contains Chinese, After submitting the task to yarn, it was found that the TaskNamager in the flink cluster could not be initialized. The following error is found in the JobManager log
It can be found that yarn ResourceManager cannot find the jar containing Chinese in HDFS because all Chinese characters are garbled.
Check the workspace of the platform project on the machine, and find the jar package in the corresponding application id directory, which contains the name of the application and also contains Chinese. Then check the HDFS path displayed in the log, and find the corresponding jar package, which also contains Chinese. And the jar package names appear normal in both places.
Suggestions: The application id is concatenated to the jar package name instead of the application name, because the id is not in Chinese. Therefore, ResourceManager cannot find the jar package in HDFS and cannot initialize TaskManager. Moreover, the jar package contains the application id, which does not increase the difficulty of debugging.
yarn environment
CDH-6.3.2 yarn-3.0.0+cdh6.3.2
StreamPark Version
2.0.0
Java Version
1.8.0_202
Flink Version
Flink-1.15.3
Scala Version of Flink
Scala_2.12
Error Exception