当前位置:网站首页>Eureka cluster setup
Eureka cluster setup
2022-06-11 06:15:00 【Grumpy procedural ape】
preparation Because we use a computer to simulate , All we modify the computer etc Under folder host file Join in :
127.0.0.1 eureka8001.cn
127.0.0.1 eureka8002.cn
Our access to these two addresses is equivalent to accessing the local 127.0.0.1 route
The official start of the
To configure a cluster, you need to register multiple registries with each other Such as : stay 8001 Register in 8002 stay 8002 Register in 8001
Create two eureka The registry serves a port 8001 One port is 8002

8001pom rely on
<dependencies>
<!-- The new version eureka-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<artifactId>cloud-api-commons</artifactId>
<groupId>com.rpf.springcloud</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
8001 yml Profile contents
server:
port: 8001
eureka:
instance:
hostname: eureka8001.cn
client:
register-with-eureka: false #false Does not register itself with the registry .
fetch-registry: false #false It means that its own end is the registration center , My job is to maintain service instances , There's no need to retrieve Services
service-url:
defaultZone: http:/eureka8002.cn:8002/eureka
8001 Start class
@SpringBootApplication
@EnableEurekaServer
public class EurekaMain8001 {
public static void main(String[] args) {
SpringApplication.run(EurekaMain8001.class,args);
}
}
8002pom rely on
<dependencies>
<!-- The new version eureka-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<artifactId>cloud-api-commons</artifactId>
<groupId>com.rpf.springcloud</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
8002yml The configuration file
server:
port: 8002
eureka:
instance:
hostname: eureka8002.cn
client:
register-with-eureka: false #false Does not register itself with the registry .
fetch-registry: false #false It means that its own end is the registration center , My job is to maintain service instances , There's no need to retrieve Services
service-url:
defaultZone: http:/eureka8001.cn:8001/eureka
8002 Start class
@SpringBootApplication
@EnableEurekaServer
public class EurekaMain8002 {
public static void main(String[] args) {
SpringApplication.run(EurekaMain8002.class,args);
}
}
Then we can start two projects
visit eureka8001.cn:8001
or
eureka8002.cn:8002
You can see that each other has registered their services
边栏推荐
- MySQL implements over partition by (sorting the data in the group after grouping)
- Simple understanding of pseudo elements before and after
- 數組部分方法
- Installing MySQL for Linux
- Shuffleerror:error in shuffle in fetcher solution
- [metadata]linkedin datahub
- Login and registration based on servlet, JSP and MySQL
- qmake 实现QT工程pro脚本转vs解决方案
- Which company is better in JIRA organizational structure management?
- Sqli-libs post injection question 11-17 actual combat
猜你喜欢

箭头函数的this指向

通过R语言且只用基础package来制作一个小游戏
![Chapter 4 of machine learning [series] naive Bayesian model](/img/77/7720afe4e28cd55284bb365a16ba62.jpg)
Chapter 4 of machine learning [series] naive Bayesian model

jenkins-用户权限管理

How to use perforce helix core with CI build server

This is probably the most comprehensive project about Twitter information crawler search on the Chinese Internet

Can Amazon, express, lazada and shrimp skin platforms use the 911+vm environment to carry out production number, maintenance number, supplement order and other operations?

FPGA面试题目笔记(三)——跨时钟域中握手信号同步的实现、任意分频、进制转换、RAM存储器等、原码反码和补码

FPGA interview notes (II) -- synchronous asynchronous D flip-flop, static and dynamic timing analysis, frequency division design, retiming

Topic collection of FIFO minimum depth calculation
随机推荐
[usual practice] explore the insertion position
Stock K-line drawing
MySQL implements over partition by (sorting the data in the group after grouping)
Notes sur les questions d'entrevue de la FPGA (IV) - - détecteur de séquence, Code gris dans le domaine de l'horloge croisée, opération de ping - pong, réduction de la perte statique et dynamique, err
Thymeleafengine template engine
Simple understanding of pseudo elements before and after
Ethical discussion on reptile Technology
FPGA设计中提高工作频率及降低功耗题目合集
Box model
LeetCodeT526
Clear function of ArrayList
Shandong University machine learning final 2021
Login and registration based on servlet, JSP and MySQL
Quartz2d drawing technology
FPGA interview notes (II) -- synchronous asynchronous D flip-flop, static and dynamic timing analysis, frequency division design, retiming
Shuffleerror:error in shuffle in fetcher solution
This point of arrow function
What is a planning BOM?
Installing and using sublist3r in Kali
PgSQL reports an error: current transaction is aborted, commands ignored until end of transaction block