Eureka cluster configuration

Before writing an article is configured in Eureka spring-cloud service registration and discovery, not a small partner to my blog to see

Previously configured stand-alone version of Eureka, Eureka service this time hung up, then our service providers with service consumers would not have waste? Then this program as well as the meaning of existence it?

So today we will talk about how to solve this problem. I believe we all know, the problem is that we must provide high availability service experience. The solution is to add a cluster, then we look at how to achieve Eureka clusters it.

A, Eureka cluster configuration

1, first of all, we need a cluster, you need to configure more than two service centers, specifically how to configure, see my last blog post,

2, two cluster as an example, we need to own yml file

# Port 6001 of a service center
server:
  port: 6001
eureka:
  instance:
    hostname: Eureka6001
  client:
    the Register the -with-Eureka: false # service registered false they are not registered with the service center
    fetchRegistry: false    # Service said he found the end registry is my duty is to maintain service instance false   they do not get the registration information
    Service - url: the case of # cluster between the server To register with each other, pointing at each other
      defaultzone: HTTP: // Eureka7001.com:7001/eureka/ 
#http: // Eureka7001.com:7001/eureka/ point to another port for the 7001 service center
# Port 7001 of a service center
Server: 
Port: 7001
Eureka:
instance:
hostname: Eureka7001 # server domain
Client:
the Register-with-Eureka: false # service registered false they are not registered with the service center
fetchRegistry: false # Service Discovery said he end is the registry was my job maintenance service instance they do not get false registration information
service-url: # cluster under the circumstances, between the server to register with each other, pointing at each other
defaultZone: http://Eureka6001.com:6001/eureka/
#http: //Eureka6001.com: 6001 / eureka / 6001 point to another port for the service center
#http: // Eureka7001.com : 7001 / Eureka / point to another port for the service center 7001 
above the red mark is because, when we need to Eureka cluster service center, we need to access various service centers through new domain name monitoring page, this time we want to change my ip domain name on the computer

In the C: \ Windows \ System32 \ drivers \ etc in the bottom of the host file plus

127.0.0.1 Eureka6001.com instance corresponding to the hostname two Eureka,
127.0.0.1 Eureka7001.com

3, the new service center configured, only yml file in the client's

 

 4, domain name and port number to access the corresponding view

 

 

 

 

 

Himself readily made my notes, I hope to help everyone

 

 

Guess you like

Origin www.cnblogs.com/guanyuehao0107/p/11817030.html