Monday, November 30, 2015

Kafka test

  1. Cluster Setting
    1. setting zookeeper cluster
    2. process at each cluster node
    3. cd $KAFKA_HOME
    4. vim config/server.properties
    5. edit
      1. broker.id
    6. bin/kafka-server-start.sh config/server.properties & / sudo bin/kafka-server-start.sh -daemon config/test.properties &
  2. Basic Test
    1. bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic rep-test
    2. bin/kafka-topics.sh --list --zookeeper localhost:2181
    3. bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic rep-test
    4. bin/kafka-console-producer.sh --broker-list localhost:9092 --topic rep-test
      test 1
      test 2
      test 3
    5. bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic rep-test
  3. Fault Tolerance Test
    1. kill the leader
    2. do the basic test again
    3. start the killed server again
    4. do the basic test again

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.