ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 部署多台Eureka 将多台Eureka互相注册. 第一种打开方式 ![](https://box.kancloud.cn/42d3b09386171713a213ca58bcd8bad8_972x720.png) 第二种打开方式: ![](https://box.kancloud.cn/f64cbfd541d155c75e00e3563dc094f3_2106x266.png) 拷贝一份: ![](https://box.kancloud.cn/b65fe9b6aa9133af1f885027c8922431_2364x1352.png) ## 配置 第一台: ~~~ server: port: 10087 spring: application: name: eureka-server eureka: client: service-url: defaultZone: http://localhost:10086/eureka instance: prefer-ip-address: true ip-address: 127.0.0.1 ~~~ 第二台: ~~~ server: port: 10086 spring: application: name: eureka-server eureka: client: service-url: defaultZone: http://localhost:10087/eureka instance: prefer-ip-address: true ip-address: 127.0.0.1 ~~~ ![](https://box.kancloud.cn/8b4294ee061cb993eba65f3ba2b86426_710x344.png) 可以看到同名的Eureka服务有两台实例: ![](https://box.kancloud.cn/0aa539e4346d8924a0aad2e5ab2789ef_2592x416.png) ## 其他服务的注册 ~~~ server: port: 8081 spring: application: name: user-server datasource: url: jdbc:mysql://192.168.10.10:3306/jdbc username: homestead password: secret eureka: client: service-url: defaultZone: http://localhost:10086/eureka/,http://localhost:10087/eureka/ //在多个Eureka实例上注册当前服务,用逗号分开 mybatis: type-aliases-package: com.like.pojo ~~~