zoukankan      html  css  js  c++  java
  • Kafka自我学习3-Scalable

    1.After created the zookeeper cluster, we found all broker cluster topic can be find in zoo1, zoo2, zoo3.

    [root@zoo1 zookeeper]# /root/kafka/bin/kafka-topics.sh  --describe --zookeeper zoo1:2181
    Topic:my-replicated-topic    PartitionCount:1    ReplicationFactor:3    Configs:
        Topic: my-replicated-topic    Partition: 0    Leader: 1    Replicas: 2,0,1    Isr: 1
    Topic:test    PartitionCount:1    ReplicationFactor:1    Configs:
        Topic: test    Partition: 0    Leader: 1    Replicas: 1    Isr: 1
    Topic:test123    PartitionCount:1    ReplicationFactor:1    Configs:
        Topic: test123    Partition: 0    Leader: 1    Replicas: 1    Isr: 1
    [root@zoo1 zookeeper]# /root/kafka/bin/kafka-topics.sh  --describe --zookeeper zoo2:2181
    Topic:my-replicated-topic    PartitionCount:1    ReplicationFactor:3    Configs:
        Topic: my-replicated-topic    Partition: 0    Leader: 1    Replicas: 2,0,1    Isr: 1
    Topic:test    PartitionCount:1    ReplicationFactor:1    Configs:
        Topic: test    Partition: 0    Leader: 1    Replicas: 1    Isr: 1
    Topic:test123    PartitionCount:1    ReplicationFactor:1    Configs:
        Topic: test123    Partition: 0    Leader: 1    Replicas: 1    Isr: 1
    [root@zoo1 zookeeper]# /root/kafka/bin/kafka-topics.sh  --describe --zookeeper zoo3:2181
    Topic:my-replicated-topic    PartitionCount:1    ReplicationFactor:3    Configs:
        Topic: my-replicated-topic    Partition: 0    Leader: 1    Replicas: 2,0,1    Isr: 1
    Topic:test    PartitionCount:1    ReplicationFactor:1    Configs:
        Topic: test    Partition: 0    Leader: 1    Replicas: 1    Isr: 1
    Topic:test123    PartitionCount:1    ReplicationFactor:1    Configs:
        Topic: test123    Partition: 0    Leader: 1    Replicas: 1    Isr: 1

    2.Even we shutdown the zoo or any leader of zookeeper cluster, we can see the topic still can be access on other zoo server

    3.Zookeeper-shell

    [root@zoo1 zookeeper]# /root/kafka/bin/zookeeper-shell.sh zoo1:2181
    Connecting to zoo1:2181
    Welcome to ZooKeeper!
    JLine support is disabled
    
    WATCHER::
    
    WatchedEvent state:SyncConnected type:None path:null
    help
    ZooKeeper -server host:port cmd args
        stat path [watch]
        set path data [version]
        ls path [watch]
        delquota [-n|-b] path
        ls2 path [watch]
        setAcl path acl
        setquota -n|-b val path
        history 
        redo cmdno
        printwatches on|off
        delete path [version]
        sync path
        listquota path
        rmr path
        get path [watch]
        create [-s] [-e] path data acl
        addauth scheme auth
        quit 
        getAcl path
        close 
        connect host:port

     4.

  • 相关阅读:
    tomcat部署项目时 报错Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 and 6 Web modules
    异常:Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
    java安全管理器SecurityManager介绍
    Mybatis框架基础支持层——反射工具箱之Reflector&ReflectorFactory(3)
    Mybatis框架基础支持层——解析器模块(2)
    Mybatis框架可视化(1)
    JDK动态代理简单使用(2)
    代理(1)
    动态代理源码分析(3)
    springboot(十七)-使用Docker部署springboot项目
  • 原文地址:https://www.cnblogs.com/oskb/p/9069043.html
Copyright © 2011-2022 走看看