記一次Consul註冊tomcat中項目健康檢查錯誤:
HTTP GET http://node-3:8090/actuator/health: 404 Output: <!doctype ht
以上的錯誤是因爲tomcat部署後訪問你的時候需要添加項目名,而健康檢查的時候請求路徑中沒有項目名,導致報錯404,
解決方案:
設置tomcat配置文件server.xml,在Host下添加Context:
<Context path="" docBase="/home/bbk/tomcats/softservice-questions/wars/auth-service" reloadable="true" />
設置好後重啓項目,Consul中正常顯示