当时的部署步骤如下:
安装部署了tomcat应用
开了应用端口号,保存
在nginx服务器配置文件$nginx/conf/nginx.conf上添加了新增的应用服务器
重启nginx:../sbin/nginx -s reload
查看新增的tomcat应用日志,发现有以下警告:
2019-08-22 16:56:35,491 [localhost-startStop-1] WARN org.springframework.aop.framework.CglibAopProxy - Unable to proxy method [public final java.lang.Object com.tmri.app.web.ctrl.AppLshpCtrl.uploadPhoto(org.springframework.web.multipart.MultipartHttpServletRequest,com.tmri.bus.bean.sys.NetSysLog) throws java.io.IOException] because it is final: All calls to this method via a proxy will NOT be routed to the target instance.
经检查,原来是在第3步修改配置文件的新增的应用服务器的端口号写错了,原本是7116,复制粘贴别处配置内容时,只改了IP,大意没改端口号
upstream app_server{
#旧
server 192.168.1.99 : 7116 max_fails=1 fail_timeout = 30s;
#新增
server 192.168.1.100 : 7226 max_fails=1 fail_timeout = 30s;
server 192.168.1.101 : 7226 max_fails=1 fail_timeout = 30s
}
修改配置端口号后,重启nginx服务,检查新部署应用log,无以上警告,正常工作了