eureka本地集群配置eureka集群

eureka本地集群配置eureka集群eureka 本地集群配置 eureka 集群 server port 4000 spring application name eurkea server eureka server enable self preservation false 关闭自我保护 缺省为打开 eviction interval timer in ms 5000

eureka本地集群配置eureka集群

server:
port: 4000

spring:
application:
name: eurkea-server

eureka:
server:
enable-self-preservation: false # 关闭自我保护(缺省为打开)
eviction-interval-timer-in-ms: 5000 # 扫描失效服务的间隔时间(缺省为60*1000ms)
client:
fetch-registry: true # 从注册中心获取服务注册信息(缺省为true)
register-with-eureka: true # 是否将自己注册到注册中心(缺省为true)
#service-url:
#defaultZone: http://d2:88/eureka/,http://d3:88/eureka/

instance:
#hostname: d1
prefer-ip-address: false

注意:要配置nginx

	 server {
listen 88;
server_name d1;
location / {
proxy_pass http://localhost:9501;
root html;
index index_test1.html index_test1.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

server {
listen 88;
server_name d2;
location / {
proxy_pass http://localhost:9502;
root html;
index index_test1.html index_test1.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

server {
listen 88;
server_name d3;
location / {
proxy_pass http://localhost:9503;
root html;
index index_test1.html index_test1.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

要修改hosts文件
C:\Windows\System32\drivers\etc\hosts文件

启动成功之后可以看到

编程小号
上一篇 2025-04-10 12:17
下一篇 2025-06-03 12:06

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/hz/127262.html