kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: KAFKA-5495; Update docs to use `kafka-consumer-groups.sh` for checking consumer offsets
Date Mon, 02 Oct 2017 19:46:25 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 39d5cdccc -> cdbf806e2


KAFKA-5495; Update docs to use `kafka-consumer-groups.sh` for checking consumer offsets

And remove the deprecated `ConsumerOffsetChecker` example.

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #3405 from vahidhashemian/KAFKA-5495


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/cdbf806e
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/cdbf806e
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/cdbf806e

Branch: refs/heads/trunk
Commit: cdbf806e2d03594161a18d9a7484a74dfed05a3e
Parents: 39d5cdc
Author: Vahid Hashemian <vahidhashemian@us.ibm.com>
Authored: Mon Oct 2 12:46:05 2017 -0700
Committer: Jason Gustafson <jason@confluent.io>
Committed: Mon Oct 2 12:46:05 2017 -0700

----------------------------------------------------------------------
 docs/ops.html | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/cdbf806e/docs/ops.html
----------------------------------------------------------------------
diff --git a/docs/ops.html b/docs/ops.html
index c55b768..60c17cd 100644
--- a/docs/ops.html
+++ b/docs/ops.html
@@ -140,14 +140,27 @@
   <h4><a id="basic_ops_consumer_lag" href="#basic_ops_consumer_lag">Checking
consumer position</a></h4>
   Sometimes it's useful to see the position of your consumers. We have a tool that will show
the position of all consumers in a consumer group as well as how far behind the end of the
log they are. To run this tool on a consumer group named <i>my-group</i> consuming
a topic named <i>my-topic</i> would look like this:
   <pre class="brush: bash;">
-  &gt; bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper localhost:2181
--group test
-  Group           Topic                          Pid Offset          logSize         Lag
            Owner
-  my-group        my-topic                       0   0               0               0  
            test_jkreps-mn-1394154511599-60744496-0
-  my-group        my-topic                       1   0               0               0  
            test_jkreps-mn-1394154521217-1a0be913-0
+  &gt; bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group
my-group
+
+  Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based
consumers).
+  
+  TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG        CONSUMER-ID
                                      HOST                           CLIENT-ID
+  my-topic                       0          2               4               2          consumer-1-029af89c-873c-4751-a720-cefd41a669d6
  /127.0.0.1                     consumer-1
+  my-topic                       1          2               3               1          consumer-1-029af89c-873c-4751-a720-cefd41a669d6
  /127.0.0.1                     consumer-1
+  my-topic                       2          2               3               1          consumer-2-42c1abd4-e3b2-425d-a8bb-e1ea49b29bb2
  /127.0.0.1                     consumer-2
   </pre>
 
+  This tool also works with ZooKeeper-based consumers:
+  <pre class="brush: bash;">
+  &gt; bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --describe --group my-group
+
+  Note: This will only show information about consumers that use ZooKeeper (not those using
the Java consumer API).
 
-  NOTE: Since 0.9.0.0, the kafka.tools.ConsumerOffsetChecker tool has been deprecated. You
should use the kafka.admin.ConsumerGroupCommand (or the bin/kafka-consumer-groups.sh script)
to manage consumer groups, including consumers created with the <a href="http://kafka.apache.org/documentation.html#newconsumerapi">new
consumer API</a>.
+  TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG        CONSUMER-ID
+  my-topic                       0          2               4               2          my-group_consumer-1
+  my-topic                       1          2               3               1          my-group_consumer-1
+  my-topic                       2          2               3               1          my-group_consumer-2
+  </pre>
 
   <h4><a id="basic_ops_consumer_group" href="#basic_ops_consumer_group">Managing
Consumer Groups</a></h4>
 
@@ -158,15 +171,15 @@
   For example, to list all consumer groups across all topics:
 
   <pre class="brush: bash;">
-  &gt; bin/kafka-consumer-groups.sh --bootstrap-server broker1:9092 --list
+  &gt; bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
 
   test-consumer-group
   </pre>
 
-  To view offsets as in the previous example with the ConsumerOffsetChecker, we "describe"
the consumer group like this:
+  To view offsets, as mentioned earlier, we "describe" the consumer group like this:
 
   <pre class="brush: bash;">
-  &gt; bin/kafka-consumer-groups.sh --bootstrap-server broker1:9092 --describe --group
test-consumer-group
+  &gt; bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group
test-consumer-group
 
   TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG        CONSUMER-ID
                                      HOST                           CLIENT-ID
   test-foo                       0          1               3               2          consumer-1-a5d61779-4d04-4c50-a6d6-fb35d942642d
  /127.0.0.1                     consumer-1


Mime
View raw message