一个想进阶的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,然后就去尝试了一下,终于解决问题了

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

报告相同问题?

悬赏问题

  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划