这篇文章是一次真实的排查经历,可能对大多数人没什么作用,慎看。
断电后来电,服务器启动,手工启动各个docker,大部分正常,小部分还是出错,错误信息:
<html> <head> <title>Apache Tomcat/5.5.23 - Error report</title> <style> <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--> </style> </head> <body> <h1>HTTP Status 404 - /schedule-api/webapi/sch-register/test</h1> <HR size="1" noshade="noshade"> <p> <b>type</b> Status report </p> <p> <b>message</b> <u>/schedule-api/webapi/sch-register/test</u> </p> <p> <b>description</b> <u>The requested resource (/schedule-api/webapi/sch-register/test) is not available.</u> </p> <HR size="1" noshade="noshade"> <h3>Apache Tomcat/5.5.23</h3> </body> </html>
进行以下操作:
cd /home/docker/compose
停止指定的docker
docker-compose stop schedule-api
删除停止的docker, 根据提示按y
docker-compose rm
重建docker
docker-compose up -d schedule-api
查看日志
docker logs schedule-api
发现tomcat启动成功
22-Nov-2017 14:36:27.243 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.20 22-Nov-2017 14:36:27.245 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Aug 2 2017 21:35:49 UTC 22-Nov-2017 14:36:27.245 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.20.0 22-Nov-2017 14:36:27.245 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.0-514.el7.x86_64 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_141-8u141-b15-1~deb9u1-b15 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat 22-Nov-2017 14:36:27.246 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
问题依然没有解决。绕过反代,直接访问后面的服务器,正常,于是锁定问题在反代,重启反代
docker-compose restart reverse-proxy
问题解决。
问题分析,可能与docker的启动顺序相关,顺序反了,就不正常。以后类似情况要把反代放最后启动。