我在使用Jenkins远程执行Jmeter脚本的时候,报了这么一个错误
首先看看我的脚本
ssh root@10.***(手动打码) nohup nmon -f -m /jmeter/equ_8_shanyan/s3/down -c 320 -s 2 > a.log 2>&1 &
ssh root@10.***
/opt/jmeter/apache-jmeter-5.4.3/bin/jmeter -n -t /jmeter/script/equ_8_shanyan/double/down_s3.jmx -Jthread.downnum=23 -Jloop.num=1200000 -Jdura.num=600 -l /jmeter/report/equ_8_shanyan/s3/down_report/180/180down.jtl -e -o /jmeter/report/equ_8_shanyan/s3/down_report/180/ >> /jmeter/report/equ_8_shanyan/s3/down_report/log/180down.log
开始构建后报了个错误
Started by user admin
Running as SYSTEM
Building on master in workspace /root/.jenkins/workspace/s3_up_30
[s3_up_30] $ /bin/sh -xe /opt/app/jenkins/temp/jenkins2406914613948759500.sh
/opt/app/jenkins/temp/jenkins2406914613948759500.sh: line 4: warning: here-document at line 3 delimited by end-of-file (wanted `remotessh')
+ ssh root@10.***(手动打码)
+ ssh root@10.*** nohup nmon -f -m /jmeter/equ_8_shanyan/s3/up -c 320 -s 2
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Nashorn engine is planned to be removed from a future JDK release
上面这是提示的错误,我们可以看到 Pseudo-terminal will not be allocated because stdin is not a terminal.
其实他的意思就是说想要在被Jenkins所ssh链接的地址上进行操作,我们只需要按照第四行提示的 /opt/app/jenkins/temp/jenkins4288957416165822375.sh: line 4: warning: here-document at line 3 delimited by end-of-file (wanted `remotessh')在ssh root@***后边加一个 << remotessh就可以啦
ssh root@*** << remotessh
这么操作以后,Jenkins就可以在被ssh连接的机器上运行shell命令啦