EUREKA (1) Terminology Detained (Using specific things to understand abstract concept)

Recently, I have been relatively idle, so I studied the principle, implementation, and cluster construction of eureka by myself. (Note: I haven’t actually operated the eureka cluster project. They are all the conclusions of my own demos. If there are errors, please point them out)

First, let me talk about my simple and easy-to-understand understanding of some eureka terms (because I am personally accustomed to problems, and like to understand abstract things with roles in life, so I will use a lot of metaphors):

Eureka role

Server: the service registry . ——I use Taobao in my life to understand it

Client: The client registers itself with the service registry. Service, and periodically send heartbeats to update its service lease. ——I understand this as a shop in Taobao. The client mentioned here is just a role for eureka, don’t just understand it as the client side. In fact, thinking about it from another angle, compared to the users of the service, the client still plays the role of the service.

Term understanding

Service Registration Center: I think this concept should be discussed separately. What is a service registry? It is an intermediate platform. Or take the analogy of Taobao, do you say that Taobao produces its own products (don’t tell me that it is self-produced)? Does Taobao buy merchandise from merchants? No, but only provide a platform for buyers and sellers to conclude transactions through it. The service registration center is such a role, and then the functions it needs to provide are similar to Taobao1 to ensure the reliability of the merchants. 2. There are newly injected merchants for everyone to see. 3. You have to delete it in time if the business quits and closes. 4. Buyers and sellers must be able to contact. So this also corresponds to the functional terminology of eureka.

Service registration: Service registration in eureka means that the client is registered to the server (that is, Service registry) URL. We can understand it as a store registered in Taobao.

Service discovery: When the service is called, it sends a request to the server, and the server finds out the corresponding Service. When you go to Taobao to buy something, do you first search for what you want to buy? Then Taobao will find the corresponding seller for you, right? The service discovery here is the truth.

Load balancing: This concept can be understood from the name. The pressure is average! It is still the analogy of Taobao, so many buyers across the country, if there is only one seller for one thing. So what if the seller is too busy? You bought something and shipped it out a year later, can you stand it? Therefore, for shops with many buyers, there are more sellers. The only difference is that the shop on Taobao is chosen by the buyer. The different instances of the registry are assigned by the algorithm that comes with the registry to which one you visit.

Service renewal: The service provider sends a heartbeat to the registration center via http to let the service registration center Knowing that he is still alive. This is better understood. If (I’m not a seller, I don’t know, here is an analogy) Taobao merchants have to pay Taobao the next month’s platform fee every month. If you didn’t pay this month, it may be that you don’t want to continue doing it next month. At this time Taobao has a psychological preparation. There is an important point here, not that Taobao will take you offline if you don’t pay today. But there is a time. At least this month will be over, right? So it’s the same for the renewal. It’s not that the heartbeat didn’t send you this time.

Failure elimination: Eureka Server did not receive the client’s Heartbeat, it is considered that the service is down, and the instance is logged off. This is understood by my method above. Taobao merchants have not paid for three months. Then Taobao platform sees you really quit. If any buyer on the list places an order and doesn’t ship it, isn’t the user experience bad? . Yes, I deleted it from the list for you. This is failure rejection.

Self-protection:The architectural philosophy of the self-protection model isI would rather let one go, and never kill a thousand by mistake. If the heartbeat failure rate is less than 85% within 15 minutes, you start to doubt yourself and don’t eliminate the client. This is actually understandable. If Taobao is the 15th of each month, the merchant remits the next month’s payment to the platform. If one or two sellers did not remit, the Taobao platform Xun Si must be that those two do not want to do it. but! ! If all or 90% of the merchants don’t send money~ Taobao platform will have to think about what’s going on? Is my bank account blocked? Or is the account I told them wrong this month? some type of. . . Then began to investigate their own reasons. During this period, the business will not be deleted.

The registry itself can be used as a client to register: This is not a term, but because we look at it today Someone in the group raised this point and felt confused, so I think I can also list it. First of all, he has this function, but it can be turned on and off. And this is an important foundation for the implementation of Eureka cluster. Continue to use my easy-to-understand but not necessarily very appropriate metaphor: Look at the current Taobao, multi-party cooperation~~You want to go shopping and pick up the salted fish for cheap. If you want to see a good product, click in and take a look. Hey, I’ll go~~ This is not Taobao? In the same way, you go shopping on Taobao~~If you click on any link, you will find that it is the news in the salted fish~~What is the principle? Isn’t it just that Taobao’s salted fish is broken and unclear about each other’s registration? In the same way, two eurekas are registered with each other. From the user’s point of view, double the product and double the happiness~~ although it is also double the cost~~ from the merchant’s point of view~~ anyway, eureka is just a center and not a profit organization! What to talk about, customer satisfaction is fine~~~Of course, I still have a simple understanding~~This is just a demo to talk about the server side as the client’s permission is turned on~ So I found eureka- in the registered service. The server is a service~~So I think~~Is it actually possible to call it if you write some interfaces in eureka? It’s like Jingdong is a platform, but there is also Jingdong self-operated as a seller? Because I haven’t actually tried this yet, I’m guessing here~~ I’ll have a chance to try again in the future~~

Then if there is Those who are more familiar or say that I am biased in the above views~~Welcome to point out~~! ! !

Here, it’s not easy to type by hand. Everyone likes to share, forward and follow comments. ~~~~

Leave a Comment

Your email address will not be published.