0

我正在尝试使用 cf-mvn-plugin 将应用程序部署到基于 cloudfoundary 的基础设施。

应用程序(在本地运行没有任何问题)立即崩溃。虽然引导日志看起来几乎就像在我的本地机器上一样,但唯一的区别是我收到这样的消息:

2015-12-07 10:39:04 [App/0] OUT 2015-12-07 09:39:04,691 INFO org.springframework.web.context.support.XmlWebApplicationContext - Bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

然后在引导期间的某个时间,应用程序崩溃:

2015-12-07 10:42:41 [DEA/18] ERR Instance (index 0) failed to start accepting connections
2015-12-07 10:42:41 [API/0] OUT App instance exited with guid 405d6d18-d730-4765-a98b-7f5986f87eb2 payload: {"cc_partition"=>"default", "droplet"=>"405d6d18-d730-4765-a98b-7f5986f87eb2", "version"=>"6023f58c-9165-4a6d-8403-2727ec9f3723", "instance"=>"2118978ed1f54f18a03b1d77f82f3b58", "index"=>0, "reason"=>"CRASHED", "exit_status"=>255, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1449481361}
2015-12-07 10:42:41 [API/3] OUT App instance exited with guid 405d6d18-d730-4765-a98b-7f5986f87eb2 payload: {"cc_partition"=>"default", "droplet"=>"405d6d18-d730-4765-a98b-7f5986f87eb2", "version"=>"6023f58c-9165-4a6d-8403-2727ec9f3723", "instance"=>"2118978ed1f54f18a03b1d77f82f3b58", "index"=>0, "reason"=>"CRASHED", "exit_status"=>255, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1449481361}

这是我当前的cf-maven-plugin配置:

<plugin>
                <groupId>org.cloudfoundry</groupId>
                <artifactId>cf-maven-plugin</artifactId>
                <version>1.1.2</version>
                <configuration>
                    <server>${cloudfoundry.server}</server>
                    <target>${cloudfoundry.target}</target>
                    <org>${cloudfoundry.org}</org>
                    <space>${cloudfoundry.space}</space>
                    <memory>1024</memory>
                    <appname>myApp</appname>
                    <url>my-app.scapp.io</url>
                    <healthCheckTimeout>180</healthCheckTimeout>
                    <appStartupTimeout>10</appStartupTimeout>
                    <env>
                        <JAVA_OPTS>-Djavax.xml.accessExternalSchema=all -Djava.security.egd=file:///dev/urandom</JAVA_OPTS>
                    </env>
                    <services>
                        <service>
                            <name>datadb</name>
                            <label>${cloudfoundry.service.datadb.label}</label>
                            <plan>${cloudfoundry.service.datadb.plan}</plan>
                        </service>
                    </services>
                </configuration>
            </plugin>

CLI 版本:6.14.0+2654a47-2015-11-18

cf-mvn 插件版本:1.1.2

谢谢!

4

1 回答 1

0

当应用程序部署到 CF 时,平台会在启动时检查应用程序的健康状况,并期望它在一定时间后运行。在您的情况下,您已将此运行状况检查超时配置为 180 秒 ( <healthCheckTimeout>180</healthCheckTimeout>)。这是平台支持的最大超时。

由于您已为应用程序分配了一个路由(使用<url>haufe-demo.scapp.io</url>),平台将访问该 URL 并期望在 3 分钟的超时期限内得到响应。如果应用程序不是 Web 应用程序并且不响应 HTTP 请求,那么应该在没有路由的情况下部署它。在应用程序没有路由的情况下,平台健康检查只是确保 PID 处于活动状态。

[DEA/18] ERR Instance (index 0) failed to start accepting connections错误表明您的应用在 3 分钟超时窗口内未接受 HTTP 连接。

于 2015-12-07T17:16:22.247 回答