config远端仓库的client端报错

来源:6-3 Config Client

慕虎3103396

2018-09-18

config server 启动可以拿到配置文件,但是启动order就报错,yml文件也改成了bootstrap.yml,
bootstrap的配置内容:
spring:
application:
name: order
cloud:
config:
discovery:
enabled: true
service-id: CONFIG
profile: dev
debug: true
报错内容:
APPLICATION FAILED TO START


Description:

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
图片描述图片描述

这里是标题文字

写回答

4回答

廖师兄

2018-09-18

可以说下怎么解决的,并采纳为正确答案

0
0

一路向北吧

2019-08-07

该问题也折腾了很久,发现如果注册中心不是采用默认的8761端口,需要在client端追加配置,例如

eureka:
 client:
   service-url:
     defaultZone: http://localhost:8762/eureka/

才能正常取值CONFIG服务端配置信息

0
0

慕虎3103396

提问者

2018-09-25

将端口号改成默认的8761就可以了


0
1
LeoStudying
你好同学,请问是-Dserver.port=8081改成-Dserver.port=8761还是eureka: client: service-url: defaultZone: http://localhost:8761/eureka/这里? 这是我的git 上的配置文件 spring: application: name: order datasource: driver-class-name: com.mysql.jdbc.Driver username: root password: root url: jdbc:mysql://127.0.0.1:3306/springcloud_sell?characterEncoding=utf-8&useSSL=false rabbitmq: host: 127.0.0.1 port: 5672 username: guest password: guest env: test13 girl: name: mo age: 17 eureka: client: service-url: defaultZone: http://localhost:8761/eureka/ bootstrap.yml内容 spring: # application: # name: order cloud: config: discovery: enabled: true service-id: CONFIG profile: test 希望同学指点一下,谢谢啦
2018-11-17
共1条回复

慕虎3103396

提问者

2018-09-18

问题已经解决了

0
0

SpringCloud Finchley(M2+RELEASE+SR2)微服务实战

SpringCloud组件实现微服务,【已升级Finchley.Release】

5672 学习 · 2489 问题

查看课程