第89课程 Spark STREAMING kafka 测试完成!生产者发数据,消费者收数据
kafaka
1.
cat /usr/local/kafka_2.10-0.9.0.1/config/server.properties
zookeeper.connect=master:2181,worker1:2181,worker2:2181
2.
kafka-server-stop.sh
3.
nohup kafka-server-start.sh /usr/local/kafka_2.10-0.9.0.1/config/server.properties &
4.
kafka-topics.sh --create --zookeeper master:2181,worker1:2181,worker2:2181 --replication-factor 1 --partitions 1 --topic IMFHelloKafka
root@master:/usr/local/setup_scripts# kafka-topics.sh --create --zookeeper master:2181,worker1:2181,worker2:2181 --replication-factor 1 --partitions 1 --topic IMFHelloKafka
Created topic "IMFHelloKafka".
5.
kafka-topics.sh --describe --zookeeper master:2181,worker1:2181,worker2:2181 --topic IMFHelloKafka
root@master:/usr/local/setup_scripts# kafka-topics.sh --describe --zookeeper master:2181,worker1:2181,worker2:2181 --topic IMFHelloKafka
Topic:IMFHelloKafka PartitionCount:1 ReplicationFactor:1 Configs:
Topic: IMFHelloKafka Partition: 0 Leader: 1 Replicas: 1 Isr: 1
root@master:/usr/local/setup_scripts#
6.
kafka-console-producer.sh --broker-list master:9092,worker1:9092,worker2:9092 --topic IMFHelloKafka
7.
kafka-console-consumer.sh --zookeeper master:2181,worker1:2181,worker2:2181 --from-beginning --topic IMFHelloKafka
8 jieguo
root@master:/usr/local/setup_scripts# kafka-console-producer.sh --broker-list master:9092,worker1:9092,worker2:9092 --topic IMFHelloKafka
sp^H^H
life is short ,you needs^H spark
th^H the kafka test ok!!!!!!!!
root@worker1:/usr/local/kafka_2.10-0.9.0.1/config# kafka-console-consumer.sh --zookeeper master:2181,worker1:2181,worker2:2181 --from-beginning --topic IMFHelloKafka
sp
life is short ,you need spark
t the kafka test ok!!!!!!!!