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

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问