我代码拉取的是gitlab下cloud项目的1.3分支我所有微服务启动都不能获取到nacos中application-dev.yml,以我的yshop-gateway的bootstrap.yml配置为例,如下图
编译运行如下:
nacos中application-dev.yml配置如下:
# Springspring: jackson: serialization: write-dates-as-timestamps: true datasource: username: root password: 123456 redis: database: 0 host: 10.5.31.13 port: 6379 password: lettuce: pool: max-active: 2000 max-wait: 10000 max-idle: 500 min-idle: 8 timeout: 5000#请求处理的超时时间ribbon: ReadTimeout: 10000 ConnectTimeout: 10000# feign 配置feign: sentinel: enabled: true okhttp: enabled: true httpclient: enabled: false client: config: default: connectTimeout: 10000 readTimeout: 10000 compression: request: enabled: true response: enabled: true# 暴露监控端点management: endpoints: web: exposure: include: '*'# 认证配置security: oauth2: client: client-id: yshop client-secret: 123456 scope: server resource: loadBalanced: true token-info-uri: http://yshop-auth/oauth/check_token ignore: urls: - /v2/api-docs - /actuator/** - /user/info/* - /api/auth/** - /weixinOauth/** - /shopindex/** - /operlog - /logininfor - /wechat/notify - /notify/refund - /wechat/serve - /wechat/auth - /wxapp/config - /wechat/config - /logs/save - /file/** - /upload/** - /localStorage/** - /admin/order/detail/* - /order/paySuccess - /article/** - /order/retrunStock - /canvas/** - /products/integral - /yxSystemConfig/getData# 文件存储路径file: path: /home/yshop/file/ avatar: /home/yshop/avatar/ # 文件大小 /M maxSize: 100 avatarMaxSize: 5mybatis-plus: check-config-location: true mapperLocations: classpath:mapper/**/*.xml configuration: map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: id-type: auto logic-delete-value: 1 logic-not-delete-value: 0#是否允许生成代码,生产环境设置为falsegenerator: enabled: true# swagger 配置swagger: title: 系统模块接口文档 license: Powered By yshop licenseUrl: https://www.yixiang.co authorization: name: Yshop OAuth auth-regex: ^.*$ authorization-scope-list: - scope: server description: 客户端授权范围 token-url-list: - http://10.5.31.13:8081/auth/oauth/tokentask: pool: # 核心线程池大小 core-pool-size: 10 # 最大线程数 max-pool-size: 30 # 活跃时间 keep-alive-seconds: 60 # 队列容量 queue-capacity: 50yshop: tenant: tenantIdColumn: tenant_id enabled: true
另外yshop-visual -> yshop-xxl-job-admin -> XxlJobAdminApplication类是不是缺少@EnableDiscoveryClient注释啊