blog-comments icon indicating copy to clipboard operation
blog-comments copied to clipboard

springcloud(六):配置中心git示例 - ityouknow's Blog

Open ityouknow opened this issue 7 years ago • 35 comments

http://www.ityouknow.com//springcloud/2017/05/22/springcloud-config-git.html

随着线上项目变的日益庞大,每个项目都散落着各种配置文件,如果采用分布式的开发模式,需要的配置文件随着服务增加而不断增多。某一个基础服务信息变更,都会引起一系列的更新和重启,运维苦不堪言也容易出错。配置中心便是解决此类问题的灵丹妙药。

ityouknow avatar Dec 25 '17 09:12 ityouknow

博主大神好, uri: https://github.com/ityouknow/spring-cloud-starter/ # 配置git仓库的地址 为什么这个uri可以定位到https://github.com/ityouknow/spring-cloud-examples ?

githubtodj avatar Jan 13 '18 03:01 githubtodj

@githubtodj 博主大神好, uri: https://github.com/ityouknow/spring-cloud-starter/ # 配置git仓库的地址 为什么这个uri可以定位到https://github.com/ityouknow/spring-cloud-examples ?

因为是才能最初是spring-cloud-starter 最后改名成 spring-cloud-examples

ityouknow avatar Jan 13 '18 06:01 ityouknow

我刚试了一下,自己用spring-cloud-starter/ 也可以定位到自己的spring-cloud-examples/,好神奇啊,有点懵啊,大神,这是不是个bug,哈哈

githubtodj avatar Jan 13 '18 07:01 githubtodj

感觉有些小问题,前边配置文件中server端口是8004,到后文测试时使用的是8001...

zhaoxjmail avatar Mar 16 '18 07:03 zhaoxjmail

Could not resolve placeholder 'neo.hello' in value "${neo.hello}" client端启动报错,找不到配置文件

wangjian5 avatar Apr 04 '18 03:04 wangjian5

http://localhost:8001/neo-config/dev 中的propertySources是个空数组,我在github上也配置了config-repo了, 请问是什么原因?

mengday avatar Apr 19 '18 08:04 mengday

请问为什么在spring-cloud-examples有一个config-repo, 在spring-cloud-config-git也还有一个config-repo, 请问两个都必须要有吗?

mengday avatar Apr 19 '18 09:04 mengday

@wangjian5 Could not resolve placeholder 'neo.hello' in value "${neo.hello}" client端启动报错,找不到配置文件

xuan1990 avatar Apr 19 '18 16:04 xuan1990

@wangjian5 Could not resolve placeholder 'neo.hello' in value "${neo.hello}" client端启动报错,找不到配置文件

client端的pom文件中不能有spring-cloud-config-server这个jar,把这个去掉就好了

xuan1990 avatar Apr 19 '18 16:04 xuan1990

755543204@yuanjihui

ityouknow avatar May 03 '18 10:05 ityouknow

为了更多的人能学到知识,我转载了,见谅啊!!!

haopenge avatar May 04 '18 07:05 haopenge

在说明client 启动类注解那里,复制了一句是配置server启动类的内容

xiolovelife avatar Jun 08 '18 10:06 xiolovelife

能讲下,config server 使用git 私服的配置吗,公司现在需要用私服搭建配置中心

hhecho avatar Jul 02 '18 03:07 hhecho

authentication not supported gitlab 设置为public 项目? 坑一个?

linliangxuan avatar Aug 24 '18 01:08 linliangxuan

博主真棒,解决了我启动报错的问题,666

fefe-wb avatar Nov 13 '18 03:11 fefe-wb

Unregistering JMX-exposed beans

763329279 avatar Nov 20 '18 15:11 763329279

说说我这边的情况,按照demo写的,启动之后 第一个warn是:Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/。然后下面第二个warn:Error creating bean with name 'helloController',接着就是error:Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'ares.hello' in value "${ares.hello}",试过各种办法,求大神帮助

AresJian avatar Nov 27 '18 07:11 AresJian

@AresJian 说说我这边的情况,按照demo写的,启动之后 第一个warn是:Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/。然后下面第二个warn:Error creating bean with name 'helloController',接着就是error:Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'ares.hello' in value "${ares.hello}",试过各种办法,求大神帮助

大兄弟,你这个解决了吗?一样的问题,怎么才能不使用默认的8888

PaulingX avatar Feb 01 '19 01:02 PaulingX


