当前位置:网站首页>Jenkins远程构建项目超时的问题
Jenkins远程构建项目超时的问题
2022-07-07 03:50:00 【熟透的蜗牛】
目录
一、问题描述
在使用Publish Over SSH进行远程部署项目时一直报如下错:ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,001 ms]
二、分析原因
1、日志分析显示超时,于是修改时间,将120000 修改为300000,然后再修改为600000,都没能解决问题,于是排除不是这个问题
2、网上搜索,说是jenkins 启动时候杀掉了build之外的进程,需要在脚本文件加上这句BUILD_ID=dontKillMe,加上之后还是不行。daemon守护线程。还是不行。
3、有人说是空间不足,于是执行如下命令 清除了一下缓存,还是不行
sync
echo 3 > /proc/sys/vm/drop_caches
4、后来在服务器手动启动脚本,发现了问题的所在,最后一行,日志输出那行
原始脚本
#!/bin/bash
source /etc/profile
project=test-wechat-1.0-SNAPSHOT.jar
dir=/opt/deploy/wechat
echo "prepare to deploy test-wechat-1.0-SNAPSHOT"
pid=`ps -ef |grep test-wechat-1.0-SNAPSHOT |grep -v grep| grep 'java' |awk '{print $2}'`
if [[ $pid ]]; then
echo "test-wechat-1.0-SNAPSHOT is running and pid is $pid"
kill -9 $pid
if [[ $? -eq 0 ]];then
echo "sucess to stop test-wechat-1.0-SNAPSHOT"
else
echo "fail to stop test-wechat-1.0-SNAPSHOT"
fi
fi
echo "start to deploy test-wechat-1.0-SNAPSHOT"
cd /opt/deploy/wechat/
nohup java -jar /opt/deploy/wechat/test-wechat-1.0-SNAPSHOT.jar --server.port=9003 >/dev/null 2>&1 &
发现启动之后一直卡在页面,虽然是后台启动但是并没有出现后台启动的效果
修改脚本内容如下后,问题解决。
#!/bin/bash
source /etc/profile
project=test-wechat-1.0-SNAPSHOT.jar
dir=/opt/deploy/wechat
echo "prepare to deploy test-wechat-1.0-SNAPSHOT"
pid=`ps -ef |grep test-wechat-1.0-SNAPSHOT |grep -v grep| grep 'java' |awk '{print $2}'`
if [[ $pid ]]; then
echo "test-wechat-1.0-SNAPSHOT is running and pid is $pid"
kill -9 $pid
if [[ $? -eq 0 ]];then
echo "sucess to stop test-wechat-1.0-SNAPSHOT"
else
echo "fail to stop test-wechat-1.0-SNAPSHOT"
fi
fi
echo "start to deploy test-wechat-1.0-SNAPSHOT"
cd /opt/deploy/wechat/
nohup java -jar /opt/deploy/wechat/test-wechat-1.0-SNAPSHOT.jar --server.port=9003 > nohup.out 2>&1 &
在jenkins配置,一定要添加nohup ,不然项目启动失败
然后研究了一下日志输出的指令,来源 https://blog.csdn.net/sunrier/article/details/7695839
不过也还是不太明白为什么没有以后台的方式启动,希望大佬可以一起讨论一下
边栏推荐
- Outsourcing for three years, abandoned
- L'externalisation a duré trois ans.
- Sqlmap tutorial (IV) practical skills three: bypass the firewall
- 1142_ SiCp learning notes_ Functions and processes created by functions_ Linear recursion and iteration
- 【leetcode】1020. Number of enclaves
- Fast quantitative, abbkine protein quantitative kit BCA method is coming!
- 計算機服務中缺失MySQL服務
- Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.9 introduction to network interface (IX) extending the request3 met
- JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
- Paranoid unqualified company
猜你喜欢
計算機服務中缺失MySQL服務
The metauniverse of the platofarm farm continues to expand, with Dao governance as the core
毕设-基于SSM大学生兼职平台系统
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
URP - shaders and materials - light shader lit
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
Tencent's one-day life
Calculus key and difficult points record part integral + trigonometric function integral
深度学习花书+机器学习西瓜书电子版我找到了
记一个并发规则验证实现
随机推荐
OOM(内存溢出)造成原因及解决方案
外包干了三年,废了...
詳解機器翻譯任務中的BLEU
UWB learning 1
外包幹了三年,廢了...
Abnova immunohistochemical service solution
Explain Bleu in machine translation task in detail
毕设-基于SSM大学生兼职平台系统
How to * * labelimg
$refs: get the element object or sub component instance in the component:
Détailler le bleu dans les tâches de traduction automatique
JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
Chinese and English instructions prosci LAG-3 recombinant protein
L'étape avancée du pointeur de langage C (haut de gamme) pour l'enroulement des cocons
Academic report series (VI) - autonomous driving on the journey to full autonomy
計算機服務中缺失MySQL服務
弹性布局(一)
Detailed explanation of transform origin attribute
我理想的软件测试人员发展状态
Why is the row of SQL_ The ranking returned by number is 1