You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jk...@apache.org on 2014/03/05 23:39:27 UTC
svn commit: r1574703 - /kafka/site/081/quickstart.html
Author: jkreps
Date: Wed Mar 5 22:39:27 2014
New Revision: 1574703
URL: http://svn.apache.org/r1574703
Log:
Fix formatting problems in quickstart.
Modified:
kafka/site/081/quickstart.html
Modified: kafka/site/081/quickstart.html
URL: http://svn.apache.org/viewvc/kafka/site/081/quickstart.html?rev=1574703&r1=1574702&r2=1574703&view=diff
==============================================================================
--- kafka/site/081/quickstart.html (original)
+++ kafka/site/081/quickstart.html Wed Mar 5 22:39:27 2014
@@ -5,11 +5,11 @@
<a href="../downloads.html" title="Kafka downloads">Download</a> the 0.8 release.
<pre>
-<b>> tar xzf kafka-<VERSION>.tgz</b>
-<b>> cd kafka-<VERSION></b>
-<b>> ./sbt update</b>
-<b>> ./sbt package</b>
-<b>> ./sbt assembly-package-dependency</b>
+> <b>tar xzf kafka-<VERSION>.tgz</b>
+> <b>cd kafka-<VERSION></b>
+> <b>./sbt update</b>
+> <b>./sbt package</b>
+> <b>./sbt assembly-package-dependency</b>
</pre>
This tutorial assumes you are starting on a fresh ZooKeeper instance and Kafka server with no pre-existing data.
@@ -20,14 +20,14 @@ This tutorial assumes you are starting o
Kafka uses zookeeper so you need to first start a zookeeper server if you don't already have one. You can use the convenience script packaged with kafka to get a quick-and-dirty single-node zookeeper instance.
<pre>
-<b>> bin/zookeeper-server-start.sh config/zookeeper.properties</b>
+> <b>bin/zookeeper-server-start.sh config/zookeeper.properties</b>
[2013-04-22 15:01:37,495] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
...
</pre>
Now start the Kafka server:
<pre>
-<b>> bin/kafka-server-start.sh config/server.properties</b>
+> <b>bin/kafka-server-start.sh config/server.properties</b>
[2013-04-22 15:01:47,028] INFO Verifying properties (kafka.utils.VerifiableProperties)
[2013-04-22 15:01:47,051] INFO Property socket.send.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
...
@@ -55,8 +55,8 @@ Run the producer and then type a few mes
<pre>
> <b>bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test</b>
-This is a message
-This is another message
+<b>This is a message</a>
+<b>This is another message</b>
</pre>
<h4>Step 5: Start a consumer</h4>
@@ -64,7 +64,7 @@ This is another message
Kafka also has a command line consumer that will dump out messages to standard output.
<pre>
-<b>> bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning</b>
+> <b>bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning</b>
This is a message
This is another message
</pre>
@@ -81,8 +81,8 @@ So far we have been running against a si
<p>
First we make a config file for each of the brokers:
<pre>
-<b>> cp config/server.properties config/server-1.properties
-> cp config/server.properties config/server-2.properties</b>
+> <b>cp config/server.properties config/server-1.properties</b>
+> <b>cp config/server.properties config/server-2.properties</b>
</pre>
Now edit these new files and set the following properties:
@@ -102,9 +102,9 @@ The <code>broker.id</code> property is t
<p>
We already have Zookeeper and our single node started, so we just need to start the two new nodes:
<pre>
-<b>> bin/kafka-server-start.sh config/server-1.properties &</b>
+> <b>bin/kafka-server-start.sh config/server-1.properties &</b>
...
-<b>> bin/kafka-server-start.sh config/server-2.properties &</b>
+> <b>bin/kafka-server-start.sh config/server-2.properties &</b>
...
</pre>
@@ -143,9 +143,9 @@ Let's publish a few messages to our new
<b>my test message 2</b>
<b>^C</b>
</pre>
-Now consume this message:
+Now let's consume these messages:
<pre>
-<b>> bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic my-replicated-topic</b>
+> <b>bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic my-replicated-topic</b>
...
my test message 1
my test message 2
@@ -161,13 +161,13 @@ Now let's test out fault-tolerance. Brok
Leadership has switched to one of the slaves and node 1 is no longer in the in-sync replica set:
<pre>
-> <b>bin/kafktopics.sh --describe --zookeeper localhost:218192 --topic my-replicated-topic</b>
+> <b>bin/kafka-topics.sh --describe --zookeeper localhost:218192 --topic my-replicated-topic</b>
Topic:my-replicated-topic PartitionCount:1 ReplicationFactor:3 Configs:
Topic: my-replicated-topic Partition: 0 Leader: 2 Replicas: 1,2,0 Isr: 2,0
</pre>
But the messages are still be available for consumption even though the leader that took the writes originally is down:
<pre>
-<b>> bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic my-replicated-topic</b>
+> <b>bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic my-replicated-topic</b>
...
my test message 1
my test message 2