Name: egg-zookeeper
Owner: egg
Description: egg plugin for zookeeper
Created: 2017-02-13 14:33:04.0
Updated: 2018-04-30 04:32:38.0
Pushed: 2018-04-27 04:16:06.0
Homepage: null
Size: 4377
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
egg plugin for zookeeper
i egg-zookeeper --save
onfig/plugin.js
rts.zookeeper = {
able: true,
ckage: 'egg-zookeeper',
app.zk.createClient(connectionString)
apit client = app.zk.createClient('localhost:2181');
d client.ready();
t path = '/test-path';
tion listChildren(client, path) {
ient.getChildren(
path,
event => {
console.log('Got watcher event: %s', event);
listChildren(client, path);
},
(err, children, stat) => {
if (err) {
console.log('Failed to list children of %s due to: %s.', path, err);
return;
}
console.log('Children of %s are: %j.', path, children);
}
reate a new path
nt.create(path, err => {
(err) {
console.log('Failed to create node: %s due to: %s.', path, err);
else {
console.log('Node: %s is successfully created.', path);
list and watch the children of given node
stChildren();
Please refer to zookeeper-cluster-client in detail.