spring-cloud-config

Spring cloud config server. Environment variables in properties

我的梦境 提交于 2019-12-03 16:13:31
I configured Spring Cloud Config server like this: @SpringBootApplication @EnableAutoConfiguration @EnableConfigServer public class ConfigServer { public static void main(String[] args) { SpringApplication.run(ConfigServer.class, args); } } I'm using 'native' profile so properties are picked up from the file system: server.port=8888 spring.profiles.active=native spring.cloud.config.server.native.search-locations: classpath:/global Now the tricky part is that some properties contain environmental variables . Properties in 'global/application-production.properties' are configured like this: test

How to read multiple config file from Spring Cloud Config Server

放肆的年华 提交于 2019-12-03 07:26:34
Spring cloud config server supports reading property files with name ${spring.application.name}.properties . However I have 2 properties files in my application. a.properties b.properties Can I get the config server to read both these properties files? Rename your properties files in git or file system where your config server is looking at. a.properties -> <your_application_name>.properties a.properties -> <your_application_name>-<profile-name>.properties For example, if your application name is test and you are running your application on dev profile, below two properties will be used

Docker - SpringConfig - Connection refused to ConfigServer

时光怂恿深爱的人放手 提交于 2019-12-02 15:51:07
问题 I'm trying to deploy a ConfigServrService and a Client with a remote repository using DockerCompose. The docker-compose.yml is like: version: '2' services: rabbitmq: image: rabbitmq ports: - "5672:5672" config-server: image: config-server environment: - "SPRING_PROFILES_ACTIVE=desa" ports: - "8888:8888" links: - rabbitmq depends_on: - rabbitmq user-service-config: image: user-service-config environment: - "SPRING_PROFILES_ACTIVE=desa" ports: - "8090:8090" links: - config-server - rabbitmq

How to set local config properties with Spring Config Service

点点圈 提交于 2019-12-02 09:39:37
问题 So I recently learned this awesome config service of Spring Cloud, and after some struggling I'm able to get our distributed application set up, with multiple nodes reading config properties from one config server. However one problem I don't know how to resolve is even though most props are same across multiple nodes, some props need local version and I don't know how to set local prop together with config service. For example this is my bootstrap.properties , spring.cloud.config.uri=$

Docker - SpringConfig - Connection refused to ConfigServer

依然范特西╮ 提交于 2019-12-02 09:31:28
I'm trying to deploy a ConfigServrService and a Client with a remote repository using DockerCompose. The docker-compose.yml is like: version: '2' services: rabbitmq: image: rabbitmq ports: - "5672:5672" config-server: image: config-server environment: - "SPRING_PROFILES_ACTIVE=desa" ports: - "8888:8888" links: - rabbitmq depends_on: - rabbitmq user-service-config: image: user-service-config environment: - "SPRING_PROFILES_ACTIVE=desa" ports: - "8090:8090" links: - config-server - rabbitmq depends_on: - rabbitmq - config-server At the moment that they are deploying, the client console shows: c

Spring Config Server - No such label: master

那年仲夏 提交于 2019-12-02 06:14:17
问题 I have a simple Spring Cloud Config Server which consume configuration from git server. ConfigServer bootstrap.yml : spring: application: name: config-service cloud: config: server: git: uri: ssh://git@mydomain:myport/myrepo.git searchPaths: "configurations/{application}/{profile}" server: port: 8888 When I deploy ConfigServer on local, I can retrieve configuration from http://localhost:8888/myapp/test . But when I deploy ConfigServer on test server, it throws No such label: master when I hit

How to set local config properties with Spring Config Service

此生再无相见时 提交于 2019-12-02 04:27:29
So I recently learned this awesome config service of Spring Cloud, and after some struggling I'm able to get our distributed application set up, with multiple nodes reading config properties from one config server. However one problem I don't know how to resolve is even though most props are same across multiple nodes, some props need local version and I don't know how to set local prop together with config service. For example this is my bootstrap.properties , spring.cloud.config.uri=${config.server:http://localhost:8888} spring.application.name=worker If I add additional props under

Unable to get logback-spring.xml property file using Spring Cloud Config and Discovery

回眸只為那壹抹淺笑 提交于 2019-12-01 19:47:06
I'm using Discovery first bootstrap feature and Consul as a Discovery Server, url to Config Server is located during start-up and I was able to get application.properties . I need also to get logback-spring.xml configuration from Config server and I don't know how. What should I specify in logging.config={???}logback-spring.xml property to not hardcode url to Config Server? Before Consul integration I was using url formed according to Serving Plain text documentation with hardcoded Config server url in properties and it was working fine, but now we want to avoid this. From what I debugged

How do I setup a local fallback config for Spring Cloud Config service incase remote repo is not available?

蓝咒 提交于 2019-12-01 12:18:00
We are planning to utilize Spring Cloud Config for our service. Our biggest concern is that when the container starts up, it relies on github to be available all the time so that it can pull the config files. In case github is down, what is the best practice to mitigate the issue? I was thinking of storing a local folder of the configs as a backup and configuring the application.yml to fallback to it (I do not know how). I was going to use a Composite Environment Repositories Please see here: Section 2.1.8 However it states: Any type of failure when retrieving values from an environment

Difference between Spring Cloud Vault and Spring Cloud Config with Vault backend

柔情痞子 提交于 2019-12-01 06:39:08
问题 What is the difference between the followings? Spring Cloud Vault - http://cloud.spring.io/spring-cloud-vault/ Spring Cloud Config Server with Vault backend - http://cloud.spring.io/spring-cloud-static/Camden.SR4/#_spring_cloud_config_server 回答1: Spring Cloud Vault is more lightweight because it does not require to run a java server (Spring Cloud Config Server) as a frontend for Vault, your Spring Boot app connects directly to Vault. I have a small demo: https://github.com/gmarziou/demo