当我尝试使用' cf push SpringMvcGroovy -p libs / SpringMvcGroovy-0.1.0.jar '命令将SpringMvcGroovy-0.1.0.jar部署到CloudFoundry时,它会上传Droplet成功但无法启动实例:
...
2014-06-11T03:04:43.37-0400 [App/0] OUT 2014-06-11 07:04:43.373 INFO 33 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port: 8080
2014-06-11T03:04:43.37-0400 [App/0] OUT 2014-06-11 07:04:43.376 INFO 33 --- [ main] c.b.springmvc.GreetingApplication : Started GreetingApplication in 5.263 seconds (JVM running for 6.868)
2014-06-11T03:05:36.53-0400 [DEA] OUT Instance (index 0) failed to start accepting connections
2014-06-11T03:05:36.54-0400 [API] OUT App instance exited with guid 83d01863-9813-4b7b-8113-a2a8fcc8a43d payload: {"cc_partition"=>"default", "droplet"=>"83d01863-9813-4b7b-8113-a2a8fcc8a43d", "version"=>"9baf1eef-275f-4000-bcde-f0810985e9a6", "instance"=>"31ec2e2f0a704d2cb7555bfbbcb26aa0", "index"=>0, "reason"=>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1402470336}
2014-06-11T03:05:36.65-0400 [App/0] ERR
可能是什么原因?
答案 0 :(得分:0)
该应用似乎是从端口8080开始的(显然它不会起作用)。构建包应该检测一个Spring Boot应用程序并设置server.port
参数,这样就可以解决一些问题(如果你想修复它们会引发问题:https://github.com/cloudfoundry/java-buildpack/issues?state=open)。您可以自己设置SERVER_PORT=${PORT}
作为环境变量。