配置文件更改时,配置服务器不会重新加载更改。它不能监控本机文件的变化或有什么问题吗?
spring:
profiles:
active: native
cloud:
config:
server:
native:
search-locations: classpath:/conf/, classpath:/conf/licensingservice/发布于 2018-12-20 05:12:09
因为您配置被打包到您的jar中,所以如果您更改一个配置,因为它保存在您的类路径中,所以服务器看不到修改。更好的选择是将这些配置保存在类路径之外的其他位置。您可以使用如下配置:
spring:
application:
name: configserver
cloud:
config:
server:
native:
searchLocations: file://${LOCAL_REPO}通过这种方式,您可以使用环境变量LOCAL_REPO对该位置进行试验。当然,我建议您在生产环境中将配置存储库转移到git存储库,这是更适合生产环境的选择。
我希望这能帮助你
https://stackoverflow.com/questions/53851280
复制相似问题