springcloud--Service Governance Mechanism note

Source: Internet
Author: User

springcloud--Service Governance Mechanism note service governance mechanism

Service Provider

Service Registration
The service provider registers itself on the Eureka Server at boot time by sending a rest request, with some metadata information for its own service.

eureka.client.register-with-eureka=true: Start the registration operation

Service synchronization

Service Renewal

eureka.instance.lease-renewal-interval-in-seconds=30: Call interval for defining service renewal tasks, default 30 seconds
eureka.instance.lease-expiration-duration-in-seconds=90: Used to define the time of service invalidation, default is 90 seconds

Service consumers

Get Service
Service invocation
Services offline

Service Registration Center
Failure culling
Self-protection
eureka.server.enable-self-preservation=false: Turn off the protection mechanism (ensure that the registry can remove the unavailable instances correctly)

SOURCE Analysis

Discoveryclient class
This class is used to help collaborate with Eureka Server.

The Eureka client is responsible for the following tasks:

    • Registering a service instance with the Eureka server
    • Service Lease to Eureka Server
    • Canceling leases to Eureka Server during service shutdown
    • Querying the list of service instances in Eureka Server

Eureka client also needs to configure a list of URLs for the Eureka server

Region, Zone

Serviceurls

Service Registration

Service Acquisition and service renewal

Service Registration Center Processing

Detailed configuration

Eureka client configuration is mainly divided into the following two aspects:

    • The configuration information related to the service registration, including the address of the service registry, the time interval for service acquisition, the availability zone, and so on.
    • The configuration information related to the service instance, including the name of the service instance, IP address, port number, health check path, and so on.
      Note: To turn off the "self-protection" feature of the registry by setting the Enableselfpreservation parameter in the class to prevent closed instances from being rejected by the service registry
Service Registration class Configuration

Specify a registration center

eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/

Or

eureka.client.serviceUrl.defaultZone=http://peer1:1111/eureka/,http://peer2:1112/eureka/

Security check

http://<username>:<password>@localhost:1111/eureka/

Where <username>, <password> the user name, password for the security check information, respectively

Other configurations

Service Instance class configuration

    • Meta data
      It is an object that the Eureka client uses to describe its service information when it sends a registration request to the service registry, which contains standardized metadata such as service name, instance name, instance IP, instance port, and other important information for service governance , and some custom metadata information for load balancing strategies or other special purposes
      eureka.instance.metadataMap.zone=shanghai
    • Instance Name configuration

    • Endpoint Configuration


    • Health monitoring
    • Other configurations

Cross-platform support
    • Communication protocols
      Slightly...

springcloud--Service Governance Mechanism note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.