转载请注明出处:jiq•钦's technical BlogZooKeeperNet是ZooKeeper的.NET客户端,下载地址:https://github.com/ewhauser/zookeeper
测试程序
ZooKeeper zkClient =
new ZooKeeper(URL,new
TimeSpan(0, 0, 0, 10000), watcher);
if(zkClient.Exists("/config/configJ",null) ==null)
{
zkClient.Create("/config/configJ", json.GetBytes(),Ids.OPEN_ACL_UNSAFE,
CreateMode.Persistent);
}
初始化和启动
首先看ZooKeeper构造函数:
public ZooKeeper(string connectstring,TimeSpan sessionTimeout,
IWatcherwatcher, long ......
阅读全文