当前位置:网站首页>Army chat -- registration of Registration Center

Army chat -- registration of Registration Center

2022-06-26 17:03:00 army

Registry Center , In order to solve the problem of , Problems found by the service , in other words , service A Want to call service B, Need to know service B What's the address of , And the registry , This function is provided .

So service A And the service B, You need to send your own information to the Registration Center for registration .

image.png

Registry Center , If there is only one service , There will be a single point of failure , Cause the whole system to break down , Therefore, cluster deployment is used in production .

So there's a problem , How does the service register in the registry ? Register with any registry or all registries ?

Nacos&Eureka

Nacos&Eureka All are peer 2 peer The pattern of , So the general process of registration is the same .

service A Randomly find one Server, And then register , If registration fails , Just change to the next one Server To register .( service B Empathy )

image.png

stay peer 2 peer In mode , Every Server They are all equal , But when you register, you only go to one Server register , So each Server Data synchronization is required between .

image.png

Data synchronization includes 2 Kind of , One is incremental synchronization , One is full synchronization .

Incremental synchronization is usually performed during service registration or service information change , Synchronize services to other Server. Because synchronization is a time-consuming network request , It is usually put into the queue or cache , Synchronize with other threads .

Full synchronization usually occurs when the service initializes data or the current service finds itself in error , Get full data from other services .

image.png

peer 2 peer There's another problem , It's data consistency , That is to say AP Model or CP Model .

AP Higher performance , Data is weakly consistent .CP Poor performance , Data is strongly consistent .

Nacos Through temporary nodes and permanent nodes , Realization AP Models and CP Model .

Eureka yes CP Model .

Rocketmq

Rocketmq Of NameServer It's also a registry ,Broker When it starts , A scheduled task will be opened , To all of the cluster NameServer To register .

Due to network fluctuations or other problems , Data is also weakly consistent , At some point the data may not be the same .

image.png

Spark

Spark yes Master Slave Mode ( be based on ZooKeeper Persistence engine to illustrate ). That is, he has 2 individual Master, But one is ALIVE, One is STANDBY. Which is ALIVE node , By acquiring Zookeeper The temporary node of the .

When Worker Go to Master When registering ,Master In addition to Worker The information is stored in memory , Will the Worker Information on Zookeeper Is persistent in , This also ensures the consistency of the system .

When ALIVE After node downtime ,STANDBY It will start from Zookeeper In order to get Worker Data continues to provide services .

image.png

Hadoop

Hadoop High availability , It's also Master Slave Mode , And there is the federal model .

therefore DataNode When registering , You need to see how many federations there are , And to every federal Master Node registration .

image.png

that NameServer Where is your registration information stored ? When failover , How to restore the registration information ?

原网站

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