1、Fetching config from server at : http://localhost:8888/
[org.springframework.cloud.config.client.ConfigServicePropertySourceLocator]:143-Could not locate PropertySource:
{"timestamp":"2021-06-30T02:42:54.268+0000","status":500,"error":"Internal Server Error","message":"Failed to obtain JDBC Connection; nested exception is
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago.
The driver has not received any packets from the server.","path":"/sale/sanyi/master"}
[com.zhifeng.sale.SaleApplication]:648-No active profile set, falling back to default profiles: default
解决方案:尝试在yml中直接写死config的uri,不要从eureka中通过config的serverName获取配置中心的配置,
2、当获取不到配置的时候,尝试重启config,服务获取config之后就会把这次获取的配置放到缓存中,所以改了config的配置时,需要重新启动
3、ribbon.ConnectTimeout 30000 设置服务之间的超时时间,
4、pm2 有服务端的前端是不需要nginx的,但是一般vue框架都只是客户端,很少有客户端和服务端,所有一般需要nginx。 记得一点,pm2的项目,端口是在代码里的,访问的地址都是在代码里的,如果后端地址发生了改变,记得修改