[xuxueli/xxl-job]对于运行时间长复杂的shell,会导致executor崩溃,并且log页面卡住

2024-05-15 647 views
3
#!/bin/bash
. ~/.bash_profile

source /etc/profile;

echo "start outer $(date)"

su - hdfs <<EOF

echo "start inner $(date)"

hadoop fs -rmr /data/path

sh /a/spark/task/run.sh

rm -rf /data/product/hello.txt

hadoop fs -getmerge /data/product/* /data/product/hello.txt

rm -rf /data/product/hello.txt

echo "end inner $(date)"

exit;
EOF

tail -1 /data/product/hello.txt > /data/product/empty.txt
scp -r /data/product/empty.txt 10.0.1.80:/data/hello.json

sleep 2
scp -r /data/product/hello.txt 10.0.1.80:/data/hello.json

echo "end outer $(date)"
#date
echo 'end'
版本 1.9.1 期望:任务顺利执行 实际情况:executor崩溃,log页面卡住

回答

5

你好,两个问题如下: 1、executor崩溃:建议适当优化代码,提升机器内存、性能等; 2、log页面卡主,建议限制下Log内容长度,内容尽量不超过3M。

7

@xuxueli 现在读取日志是cat的,当日志太大时,查看日志就卡死了,建议可以改成tail

2

@xuxueli 您好,请教下在控制台查看日志,日志查看异常(可能是应该日志过大),查看日志的大小在哪配置?