UNPKG

dubbotest

Version:

Please run follow command in Windows GitBash or Linux. Can't use windows Cmd or PowerShell. ```shell npm install -g dubbotest dubbotest ```

33 lines (28 loc) 885 B
var zookeeper = require('node-zookeeper-client'); var client = zookeeper.createClient('192.168.27.4:2181'); var path = 'CbsQuickenCardService' function listChildren(client, path) { client.getChildren( path, function (event) { console.log('Got watcher event: %s', event); listChildren(client, path); }, function (error, children, stat) { if (error) { console.log( 'Failed to list children of %s due to: %s.', path, error ); return; } console.log('Children of %s are: %j.', path, children); } ); } client.once('connected', function () { console.log('Connected to ZooKeeper.'); listChildren(client, path); }); client.connect();