• 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

  • 相关阅读:
    SDOI2017 树点染色
    ZROI week1
    ZROI week3
    BZOJ 4545
    ZROI week2
    组合数问题
    JSOI2016 独特的树叶
    TJOI2015 组合数学
    Beginning Storyboards in iOS 5 Part 2
    孕妇不能吃的东东
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199569.html
Copyright © 2020-2023  润新知