Sentinel规则持久化到Nacos配置中心报错

92dk7w1h  于 2个月前  发布在  Nacos
关注(0)|答案(3)|浏览(36)

版本

  • sentinel 1.8.6
  • nacos 2.24

发生的时机

在使用Sentinel的后台管理时候,将配置的限流规则,持久化到nacos时,报错

失败:com.alibaba.nacos.api.exception.NacosException, <html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Wed Mar 20 17:35:49 CST 2024</div><div>There was an unexpected error (type=Forbidden, status=403).</div><div>user not found!</div></body></html>

发生的原因

我知道这是nacos的权限功能的问题,在普通SpringBoot服务连接nacos的依赖是:

<dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>

通过 spring.cloud.nacos.usernamespring.cloud.nacos.password 配置项来连接nacos
但是sentinel没有这个配置,要怎么解决呢

相关问题