Spring-Cloud configuration server ignores configuration properties file

前端 未结 2 1742
梦毁少年i
梦毁少年i 2020-12-10 07:03

I am trying to create a Spring Cloud configuration server which reads the configuration data from the properties file and not a github. The server starts, but does not serve

相关标签:
2条回答
  • 2020-12-10 07:49

    By default, the config server serves properties from git. You will need to set the profile to native using --spring.profiles.active=native for the configserver to serve the spring environment. The spring.config.name for the config server is programmatically set to spring.config.name=configserver so your properties file will need to be configserver.properties.

    0 讨论(0)
  • 2020-12-10 07:50

    The "/admin/env" endpoint in a config server only serves the local configuration of the server itself. The server is usually just a regular Spring Boot app, so it gets its configuration from "application.properties". If you want to pick it up from "config-server.properties" you need to set "spring.config.name" or "spring.config.location" (just like a normal Boot app).

    0 讨论(0)
提交回复
热议问题