1.修改host
找到C:\Windows\System32\drivers\etc路径下的hosts文件,加上这么两行
127.0.0.1 eureka7001.com
127.0.0.1 eureka7002.com
2.修改yml
以前是单机,搂一搂
server: port: 7001 eureka: instance: hostname: localhost client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/