springcloud2.x之management.security.enabled=false报错处理

摘要:
请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。2.springcloud2.x的消息总线配置是#RabbitMq的地址、端口,用户名、密码spring.rabbitmq.host=localhostspring.rabbitmq.port=5672spring.rabbitmq.username=guestspring.rabbitmq.password=guest#刷新配置,在springboot2.x之前1.x的management.security.enabled失效,新的配置为management.endpoints.web.exposure.include=bus-refreshconfigServer的启动类加上注解@RefreshScopeconfigClient的启动类也加上注解@RefreshScope修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/actuator/bus-refresh,这个端口号是configServer的。

1.springcloud1.5.x的消息总线配置是

# RabbitMq的地址、端口,用户名、密码
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
# 保证调用 /bus/refresh的时候不需要验证
management.security.enabled=false

configServer的启动类加上注解@RefreshScope

configClient的启动类也加上注解@RefreshScope

修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/bus/refresh,这个端口号是configServer的。

请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。

2.springcloud2.x的消息总线配置是

# RabbitMq的地址、端口,用户名、密码
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672spring.rabbitmq.username=guest
spring.rabbitmq.password=guest

# 刷新配置,在spring boot 2.x 之前1.x的management.security.enabled失效,新的配置为
management.endpoints.web.exposure.include=bus-refresh

configServer的启动类加上注解@RefreshScope

configClient的启动类也加上注解@RefreshScope

修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/actuator/bus-refresh,这个端口号是configServer的。

请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。

3.需要注意的是configClient也要配置RabbiMq。

免责声明:文章转载自《springcloud2.x之management.security.enabled=false报错处理》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇关于对VGA、DVI、HDMI的区别虚表和虚表指针下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

mysql 导出表结构和表数据 mysqldump用法

命令行下具体用法如下: mysqldump -u用戶名 -p密码-d数据库名表名 > 脚本名; 导出整个数据库结构和数据mysqldump -h localhost -uroot -p123456database > dump.sql 导出单个数据表结构和数据mysqldump -h localhost -uroot -p123456 data...

JRebel激活服务搭建

前言 因为平时的开发工具是使用IntelliJ IDEA,所以热部署项目代码的时候,使用的Jrebel。因为Jrebel是收费的,所以以前用的时候都是在网上找破解方法(国人通用做法),在网上找到的办法是输入一个在线激活服务,来进行激活。由于简单方便就一直这样用的,今天早上打开IDEA后发现,Jrebel激活失效了。后来才发现原来之前的在网上找的在线激活服务...

在TOMCAT下配置工程的默认访问设置(转)

对工程的部署一般是将工程的压缩文件放在tomcat安装目录的webapps下,访问时通过键入:http://localhost:8080/xx(假定为本机访问,xx是部署时的应用工程的访问名字)。 而如果直接键入:http://localhost:8080出来的将是tomcat自带的欢迎页面,如何让键入http://localhost:8080出来的是自己...

yum 安装 Mysql error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 开启远程连接 修改登入密码 忘记root密码 配置防火墙规则 随手mark

yum 安装 MYsql:        yum install mysql mysql-server mysql-devel -y 1.1 登入报错: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决办法:# service...

hadoop集群搭建

一、准备工作: 1、环境:CentOS6.4-64bit JDK1.7-64bit 基于虚拟机拷贝4个虚拟机,一个作为Master,另外三个作为Slave,在这拷贝出来的四台虚拟机上分别执行下面的脚本初始化网卡eth0设备: /install/initNetwork.sh 2、配置集群网络 A、Master机器: 1 #配置主机名 2 hostname...

linux sed 批量替换字符串

比如,要将目录/modules下面所有文件中的zhangsan都修改成lisi,这样做: sed -i "s/zhangsan/lisi/g" `grep zhangsan -rl /modules` 解释一下:-i 表示inplace edit,就地修改文件 -r 表示搜索子目录 -l 表示输出匹配的文件名 这个命令组合很强大,要注意备份文件。(1)...