kafka zookeeper default in the / root directory, / replace / kafka

Demand: kafka zookeeper default in the / root directory, / replace / kafka

 

Step:
1, the root directory into the kafka: [root @ node01 kafka_2.11-1.0.0] # cd /export/servers/kafka_2.11-1.0.0/

2,3 node needs to: Referring to FIG. 1, edit server.properties

3,3 nodes must be: Set 2 of FIG. save.

4, then close kafka, then close the zookeeper (may not necessarily be shut zk, I have not tried not shut okay), and then start zk, then start kafka.

5, with reference to FIG. 3, create Topic: kafka-topics.sh --create --partitions 3 --replication factor-2 --topic kafka1 --zookeeper amdha01: 2181, amdha02: 2181, node03: 2181 / Kafka
. 6, reference 4, start Manufacturer: kafka-console-producer.sh --broker-List amdha01: 9092, amdha02: 9092, node03: 9092 --topic kafka1
. 7, with reference to FIG. 5, starting consumers: kafka-console-consumer. sh --from-beginning --topic kafka1 --zookeeper node01 : 2181, node02: 2181, node03: 2181 / kafka

8, 4, 5, the production of some of the data, and to see if consumers can consume the data.

9, with reference to FIG. 6, the client starts zk, zkCli.sh, verify the root directory on kafka zk exists.

 

Note: When kafka the root directory becomes zk / kafka, --zookeeper kafka-topics.sh parameters to be written and kafka-console-consumer.sh amdha01: 2181, amdha02: 2181, node03: 2181 / kafka

  The kafka-console-producer.sh of --broker-list argument is still node01: 9092, node02: 9092, node03: 9092

 

 

Guess you like

Origin www.cnblogs.com/mediocreWorld/p/11311998.html