zoukankan      html  css  js  c++  java
  • 2、Zookeeper集群搭建、命令行Client操作

    zookeeper 集群最好是奇数台:
    
    5台允许挂掉2台
    
    4台只能允许挂掉1台
    
    
    zjtest7-redis:/opt/zookeeper/bin# ./zkServer.sh status
    ZooKeeper JMX enabled by default
    Using config: /opt/zookeeper/bin/../conf/zoo.cfg
    Mode: follower
    
    
    zjtest7-redis2:/opt/zookeeper/bin# ./zkServer.sh status
    ZooKeeper JMX enabled by default
    Using config: /opt/zookeeper/bin/../conf/zoo.cfg
    Mode: leader
    
    
    
    zjtest7-haproxy:/opt/zookeeper/bin# ./zkServer.sh status
    ZooKeeper JMX enabled by default
    Using config: /opt/zookeeper/bin/../conf/zoo.cfg
    Mode: follower
    
    
    zookeeper集群 没有固定的leader
    
    
    create /test "testvalue"    前面目录,后面数据内容
    
    
    [zk: 192.168.32.81:2181(CONNECTED) 3] get /test
    testvalue
    cZxid = 0x100000017
    ctime = Mon Jul 18 14:14:24 CST 2016
    mZxid = 0x100000017
    mtime = Mon Jul 18 14:14:24 CST 2016
    pZxid = 0x100000017
    cversion = 0
    dataVersion = 0
    aclVersion = 0
    ephemeralOwner = 0x0
    dataLength = 9
    numChildren = 0
    
    
    
    [zk: 192.168.32.81:2181(CONNECTED) 5] get /test
    testvalue
    cZxid = 0x100000017
    ctime = Mon Jul 18 14:14:24 CST 2016
    mZxid = 0x100000017
    mtime = Mon Jul 18 14:14:24 CST 2016
    pZxid = 0x100000018
    cversion = 1
    dataVersion = 0
    aclVersion = 0
    ephemeralOwner = 0x0
    dataLength = 9
    numChildren = 1
    
    
    [zk: 192.168.32.81:2181(CONNECTED) 6] get  /test/child 
    childvalue
    cZxid = 0x100000018
    ctime = Mon Jul 18 14:17:17 CST 2016
    mZxid = 0x100000018
    mtime = Mon Jul 18 14:17:17 CST 2016
    pZxid = 0x100000018
    cversion = 0
    dataVersion = 0
    aclVersion = 0
    ephemeralOwner = 0x0
    dataLength = 10

  • 相关阅读:
    webpy使用笔记(一)
    如何衡量离散程度
    Hash哈希(二)一致性Hash(C++实现)
    Hash哈希(一)
    sqlmap使用笔记
    Windows7 IIS7.5 HTTP Error 503 The service is unavailable 另类解决方案
    [转]IP动态切换脚本
    全国各地电信DNS服务器地址
    比较好的汉字拼音化类
    c#读取INI文件类
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350515.html
Copyright © 2011-2022 走看看