当前位置:网站首页>Get to know linkerd project for the first time

Get to know linkerd project for the first time

2022-07-05 12:55:00 51CTO

Linkerd It's a cloud native software company Buoyant Open source projects launched , It is the first perfect Service Mesh project .Linkerd As the basic network layer of next-generation Cloud Applications , Through automatic load balancing 、 Many features such as service discovery and runtime recovery , It enables enterprises to smoothly transfer their computing architecture from single service to micro service architecture without sacrificing reliability .

One 、 The main features

Linkerd The following main features are provided .

1) High performance 、 Highly scalable cluster communication capability . Handle tens of thousands of requests per second with minimum delay and load ,Linkerd 2.0 The current size of the data plane of is only 10MB about , also 99.9% The request takes less time than 1ms; Easy to deploy , The business code and configuration do not need any modification , Especially convenient for horizontal expansion .

2) Support multiple service discovery methods , And it is very convenient to expand . Support various service discovery mechanisms , Such as file based (File-based)、ZooKeeper、Consul And Kubernetes; It is convenient to add a customized service discovery mechanism , Extensibility is strong .

3) Powerful load balancing algorithm support . It is recommended to use load balancing algorithm based on perceived delay , Through real-time statistics RPC Delay 、 To process the request queue size determines how requests are distributed , Strong real-time feedback , It can adjust the load according to the current real-time pressure ; Built in multiple load balancing algorithms , It can be selected flexibly according to the actual scene .

4) Perfect multi protocol support . Support HTTP 2.0、HTTP 1.1、gRPC、Thrift A variety of protocols .

5) Dynamic routing . in the light of HTTP agreement , Support multiple routing strategies ; Support dynamic routing mechanism , Blue green deployment can be achieved by dynamically modifying routing rules 、 Canary deployment 、 Traffic migration, etc ;

6) Built in perfect log/Metric/Trace.Linkerd By collecting various statistical data of communication between services , Build a powerful dashboard , Specifically, it includes the current running state of each service , The success rate of the request , Real time topology of the system .

7) Multi platform support .Linkerd By collecting various statistical data of communication between services , Build a powerful dashboard , Specifically, it includes the current running state of each service , The success rate of the request , Real time topology of the system .

Two 、 Routing mechanism

The routing mechanism is Linkerd At the heart of ,Linkerd The main job of is to receive a request message , Then forward the request message to the appropriate destination node , This process is mainly identified by services (Identification)、 binding (Binding)、 analysis (Resolution) And load balancing 4 There are three main steps , Which identifies 、 binding 、 Parsing belongs to the category of routing management .

 First time to know Linkerd project _Linkerd

Linkerd The schematic diagram identification of routing working mechanism refers to the process of determining the request to call the service according to the request , The output of the identification phase is service name, The recognition process is based on the recognition type , Generate a specific string from the request message , This string is then associated with this request ,Linkerd The route will have a default prefix /svc,Linkerd The default prefix plus this string will be passed back as the routing ID of this request , about HTTP The request for ,Linkerd By default, a io.l5d.header.token Type of logo , It USES HTTP In the request header Host Field as identification , such as curl-H"Host:data"http://example/hello, The route ID is converted to /svr/data. meanwhile , Recognition is an extensible plug-in , Users can use custom recognition logic , Convert the request to the corresponding identification according to your own wishes .

Through the identification stage service name after , from dtab Components according to service name binding , Determine the cluster name of the target service . The binding phase outputs client name,client name Is the name of the target cluster , Be similar to DNS Domain name of , and service name Only the target service information is different ,client name It also includes clusters 、 Regional and environmental information .

dtab Manage binding rules , such as dtab The rules are configured as follows :/svc=>/#/io.l5d.fs, our /svc/test Converted to :/#/io.l5d.fs/test,client name General with “/$” perhaps “/#” start . The binding is Linkerd A stage in which there are many changes ,Linkerd Many scenario requirements in , For example, blue-green test 、 Small traffic grayscale, etc. are achieved by binding . Parsing is the process of service discovery , adopt named The component will target the cluster name client name Convert to a set of available nodes ,Linkerd The currently used service discovery method will be configured through the configuration file , After determining the service discovery method , It can be based on client name, Get node information from service discovery .

3、 ... and 、 Core architecture

At the architecture level ,Linkerd It is also divided into control plane and data plane , The control plane is composed of the following parts .

1)Controller controller : The controller consists of multiple containers responsible for different control functions , It mainly includes public-api、proxy-api、destination and tap, among public-api be responsible for Linkerd External API Interaction ;

2)Web:Web yes Linkerd The dashboard provided ;

3)Prometheus:Prometheus be responsible for Linkerd Metric Information collection and storage ;

4)Grafana:Grafana be responsible for Linkered Visualization .

Linkered The data plane of is Rust Language implementation of lightweight high performance Proxy agent , By configuring Iptables, It can be managed transparently Kubernetes Pod Inlet and outlet flows , It can even be added transparently and imperceptibly to a running service Linkered agent .Linkered Support HTTP、HTTP/2 and TCP agreement , Through on-demand diagnosis tap API,Linkered It has powerful visual monitoring and diagnosis capabilities .

from Linkered The overall structure of ,Linkered Has completely abandoned the creation Service Mesh Platform idea , Built in specific statistics and visualization components , Focus on providing users with out of the box Service Mesh Ability , At present Linkered It's really very light , For general scenarios without special requirements ,Linkered It's still a good choice .

原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051233060912.html