java.lang.NullPointerException: null at org.springframework.cloud.config.server.support.GitCredentialsProviderFactory.createFor(GitCredentialsProviderFactory.java:93) ~[spring-cloud-config-server-2.0.2.RELEASE.jar:2.0.2.RELEASE]```

博主你好  启动clientserver后 访问config资源总是报这样的错误?不知道还有别的小伙伴遇到么? 找到类似的issue https://github.com/spring-cloud/spring-cloud-config/issues/1061  不确定是不是windows系统的问题 

wyzlove avatar Mar 15 '19 09:03 wyzlove

@xuan1990

@wangjian5 Could not resolve placeholder 'neo.hello' in value "${neo.hello}" client端启动报错,找不到配置文件

这个问题解决了吗 我也是这个错误

Gbuyg avatar Mar 21 '19 05:03 Gbuyg

@AresJian 说说我这边的情况,按照demo写的,启动之后 第一个warn是:Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/。然后下面第二个warn:Error creating bean with name 'helloController',接着就是error:Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'ares.hello' in value "${ares.hello}",试过各种办法,求大神帮助

大兄弟,你这个解决了吗?一样的问题,怎么才能不使用默认的8888

configclient配置文件 加一个设置 spring.cloud.config.uri = http://localhost:8001 可以更改默认的8888端口

wyzlove avatar Mar 21 '19 05:03 wyzlove

解决了 要先启动服务端 在启动客户端 单独起会报这个错

Gbuyg avatar Mar 21 '19 05:03 Gbuyg

@xuan1990

@wangjian5 Could not resolve placeholder 'neo.hello' in value "${neo.hello}" client端启动报错,找不到配置文件

这个问题解决了吗 我也是这个错误

pom文件不要引入eureka-server这个jar,要引入config-client。也就是不要第一个,要第二个,我的是这样解决的。 <!--<dependency>--> <!--<groupId>org.springframework.cloud</groupId>--> <!--<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>--> <!--</dependency>-->

<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-client</artifactId> </dependency>

caiworld avatar Mar 25 '19 09:03 caiworld

@wangjian5 Could not resolve placeholder 'neo.hello' in value "${neo.hello}" client端启动报错,找不到配置文件

maven应该引入org.springframework.cloud:spring-cloud-config-client,启动类只需要加@SpringBootApplication注解,这样客户端就可以自动发现server了,不需要其他操作

wanfanfan avatar Apr 03 '19 02:04 wanfanfan

@mengday http://localhost:8001/neo-config/dev 中的propertySources是个空数组,我在github上也配置了config-repo了, 请问是什么原因?

你好这个问题找到答案了么? 我的也是这样

zuoshoudao avatar Apr 09 '19 08:04 zuoshoudao

那个。。颜值高没看到在哪体现额

DaySurprise avatar Apr 18 '19 03:04 DaySurprise

学会了,又学一招,nice

java-aodeng avatar Apr 18 '19 14:04 java-aodeng

@xblPauling

@AresJian 说说我这边的情况,按照demo写的,启动之后 第一个warn是:Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/。然后下面第二个warn:Error creating bean with name 'helloController',接着就是error:Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'ares.hello' in value "${ares.hello}",试过各种办法,求大神帮助

大兄弟,你这个解决了吗?一样的问题,怎么才能不使用默认的8888

@xblPauling

@AresJian 说说我这边的情况,按照demo写的,启动之后 第一个warn是:Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/。然后下面第二个warn:Error creating bean with name 'helloController',接着就是error:Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'ares.hello' in value "${ares.hello}",试过各种办法,求大神帮助

大兄弟,你这个解决了吗?一样的问题,怎么才能不使用默认的8888

@wyzlove

@AresJian 说说我这边的情况,按照demo写的,启动之后 第一个warn是:Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/。然后下面第二个warn:Error creating bean with name 'helloController',接着就是error:Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'ares.hello' in value "${ares.hello}",试过各种办法,求大神帮助

大兄弟,你这个解决了吗?一样的问题,怎么才能不使用默认的8888

configclient配置文件 加一个设置 spring.cloud.config.uri = http://localhost:8001 可以更改默认的8888端口

hougangjian avatar May 17 '19 10:05 hougangjian

server.port=8002

hougangjian avatar May 17 '19 10:05 hougangjian

@zuoshoudao

@mengday http://localhost:8001/neo-config/dev 中的propertySources是个空数组,我在github上也配置了config-repo了, 请问是什么原因?

你好这个问题找到答案了么? 我的也是这样

你看看你github配置的目录对了么?

xiaxiaorui2003 avatar Jun 04 '19 13:06 xiaxiaorui2003