Reputation: 43
I am using Spring Cloud Eureka Server and Config Server, as Discovery First, and my problem is:
When a service registry it self in the eureka server the Config Server URL it returns is http://LOCALHOST:8888 intead of the http://{HOST_NAME}}:8888 and them all the other services hosted in another servers cannot find its configuration.
Log line:
Fetching config from server at: http://localhost:8888
Is there any configuration I can do to fix it?
The application.yml of configuration server is like that:
server:
port: 8888
spring:
application:
name: configserver
profiles:
active: native
cloud:
config:
server:
native:
searchLocations: /opt/config_dir
eureka:
client:
serviceUrl:
defaultZone: http://10.111.22.33:8761/eureka,http://10.111.33.44:8761/eureka
The config client bootstrap.yml is like this:
spring:
application:
name: show-service
profiles:
active: dev
cloud:
discovery:
enabled: true
eureka:
client:
serviceUrl:
defaultZone: http://10.111.22.33:8761/eureka,http://10.111.33.44:8761/eureka
Upvotes: 0
Views: 1413
Reputation: 264
i solved this issue by deploy my project
mvn deploy
hope this solve your problem
Upvotes: 0
Reputation: 1622
By default Discovery First Bootstrap is disabled. You are missing few properties in the config client application - to enable using discovery to look up the config server URL and your config server name (service-id).
spring:
cloud:
config:
discovery:
enabled: true
service-id: configserver
Upvotes: 2