生产者测试
tail -n 0 -f /var/log/messages | bin/kafka-console-producer.sh –broker-list aws10037.in.aiwaly.com:9092,aws10036.in.aiwaly.com:9092,aws10038.in.aiwaly.com:9092 –sync –topic my-replicated-topic

for((i=1;i<=10;));do echo test data-$(date +%F\ %T-%N) >> /var/log/messages

消费者测试
/data/apps/kafka_2.11-0.10.0.0/bin/kafka-console-consumer.sh –zookeeper aws10037.in.aiwaly.com:2181,aws10036.in.aiwaly.com:2181,aws10038.in.aiwaly.com:2181 –topic my-replicated-topic

kafka服务器停止

kill ps aux | grep java| grep "/data/apps/kafka_2.11-0.10.0.0/" | awk '{print $2}'

kafka服务器启动

/data/apps/kafka_2.11-0.10.0.0/bin/kafka-server-start.sh /data/apps/kafka_2.11-0.10.0.0/config/server.properties > /dev/nul &

KafkaOffsetMonitor
java -cp KafkaOffsetMonitor-assembly-0.2.0.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb –zk mq-ctc-bj-10-254-9-163.centos.pekdc1.chunbo.com:2191,mq-ctc-bj-10-254-9-164.centos.pekdc1.chunbo.com:2191,zookeeper03-ctc-bj-10-254-9-15.centos.pekdc1.chunbo.com:2191 –port 8089 –refresh 10.seconds –retain 1.days > /dev/null &

文档更新时间: 2019-06-20 07:36   作者:月影鹏鹏