Dear:
The chat records of WeChat group“Apache linkis Community Development
Group”are as follows:
微信群"Apache Linkis 社区开发群"的聊天记录如下:― 2022-7-9
―
Heisenberg 7-9 10:40:06
https://sm.ms/image/Z2Ce8mhuzO1wHon
Heisenberg 7-9 10:40:06
@ peacewong@WDS Brother Ping, kill yarn jobs under shell engine SH is used
in the engine process. If the user directly kills the -9 engine process, the
spark application launched by the user through the shell script will not be
killed, and the user can only find it and kill it manually
peacewong@WDS 7-9 10:43:29
Yes, brother Long Ping
peacewong@WDS 7-9 10:43:44
Kill -9, there's no way
Heisenberg 7-9 10:45:20
The logic of kill yarn application, which I understand, is not placed in EC,
but in ECM
Heisenberg 7-9 10:45:20
https://s2.loli.net/2022/07/11/qSQPNWxEkHb5Rjm.png
Heisenberg 7-9 10:45:23
?
peacewong@WDS 7-9 10:45:41
yes
Heisenberg 7-9 10:46:08
When ECM kills the engine, it is detected that there are running yarn apps
started by the engine. Kill these yarn apps, and then kill the engine
Heisenberg 7-9 10:46:09
good
peacewong@WDS 7-9 10:46:16
It's about ECM. Cache the application ID of EC
peacewong@WDS 7-9 10:46:33
Uh huh, yes
Heisenberg 7-9 10:47:14
What applications can ECM know about EC startup?
peacewong@WDS 7-9 10:50:16
Spark is better. Hive and shell can only be obtained by scanning log files.
If it is made into general logic, it feels better to scan the log to
retrieve the application ID. But too many logs may also be a problem.
Heisenberg 7-9 10:50:52
Uh huh, I think the shell engine scans the log to extract the application ID
peacewong@WDS 7-9 10:52:02
yes
Heisenberg 7-9 10:52:33
A key operation here is to collect the application ID, and then call kill
yarn job SH or kill tasks through the yarn rest API
Heisenberg 7-9 10:53:16
Let me take a look at the collection of yarn application ID first
peacewong@WDS 7-9 10:57:44
Yes, you can get it by scanning logs, but the performance may be poor.
Heisenberg 7-9 10:59:45
I think the scanning log was made at EC
Heisenberg 7-9 11:01:19
If it is realized by scanning logs, will the scanning logs still be
processed in EC? Then EC scans the application ID and reports it to ECM,
Or is the behavior of scanning logs done in ECM?
peacewong@WDS 7-9 11:09:11
It seems reasonable for ECM to do this. There is a better processing logic,
that is, the logappender or sendappender on the EC side parses and judges.
If the log with application ID is printed, print it to the error level log,
print it to stderr, and then ECM parses the application ID in stderr.
Generally, the number of stderr log lines is relatively small, so the
performance should not be poor
peacewong@WDS 7-9 11:10:06
In this way, as long as ECM is doing the kill engine, go to grep to re apply
the applicaiton ID. Judge the status and kill it
Heisenberg 7-9 11:11:41
Uh huh, let me first look at the process of sending logs by logapper |
sendapender, and then receiving logs by ECM
peacewong@WDS 7-9 11:12:47
ECM can directly get the log path of stderr for processing, and there is no
need to receive it
Heisenberg 7-9 11:13:19
https://s2.loli.net/2022/07/11/g4yXxAkKqobWsT8.png
Heisenberg 7-9 11:13:31
stderr
peacewong@WDS 7-9 11:17:12
Yes, ECM can use enginecon object conn.getengineconnmanagerenv
Engineconnlogdirs can get the specific path
Heisenberg 7-9 11:23:10
The logappender or sendappender on the EC side parses and judges if the log
with application ID is printed
You still need to perform regular parsing on each line of log output in EC.
For spark engine, after parsing to app ID, you can stop; For the shell
engine, it may need to continue parsing, because the shell engine may submit
multiple spark apps and generate multiple app IDs. Is the performance
time-consuming point still in log parsing?
Heisenberg 7-9 11:24:39
Is this function added to 1.2.0?
peacewong@WDS 7-9 11:25:22
Yes, mainly in log4j. I just saw that when each engine prints application
ID, the log class also looks inconsistent
peacewong@WDS 7-9 11:26:56
Uh huh, if time is OK. 1.2.1 it's OK.
peacewong@WDS 7-9 11:27:29
If it is unified, it will be better. Just print the log4j configuration of
the printing place directly
Heisenberg 7-9 11:28:33
understand
Heisenberg 7-9 11:30:37
Configure log4j to print applicationid. I think the shell engine uses
yarnappidextractor to regularly parse each line of log output
Heisenberg 7-9 11:30:48
https://s2.loli.net/2022/07/11/hGJBr5y82OPL9if.png
peacewong@WDS 7-9 11:31:56
Yes, the shell engine can parse it here and call stderr
Heisenberg 7-9 11:38:06
Is spark engine configured with log4j? Or in this way
peacewong@WDS 7-9 11:54:48
Spark and hive feel that log4j configuration is better
Heisenberg 7-9 11:57:12
OK, let me see how to configure it
Heisenberg 7-9 16:26:01
https://s2.loli.net/2022/07/11/lf1KaJ7rubjRW8G.png
Heisenberg 7-9 16:26:01
When debugging lo