var
manatee = require(
'node-manatee'
);
var
client = manatee.createClient({
"path"
:
"/manatee/1"
,
"zk"
: {
"connectTimeout"
: 2000,
"servers"
: [{
"host"
:
"172.27.10.97"
,
"port"
: 2181
}, {
"host"
:
"172.27.10.90"
,
"port"
: 2181
}, {
"host"
:
"172.27.10.101"
,
"port"
: 2181
}],
"timeout"
: 20000
}
});
client.once(
'ready'
,
function
() {
console.log(
'manatee client ready'
);
});
client.on(
'topology'
,
function
(urls) {
console.log({urls: urls},
'topology changed'
);
});
client.on(
'error'
,
function
(err) {
console.error({err: err},
'got client error'
);
});