eureka 配置运行
作者:互联网
本机模拟eureka集群
1.配置系统主机映射文件
<style></style>sudo vim /etc/hosts
添加配置
<style></style>127.0.0.1 server1
127.0.0.1 server2
127.0.0.1 server3
2.项目配置文件
spring:
application:
name: ad-eureka
profiles: server1
server:
port: 8000
eureka:
instance:
hostname: server1
prefer-ip-address: false
client:
service-url:
defaultZone: http://server2:8001/eureka/,http://server3:8002/eureka/
---
spring:
application:
name: ad-eureka
profiles: server2
server:
port: 8001
eureka:
instance:
hostname: server2
prefer-ip-address: false
client:
service-url:
defaultZone: http://server1:8000/eureka/,http://server3:8002/eureka/
---
spring:
application:
name: ad-eureka
profiles: server3
server:
port: 8002
eureka:
instance:
hostname: server3
prefer-ip-address: false
client:
service-url:
defaultZone: http://server1:8000/eureka/,http://server2:8001/eureka/
标签:http,配置,server1,server2,eureka,false,server3,运行 来源: https://www.cnblogs.com/flyyu1/p/10980401.html