Method for realizing OpenResty dynamic load balancing based on Consul

A dynamic load and balancing technology, applied in the direction of resource allocation, program control design, instruments, etc., can solve the problem that the server cannot be dynamically changed, and achieve the effect of reducing time consumption and improving efficiency

Inactive Publication Date: 2020-02-28
上海新炬网络技术有限公司
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

After the server is started, the server in the upstream cannot be changed dynamically.
When the upstream server is unavailable, upstream will automatically remove the server, but when a new server is added, upstream cannot increase

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for realizing OpenResty dynamic load balancing based on Consul
  • Method for realizing OpenResty dynamic load balancing based on Consul

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0015] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0016] Consul is a service grid (TCP / IP between microservices, responsible for network calls, current limiting, fusing and monitoring between services) solution. It is a distributed, highly available system, and it is very easy to develop and use. easy. It provides a full-featured control plane, the main features are: service discovery, health check, key-value storage, secure service communication, multi-data center.

[0017] See figure 1 and figure 2 , the method for implementing OpenResty dynamic load balancing based on Consul provided by the present invention comprises the following steps:

[0018] S1) When a server is started, the registration information of the server is accepted through the Consul center, and the server ip is obtained through the Consul interface call;

[0019] S2) When a server is closed, accept the closing information of th...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for realizing OpenResty dynamic load balancing based on Consul, which comprises the following steps: S1) when a server is started, receiving registration information through Consul and acquiring ip; s2) when a server is closed, receiving closing information through Consul and removing the closing information from the server ip list; s3) transmitting the ip list acquired by the Consul to an Upstream template configured by the Openrest; S3) transmitting the ip list acquired by the Consul to an Upstream template configured by the Openrest; and S4) dynamically obtaining an Upstream list configured by the 4. Nginx from the template of the openness. According to the method and the system, the characteristics of the server can be dynamically discovered by utilizing consul, the method and the system can be pertinently applied to a demand scene of Opensity / Nginx dynamic capacity expansion and reduction, the load balancing efficiency is improved, and the time consumption of corresponding operation and maintenance operation is greatly reduced.

Description

technical field [0001] The invention relates to a method for realizing dynamic load balancing, in particular to a method for realizing OpenResty dynamic load balancing based on Consul. Background technique [0002] Nginx is an HTTP Server, reverse proxy server, mail proxy server, and general-purpose TCP / UDP proxy server. The configuration file of Nginx consists of a simple directive and a block directive. A single directive has only one line and ends with ";", and a block directive is followed by multiple lines of content wrapped with "{}". The curly braces after some block instructions can continue to contain single instructions, such block instructions are called configuration contexts (context), such instructions include: events, http, server, location, etc. [0003] Nginx is a reverse proxy software with modular design, developed in C language; OpenResty is a web development platform with Nginx as the core, which can parse and execute Lua scripts (the relationship betwe...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L29/08G06F9/50
CPCH04L67/1008H04L67/02G06F9/505G06F9/5083H04L67/56
Inventor 程永新孙玉颖刘洋
Owner 上海新炬网络技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products