当前位置:网站首页>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
边栏推荐
- 卸载Google Drive 硬盘-必须退出程序才能卸载
- 十二. golang其他
- Unity2d -- character moves and turns
- Design and implementation of redis 7.0 multi part AOF
- Analysis of classical pointer and array written test questions in C language
- Redis realizes ranking function
- The difference between PX EM rem
- The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
- Ping port artifact psping
- How to expand all collapse panels
猜你喜欢

Analysis of classical pointer and array written test questions in C language

Upper computer software development - log information is stored in the database based on log4net
![BUU-Crypto-[GUET-CTF2019]BabyRSA](/img/87/157066155e8d3a93e30a68eaf1781b.jpg)
BUU-Crypto-[GUET-CTF2019]BabyRSA

Design and implementation of redis 7.0 multi part AOF

Kubernets first meeting

Topological sorting and graphical display of critical path

JS arguments parameter usage and explanation

Impact relay jc-7/11/dc110v

云原生架构实战案例及优化解决方案

每周小结(*63):关于正能量
随机推荐
Ping port artifact psping
云原生架构实战案例及优化解决方案
JS how to convert seconds into hours, minutes and seconds display
光模块字母含义及参数简称大全
Configure cross compilation tool chain and environment variables
How to implement lazy loading in El select (with search function)
【QT】制作MyComboBox点击事件
如何判断数组中是否含有某个元素
JS扁平化数形结构的数组
Halcon image calibration enables subsequent image processing to become the same as the template image
Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
left_ and_ right_ Net interpretable design
How to solve the component conflicts caused by scrollbars in GridView
Penetration tool - sqlmap
XII Golang others
BUU-Crypto-[HDCTF2019]basic rsa
Recommended system 1 --- framework
Build an Internet of things infrared temperature measuring punch in machine with esp32 / rush to work after the Spring Festival? Baa, no matter how hard you work, you must take your temperature first
BUU-Crypto-[GUET-CTF2019]BabyRSA
谷歌 Chrome 浏览器将支持选取文字翻译功能



