1 2 3 4 5 6 7 8 9 10 11 12 13
| [hadoop@hadoop01 bin]$ kafka-topics.sh --create --zookeeper hadoop01,hadoop02,hadoop03 --replication-factor 1 --partitions 3 --topic hadoop01 Created topic "hadoop01". [hadoop@hadoop01 bin]$ kafka-topics.sh --create --zookeeper hadoop01,hadoop02,hadoop03 --replication-factor 3 --partitions 1 --topic hadoop02 Created topic "hadoop02". [hadoop@hadoop01 bin]$ kafka-topics.sh --list --zookeeper localhost:2181 hadoop01 hadoop02 [hadoop@hadoop01 bin]$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic hadoop01 Topic:hadoop01 PartitionCount:3 ReplicationFactor:1 Configs: Topic: hadoop01 Partition: 0 Leader: 3 Replicas: 3 Isr: 3 Topic: hadoop01 Partition: 1 Leader: 1 Replicas: 1 Isr: 1 Topic: hadoop01 Partition: 2 Leader: 2 Replicas: 2 Isr: 2 ----------------------------------
|
<< 更多精彩尽在『程序萌部落』>>
<< https://www.cxmoe.com >>
检查log目录,对于topic hadoop01,hadoop01为0号分区,hadoop02为1号分区。
而topic hadoop02则复制了3份,都为0号分区
hadoop01-1
hadoop02-0
hadoop01-2
hadoop02-0
hadoop01-0
hadoop02-0
即:hadoop01-0,1,2
hadoop02-0,0,0
😒 留下您对该文章的评价 😄