OpenResty and Consul implement a service-based Grid ServiceMesh

 

First, the logical architecture

 

1 , based on OpenResty develop intelligent agent, using its programmable dynamic characteristics, dynamic configuration nginx service routing.

2 , may need to OpenResty add weibo open source upsync service discovery module.

3 , based consul construction of micro cluster service registry.

4 , each of the grid service node comprises at least one intelligent agent, a plurality of micro-services, each node together form a grid and register the service center .

5 , the need to report their service information to the registry each micro service starts, including ip, port, service name, and so on.

6 , intelligent agent configuration according to their own needs from the registry and pull the corresponding dynamic service list information, and reveal all the details to make landing at the local, prevent registry is not available.

7 , thus, for each micro-services:

( 1 ) External access can be provided by the service name to be accessed by the intelligent agent upstream dynamic load balancing access.

( 2 ) provide services, it is only invoked at startup rest API to provide their service to the registry information to the cluster.

 

Second, the components of the functional requirements

1, intelligent proxy

(1) Configuration and deposit service registry the URL of , the configuration of this node external services needed List .

(2) is responsible for sending (forwarding) This node on each service service registration request to the service registry.

(3) According to external service list dynamic access to the service details to the service registry, by openresty embedded lua scripts to dynamically generate the local configuration LOCATION , proxy_pass , upstream , etc., for this node node service calls.

2, service registry

(1) storing each service service information.

(2) availability, no single point of failure.

(3) have a unified management interface for each node and service of view, health monitoring.

(4) provide rest API used to register, delete services and other services.

 

Guess you like

Origin www.cnblogs.com/lyhero11/p/11713252.html