Skip to content

Exhibitor Integration

Randgalt edited this page Apr 6, 2012 · 5 revisions

Curator can be integrated with Netflix Exhibitior to achieve a live/updating list of the ZooKeeper ensemble. This means that your ZooKeeper client (i.e. Curator) will automatically/dynamically adjust to changes in the makeup of a ZooKeeper ensemble. Further, this support is generalized so that a service other than Exhibitor could be used if available.

Enabling

The integration is enabled via the CuratorFrameworkFactory (or when constructing the CuratorZookeeperClient if not using the framework). Pass an EnsembleProvider to the ensembleProvider() method of the CuratorFrameworkFactory builder.

EnsembleProvider

For Exhibitor, construct an instance of ExhibitorEnsembleProvider to pass to the builder. It takes a number of arguments:

  • exhibitors – a list of the exhibitor instances. This is the initial set of Exhibitor instances. This set will get automatically updated if it changes.
  • restClient – a simple facade to access the Exhibitor instances via REST. Use the provided DefaultExhibitorRestClient or something else of your choosing.
  • restUriPath – the REST path to use. In most cases this should be: /exhibitor/v1/cluster/list
  • pollingMs – how often to poll the Exhibitor instances
  • retryPolicy – the retry policy to use when polling the Exhibitor instances.

Details

Once configured, Curator will poll the Exhibitors for changes in the ensemble. If Curator should need to re-create the ZooKeeper instance (due to a SysDisconnected event, etc.) it will use the updated ensemble list to do so.

Clone this wiki locally