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