spring-cloud-alibaba nacos1.3.0开始认证单个项目,读取不到配置文件

cl25kdpy  于 2022-10-27  发布在  Spring
关注(0)|答案(1)|浏览(443)

一、版本信息

  • nacos1.3.0
  • com.alibaba.cloud的版本是: <nacos.version>2.2.1.RELEASE</nacos.version>
  • nacos-client-1.1.4.jar

二、yml配置文件

cloud:
  nacos:
    discovery:
      server-addr: 172.16.88.22:8848
      namespace: 61c331c4-a805-4e8c-8ec4-c5d6209747a8
      username: nacos
      password: nacos
    config:
     server-addr: 172.16.88.22:8848
     file-extension: yml
     namespace: 61c331c4-a805-4e8c-8ec4-c5d6209747a8
     username: nacos
     password: nacos
     shared-configs: gi-common-config-test.yml

三、错误信息

  • nacos在那别的项目配置空间以及发现是可行的
  • 我换了过nacos的连接地址,是显示错误的,然后写正确的地址就出现权限问题
2021-02-02 09:33:02.409 ERROR 5044 --- [           main] c.a.n.client.config.impl.ClientWorker    : [fixed-172.16.88.11_8848-61c331c4-a805-4e8c-8ec4-c5d6209747a8] [sub-server-error] no right, dataId=gi-etl-microservice-develop.yml, group=DEFAULT_GROUP, tenant=61c331c4-a805-4e8c-8ec4-c5d6209747a8
2021-02-02 09:33:02.410 ERROR 5044 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : get data from Nacos error,dataId:gi-etl-microservice-develop.yml, 

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'>Tue Feb 02 09:33:01 GMT+08:00 2021</div><div>There was an unexpected error (type=Forbidden, status=403).</div><div>unknown user!</div></body></html>
 at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:260) ~[nacos-client-1.1.4.jar:na]
  • debug到出错源码(NacosPropertySourceBuilder)
data = configService.getConfig(dataId, group, timeout);
rdlzhqv9

rdlzhqv91#

Nacos Config 相关的配置在bootstrap文件中,请详细参考文档 Nacos Config Wiki .

相关问题