一个想进阶的java菜鸟 2019-07-31 11:23 采纳率: 50%
浏览 811
已采纳

springcloud config client 拉取服务配置时,请求git的路径错误,想知道怎么修改这个Url

11:14 INFO  [o.s.c.c.c.ConfigServicePropertySourceLocator] Fetching config from server at: http://http://39.105.51.182:8052/
11:14 WARN  [o.s.c.c.c.ConfigServicePropertySourceLocator] Could not locate PropertySource: I/O error on GET request for "http://http/39.105.51.182:8052/user-service/dev": http; nested exception is java.net.UnknownHostException: http
11:14 INFO  [c.c.m.MamabuyUserServiceApplication] The following profiles are active: dev

以上是项目启动日志,查看时,发现拉取git配置的url是有问题的,
Could not locate PropertySource: I/O error on GET request for "http://http/39.105.51.182:8052/user-service/dev": http; nested exception is java.net.UnknownHostException: http

想知道如何修改这个玩意,初次使用cloud,一下是bootstrap.yml配置

server:
  port: 8053
spring:
  application:
    name: user-service
  profiles:
      active: dev
  cloud:
      config:
        profile: dev
        discovery:
          enabled: true
          service-id: config-server

sharding:
  jdbc:
    datasource:
      names: ds
      ds:
        name: user
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        filters: stat
        maxActive: 20
        initialSize: 1
        maxWait: 60000
        minIdle: 1
        timeBetweenEvictionRunsMillis: 60000
        minEvictableIdleTimeMillis: 300000
        validationQuery: select 'x'
        testWhileIdle: true
        testOnBorrow: false
        testOnReturn: false
        poolPreparedStatements: true
        maxOpenPreparedStatements: 20
    config:
      sharding:
        tables:
          t_user:
            actual-data-nodes: ds.t_user_${0..2}
            key-generator-column-name: uuid
            table-strategy:
              inline:
                sharding-column: uuid
                algorithm-expression: t_user_${uuid % 3}



eureka:
  client:
    service-url:
      defaultZone: ***********
#  instance:
#    ip-address: *********
#    prefer-ip-address: true

#log
logging:
    config: classpath:logback.xml

拉取yml的配置:

server:
  port: 8052
spring:
  application:
    name: config-server
  cloud:
    config:
      server:
        git:
          uri: https://gitee.com/xp890123/mamabug-cofig-repo.git
          password:
          username: 
          #搜索已配置的文件夹
          search-paths: common-config,gatewat-config,key-generator-config,stock-service-config,trade-service-config,user-service-config
          skip-ssl-validation: true
  • 写回答

1条回答 默认 最新

  • 关注

    研究了半天,突发奇想,会不会是绑定ip的时候,多加了个http,然后就去尝试了一下,终于解决问题了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用CInternetSession,CHttpFile读取网页文件时有些电脑上会卡住怎么办?
  • ¥15 水下机器人的半物理仿真研究
  • ¥15 微服务假死,一段时间后自动恢复,如何排查处理
  • ¥50 webrtc-streamer TCP rtsp
  • ¥15 cplex运行后参数报错是为什么
  • ¥15 之前不小心删了pycharm的文件,后面重新安装之后软件打不开了
  • ¥15 vue3获取动态宽度,刷新后动态宽度值为0
  • ¥15 升腾威讯云桌面V2.0.0摄像头问题
  • ¥15 关于Python的会计设计
  • ¥15 聚类分析 设计k-均值算法分类器,对一组二维模式向量进行分类。