Springboot项目Openshift路由器给出空响应

时间:2018-08-01 07:19:17

标签: java spring-boot openshift router

我已经在Fabric上部署了Spring Boot应用程序,并且int日志没有错误,并且应用程序已启动并正在运行,路由器也指向了正确的服务和正确的端口。不知道为什么我会收到路由器的空响应。

2018-08-01 06:52:02,502 [main] INFO  org.springframework.jmx.export.annotation.AnnotationMBeanExporter [] 87 - Bean with name 'dataSource' has been autodetected for JMX exposure
2018-08-01 06:52:02,700 [main] INFO  org.springframework.jmx.export.annotation.AnnotationMBeanExporter []  - Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-08-01 06:52:02,700 [main] INFO  org.springframework.jmx.export.annotation.AnnotationMBeanExporter [] 87 - Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-08-01 06:52:02,903 [main] INFO  org.apache.coyote.http11.Http11NioProtocol [] 180 - Starting ProtocolHandler ["http-nio-8080"]
2018-08-01 06:52:02,903 [main] INFO  org.apache.coyote.http11.Http11NioProtocol [] 180 - Starting ProtocolHandler ["http-nio-8080"]
2018-08-01 06:52:03,304 [main] INFO  org.apache.tomcat.util.net.NioSelectorPool [] 180 - Using a shared selector for servlet write/read
2018-08-01 06:52:03,304 [main] INFO  org.apache.tomcat.util.net.NioSelectorPool []  - Using a shared selector for servlet write/read
2018-08-01 06:52:04,009 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer []  - Tomcat started on port(s): 8080 (http) with context path ''
2018-08-01 06:52:04,009 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer [] 87 - Tomcat started on port(s): 8080 (http) with context path ''
2018-08-01 06:52:04,104 [main] INFO  com.xx.xx.Application []  - Started Application in 120.101 seconds (JVM running for 123.533)

打开正在运行的pod的终端并运行以下命令,可以得到预期的结果:

sh-4.2$ curl localhost:8080/rest/v1/hello
{"hello":"world"}

路由器也指向8080端口号。

卷曲命令给出以下响应:

    $ curl -kv http://xx.xx.com
    * Rebuilt URL to: http://xx.xx.com/
    * timeout on name lookup is not supported
    *   Trying (IP Address) ...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to xx.xx.com
(IP Address) port 80 (#0)
    > GET / HTTP/1.1
    > Host: xx.xx.com
    > User-Agent: curl/7.49.1
    > Accept: */*
    >
    * Empty reply from server
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    * Connection #0 to host xx.xx.com left intact
    curl: (52) Empty reply from server

如果需要更多详细信息,请告知我。

0 个答案:

没有答案