Open dyc87112 opened 6 years ago
config服务端可以访问,成功返回数据。。但是config客户端访问一直是404。。
注意是 bootstrap.yml 不是 application.yml
DD老大,请问client配置了通过config server抓取配置文件,运行时是否能使用命令行设置server.port为其他值?比如:
java -jar target\client-demo-1.0.0.BUILD-SNAPSHOT.jar --spring.profiles.active=test --server.port=9999
貌似还是使用了test里面的端口号。
为什么我直接访问/info ,404呢? 使用@value 能获取到 info.profile 属性... ...
DD大佬,config-client端访问总是404,什么原因
按照步骤来的,访问info出现404,怎么回事呀
@zhangxianseng 按照步骤来的,访问info出现404,怎么回事呀
是不是用的spring boot 2.0?是的,actuator下的端点都默认为:/actuator开头了噢,比如/info变为/actuator/info
@zhangxianseng 按照步骤来的,访问info出现404,怎么回事呀
是不是用的spring boot 2.0?是的,actuator下的端点都默认为:/actuator开头了噢,比如/info变为/actuator/info
可以了,3Q
config 启动都启动不了,也没有报错
@RestController public class InfoController {
@Value("${info.profile}")
String info;
@RequestMapping(value = "/info")
public String info(){
return info;
}
}
注入访问可以
clinet访问结果是{},是因为没有去call server,为什么会这样?求解决
@licer-lee DD大佬,config-client端访问总是404,什么原因
同问
你在 后面高可用与动态刷新可以看到 这里的404 得到解决了
好像现在client端要导这个依赖
少了一个依赖,路径没错,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
404 的可能原因:
1.少了依赖spring-boot-starter-actuator
2.springboot2.0版本/info变为/actuator/info
http://blog.didispace.com/spring-cloud-starter-dalston-3/
Spring Cloud Config是Spring Cloud团队创建的一个全新项目,用来为分布式系统中的基础设施和微服务应用提供集中化的外部配置支持,它分为服务端与客户端两个部分。其中服务端也称为分布式配置中心,它是一个独立的微服务应用,用来连接配置仓库并为客户端提供获取配置信息、加密/解密信息等访问接口;而客户端