【SpringCloud】06. Eureka summary
•
Java
1. Two notes:
1. @ enableeurekaserver - add on startup class
It provides the function of service registration. After each service node is started, it will be registered in eurekaserver, so that eurekaserver has the information of all service nodes
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class,args);
}
}
2. @ enablediscoveryclient or @ enableeurekaclient - start class plus
Indicates that this is an Eureka client
@SpringBootApplication
@EnableDiscoveryClient
public class ClientApplication {
public static void main(String[] args) {
SpringApplication.run(ClientApplication.class,args);
}
}
2. Function
3. High availability of Eureka (more than 2 sets are recommended for production)
Configuration principle: point the registry to other registries respectively
4. In distributed system, service registry is the most important basic part
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码