Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 使用nacos作为规则数据源时,获取初始化配置失败 #3401

Open
DR-YangLong opened this issue May 22, 2024 · 1 comment
Open

Comments

@DR-YangLong
Copy link

Issue Description

Type: bug report

Describe what happened

当spring boot应用使用nacos作为sentinel数据源时,启动时会到nacos server获取一次初始化配置,但是由于nacos账号密码配置在此时还没有初始化到SecurityProxy中,导致初始化配置读取失败

Describe what you expected to happen

nacos账号密码配置在读取远程初始化配置前初始化完成

How to reproduce it (as minimally and precisely as possible)

  1. spring boot 2.6.14版本
  2. spring-cloud-starter-alibaba-sentinel 2021.0.5.0版本,使用nacos作为数据源
  3. nacos client 1.4.7版本
  4. 简单spring boot应用,配置使用nacos作为规则数据源即可验证

Tell us your environment

如上

Anything else we need to know?

@DR-YangLong DR-YangLong changed the title [BUG] May 22, 2024
@cyril-lee-zh
Copy link

hi, sentine nacos-datasource的nacos配置是需要单独配的, 不是和 spring.cloud.nacos.config 同一套配置的
不知道你是不是由于这个问题误解了
nacos-datasource配置:
spring.cloud.sentinel.datasource.ds1.nacos.server-addr=localhost #spring.cloud.sentinel.datasource.ds1.nacos.context-path= spring.cloud.sentinel.datasource.ds1.nacos.username= spring.cloud.sentinel.datasource.ds1.nacos.password= spring.cloud.sentinel.datasource.ds1.nacos.data-id= spring.cloud.sentinel.datasource.ds1.nacos.namespace= spring.cloud.sentinel.datasource.ds1.nacos.rule-type=flow
@see com.alibaba.cloud.sentinel.SentinelProperties#datasource
@see com.alibaba.cloud.sentinel.datasource.configDataSourcePropertiesConfiguration

是从单独的 NacosConfigService 中获取配置的,用户名密码什么的设置应该是没有问题的
我验证了 nacos-client 1.3.1 是没问题的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants