Apache Kafka: Difference between revisions
Jump to navigation
Jump to search
| Line 37: | Line 37: | ||
</pre> |
</pre> |
||
Info on topic |
|||
<pre> |
|||
./bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test |
|||
</pre> |
|||
==Replicated topics== |
|||
Info on topics Kafka console consumer |
|||
<pre> |
|||
./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic my-replicated-topic |
|||
./bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic my-replicated-topic |
|||
</pre> |
|||
==Stop all== |
|||
Stop all |
Stop all |
||
<pre> |
<pre> |
||
Revision as of 15:13, 5 April 2014
Apache Kafka is Publish-Subscribe messaging rethought as a distributed commit log.
Clients en Perl, Python, Node.js, C, C++, Scala ...: https://cwiki.apache.org/confluence/display/KAFKA/Clients
First steps with Kafka
see Quickstart
cd kafka
Launch Zookeeper
./bin/zookeeper-server-start.sh ./config/zookeeper.properties
Launch Kafka server
./bin/kafka-server-start.sh ./config/server.properties
Create a topic
./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
Launch Kafka console producer
./bin/kafka-console-producer.sh --broker-list localhost:2181 --topic test
Launch Kafka console consumer
./bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test
Info on topic
./bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test
Replicated topics
Info on topics Kafka console consumer
./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic my-replicated-topic ./bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic my-replicated-topic
Stop all
Stop all
./bin/kafka-server-stop.sh ./bin/zookeeper-server-stop.sh
Extra
Launch Zookeeper shell
./bin/zookeeper-shell.sh localhost:2181