Changing default port of eureka server using spring cloud

后端 未结 3 1988
囚心锁ツ
囚心锁ツ 2021-01-05 03:26

I got to spring-boot application, an eureka server and an eureka client.

Here is my server configuration

server:
  port: 8761

spring:
  application:         


        
相关标签:
3条回答
  • 2021-01-05 04:15

    Yep. as per Shchipunov comment the below properties do the job 1-eureka.instance.hostname=localhost (eureka server) 2-eureka.client.serviceUrl.defaultZone (client project)

    0 讨论(0)
  • 2021-01-05 04:21

    Try this configuration: 1. Server.

    server:
      port: 8080
    
    eureka:
      instance:
       hostname: localhost
    client:
      registerWithEureka: false
      fetchRegistry: false
      serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
    

    2. Client.

    spring:
      application:
      name: eureka-client
    server:
      port: 8083
    eureka:
      client:
      registerWithEureka: true
      fetchRegistry: true
      serviceUrl:
        defaultZone: http://localhost:8080/eureka/
    
    0 讨论(0)
  • 2021-01-05 04:25

    You just need to add eureka.client.service-url.defaultZone=http://localhost:8080/eureka in your server application.yml file and remove quotes around url in both files.

    remove quotes around url (Don't forget it)

    0 讨论(0)
提交回复
热议问题