The difference between zk and eureka

Why not use zookeeper as the registration center? When using dubbo, it is generally used in combination with zk (as the registration center). So why is Eureka used in SpringCloud instead of zk?

Let's compare, in CAP theory, zk pays more attention to C and P, namely consistency and partition fault tolerance. But Eureka cares more about A and P, and A is high availability. There is a difference between master and follower in zk. When entering the election mode, it cannot provide services to the outside world normally. However, in Eureka, the clusters are equal and the status is the same. Although consistency cannot be guaranteed, at least registration services can be provided. According to different business scenarios, there are trade-offs.

Eureka has only one registry for 8761, so how to avoid single point problems?

We can solve it by clustering. For example, there are now three machines: Server1, Server2 and Server3. In the high availability scheme, the three machines need to be registered in pairs. For example, S1 needs to register with S2 and S3 respectively. At present, he cannot realize the transitivity of registration. This way, if Server1 goes down, we can continue to get services from Server2 and 3.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325251454&siteId=291194637