jboss cli 命令行 连接 jboss 容器 返回connect timeout 问题

jenkins 使用 Deploy 插件发布到 jboss as7.x容器时报connection timed out

  The undeployment phase of the redeploy action has failed: org.codehaus.cargo.util.CargoException: Cannot undeploy deployable org.codehaus.cargo.container.deployable.WAR
ERROR: Build step failed with exception
Caused by: java.lang.RuntimeException: java.net.ConnectException: JBAS012144: Could not connect to remote://192.168.239.200:11001. The connection timed out

使用jboss-cli.sh连接也是报同样的错。

添加timeout参数可以连上但很慢。大约要15秒
./jboss-cli.sh --connect --controller=192.168.239.200:11001 --user=jenkinsdp --password=jenkinsdp --timeout=30000

尝试在jenkins添加这个参数,加了几个都不管用

从抓包看 服务端会返回服务端主机的主机名

客户端好像要解析这个主机名,解析超时的时间长于 cli的默认超时 5秒,就会导致cli 返回超时

在jenkins所在机器的hosts中添加一条服务端主机名的解析记录后问题解决。

参考

jboss CLI 命令行接口学习(适用JBOSS EAP 6.2+)
https://www.cnblogs.com/yjmyzz/p/4754976.html

https://stackoverflow.com/questions/30080835/jbas012144-connection-timeout
https://stackoverflow.com/questions/5936519/how-to-give-jenkins-more-heap-space-when-it%C2%B4s-started-as-a-service-under-windows

© 2020, 新之助meow. 原创文章转载请注明: 转载自http://www.xinmeow.com

0.00 avg. rating (0% score) - 0 votes
点赞