当前位置:网站首页>A little understanding of GSLB (global server load balance) technology
A little understanding of GSLB (global server load balance) technology
2022-07-04 05:45:00 【Day by day】
gslb(global server load balance) A little understanding of Technology
Preface
For larger Internet companies , Users may be all over the world , here , To enhance the user experience , Companies usually set up computer rooms close to users , To serve the requests of these users .
For example, wechat mainly serves domestic , In China, there will be a large number of computer rooms in many cities to serve domestic users , in addition , Because in North America 、 There are users in Europe , therefore , There will also be corresponding computer rooms in Europe and North America .
here , As a service provider , Naturally, I hope users can visit nearby , Guangdong users visit Shenzhen computer room , North American users visit the North American computer room .
How to do this , For example, everyone visits at the same time www.qq.com, How to ensure the nearest visit ?
This is it. gslb(global server load balance) The stage of .
gslb Implementation scheme of dns
dns programme , It should also be the most mainstream solution , We can think about it first , visit www.qq.com when , What will you do ? First of all, get the name behind the domain name ip, There will be dns recursive query .
User dns request , First enter the local dns The server , For example, my side is Shenzhen Telecom broadband , Theoretically, it entered Shenzhen Telecom dns The server , This is what we call localDns localDns I'll check root dns The server ,root dns The server only maintains the top-level domain name dns Server address , So it will return .com This top-level domain name corresponds to dns The server ( Write it down as tld, namely top level domain Top-level domain server ) localDns Next , towards .com The top-level domain name server initiates a request , It will return resolvable qq.com Domain name dns The server ( It is called authoritative server ) localDns Next , towards qq.com Domain name dns Server initiates request , It will parse www This host corresponds to ip, And back to localDns Get www.qq.com Of ip after , Return to the user .
You can read pictures directly without reading words .
however , One thing you should remember , From beginning to end , All are localDns Helping us run around , So our agent , In the process ,root、tld dns The server 、 Authoritative server , Are only with localDns Dealing with , Completely unaware of the existence of our users , therefore , One thing is very important ,root、tld dns The server 、 Authoritative servers only know localDns Of ip, Without knowing our users ip.
Now we know , Ultimately, I am responsible for qq.com Server's dns server To help us analyze the behind ip, The problem is coming. , This dns server Can you help us to access nearby , The answer is , not always , This is usually for www.qq.com Configure multiple A Record , That is, multiple machine rooms ip, Such as Shenzhen computer room ip、 North American computer room ip, This dns The server is not very intelligent , It returns pollingly ip, That's probably , North American users got the domestic computer room ip, Then how to play , It's jammed .
The problem is , This dns The server is not very intelligent , Can't meet our personalized needs , What shall I do? , There are solutions , You can see the picture below .
Here you can give www.qq.com To configure ns Record , Let it point to another dns service , And this dns service , We can achieve one by ourselves , Nothing more than writing a background service , Open a port , receive dns request , Correct implementation dns Agreement is enough ,gslb It's such a customized dns service .
“NS representative “ Domain name server ”, The domain name server record indicates which DNS The server does not respond to this request Domain Authoritative ( namely , Which server contains the actual DNS Record ). Basically ,NS The record tells the Internet where to find the domain IP Address . A domain usually has multiple NS Record , These records can indicate Primary and secondary domain name servers . If not configured correctly NS Record , Users will not be able to load websites or applications .
Here's a NS Record examples :
”
example.com record type: value: TTL @ NS ns1.exampleserver.com 21600
It is introduced. gslb after ,dns analysis , It becomes such a process .
localDns The previous steps are similar , The difference is , To qq.com Domain name dns After the server initiates the request ,qq.com Domain name resolution www.qq.com, Find out www.qq.com Configured with ns Record , here , It will return ns In record value to localDns, And this value, It points to Tencent itself gslb service localDns To Tencent gslb Service initiated request , Be careful , As we have said , At this point udp dns Inquire about , client ip yes localDns Of ip,gslb The server will only get localDns Of ip, such as , Take me for example ,gslb Can't get mine ip, Only Shenzhen Telecom ip. gslb Upon receipt of the request , Theoretically available data include : Which country does the request come from , The requested ip The operator , The requested ip Province and city , Such as China - Shenzhen - telecom , here ,gslb You can choose to return to Shenzhen machine room ip to localDns, Instead of the North American computer room ip, In this way, the nearest access is achieved
gslb Realization
I took a look at Tencent , Should be 06 I made this thing in , I don't know the specific implementation , Just refer to the open source framework , But I guess , It may be based on bind This open source dns Parser to change , After all, now the mainstream dns service , Mainly bind、dnsmasq, I want to practice this these two days gslb, I also built a bind( But I finally found that I couldn't parse my own bind Service , Read the description of the domain name resolver , It seems that you can't ns The record points to my privately built dns service )
Generally, big factories must have their own gslb Realized , I also saw relevant in Ctrip's technical article gslb Technical description .
Suppose we were in a small factory , No self-study ability , So what ?
Actually ,dns Analyzers still have advanced capabilities , Is my low 了 , This is very simple , As long as the cash capacity , You can solve it .
With what I use now dnspod For this parser , By default, it supports several routes , Like telecommunications 、 Move , Different directions can be configured ip.
I understand , What about the big factory , It should have this research and development ability , Unwilling to spend this unjust money , After all , When the company was small , Rent cheap , After growing up , More than one domain name , Compared with self-study , It may not be cheap ; And if you study by yourself , It can also be combined with business depth , Make some flowers to live .
summary
You can also share your views ,gslb To achieve this part , It's all my nonsense , however dns Analytic quotient , What is provided is gslb An implementation of
边栏推荐
- [microservice] Nacos cluster building and loading file configuration
- Tutle clock improved version
- Easy change
- SQL injection - injection based on MSSQL (SQL Server)
- 光模塊字母含義及參數簡稱大全
- Flink1.13 basic SQL syntax (II) join operation
- Excel comparator
- JS string splicing enhancement
- 2022 a special equipment related management (elevator) examination questions simulation examination platform operation
- How to use postman to realize simple interface Association [add, delete, modify and query]
猜你喜欢

Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology

How to get the parent node of all nodes in El tree

JS arguments parameter usage and explanation

复合非线性反馈控制(二)

JS flattened array of number shape structure

One click filtering to select Baidu online disk files
![BUU-Crypto-[GUET-CTF2019]BabyRSA](/img/87/157066155e8d3a93e30a68eaf1781b.jpg)
BUU-Crypto-[GUET-CTF2019]BabyRSA

谷歌 Chrome 浏览器将支持选取文字翻译功能

Gridview出现滚动条,组件冲突,如何解决

Introduction To AMBA 简单理解
随机推荐
C # character similarity comparison general class
Tutle clock improved version
Etcd database source code analysis - initialization overview
fastjson
Leetcode 184 Employees with the highest wages in the Department (July 3, 2022)
Flask
如何判断数组中是否含有某个元素
简易零钱通
Talk about the SQL server version of DTM sub transaction barrier function
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
注释与注解
724. 寻找数组的中心下标
BUU-Crypto-[HDCTF2019]basic rsa
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
input显示当前选择的图片
js如何将秒转换成时分秒显示
C语言简易学生管理系统(含源码)
Void convolution, deformable convolution, deformable ROI pooling
Notepad++ -- display related configurations
复合非线性反馈控制(二)



