我想检查一下我的JBoss EAP 7是否是通过jboss-cli
启动的。
使用JBoss EAP 6,我可以使用以下命令
jboss-cli.bat -c --commands="read-attribute server-state"
服务器启动时,响应为starting
。服务器成功启动后,响应为running
。
迁移到JBoss EAP 7.0后,同一命令在服务器启动时返回以下消息。 Failed to connect to the controller: Timeout waiting for the system to boot.
服务器成功启动后,将返回正常消息running
。
我的问题是:为什么jboss-cli
在启动之前无法连接到服务器?
答案 0 :(得分:1)
在EAP 7.x和EAP 6.3.0或更高版本中,您可以配置jboss.as.management.blocking.timeout
系统属性以调整等待服务容器稳定性的超时(秒)。
尝试通过CLI连接后设置此参数。
自EAP 6.3.0.ER8以来,jboss.as.controller中有一个新类:BlockingTimeout。此类加载系统属性jboss.as.management.blocking.timeout的值或默认为300(秒)。
Note: This property is not a timeout per deployment but a timeout on container stability and if jboss.as.management.blocking.timeout is reached during startup then all applications will be undeployed and the container shutdown. The reasoning behind this is that having a half-working server is potentially dangerous as you may not notice major failures.
因此,如果您的应用程序无法在给定的超时值内加载,CLI将抛出错误Failed to connect to the controller: Timeout waiting for the system to boot
jboss-cli.sh --connect --controller=IP:PORT --timeout=40000
将超时值配置为服务器启动所需的时间。
答案 1 :(得分:0)
实际命令行为 ./jboss-cli.sh --connect command =“:read-attribute(name = server-state)”