y42 / clj-druid

Eclipse Public License 1.0
31 stars 10 forks source link

Migration example #15

Closed slipset closed 7 years ago

slipset commented 7 years ago

I'm currently using cli-druid version 0.2.12, which lets me connect by calling

(let [zk-client (zk/connect "zk1,zk2,zk3")]
   (druid\zk-watch-node-list zk-client "/druid/discovery/druid:broker"))

Which suits me quite well, since I'm using the zookeeper client for other stuff as well.

How would this be done in 0.2.16?

msprunck commented 7 years ago

In 0.2.16 clj-druid uses Curator to discover Druid nodes. Druid itself uses the Curator client to announces its nodes.

To connect, you have just to use the following code:

(druid/connect {:zk {:host "zk1,zk2,zk3"
                     :discovery-path "/druid/discovery"
                     :node-type "broker"}})