5

我想将 ZooKeeper 用作服务注册表,它复制相同的服务可以自己注册,客户端可能会发现可用服务的 url 来调用它们。作为 ZooKeeper 的初学者,我需要基本的 Java 代码来注册和发现 ZooKeeper 上的服务。

4

1 回答 1

12

Check out Curator Discovery (part of Apache Curator), a Zookeeper-based service registry written in Java.

In SOA/distributed systems, services need to find each other. i.e. a web service might need to find a caching service, etc. DNS can be used for this but it is nowhere near flexible enough for services that are constantly changing. A Service Discovery system provides a mechanism for:

  • Services to register their availability
  • Locating a single instance of a particular service
  • Notifying when the instances of a service change
于 2013-01-29T20:05:53.950 回答