kafka sh脚本参数

版本 2.11-1.0.0
1.kafka-console-consumer.sh

--blacklist <string blacklist > Blacklist of topics to exclude from onsumption.
--bootstrap-server <String: server to REQUIRED (unless old consumer is connect to> used): The server to connect to.
--consumer-property <String: A mechanism to pass user-defined consumer_prop> properties in the form key=value to the consumer.
--consumer.config <String: config file> Consumer config properties file. Note that [consumer-property] takes precedence over this config.
--csv-reporter-enabled If set, the CSV metrics reporter will be enabled
--delete-consumer-offsets If specified, the consumer path in zookeeper is deleted when starting up
--enable-systest-events Log lifecycle events of the consumer in addition to logging consumed messages. (This is specific for system tests.)
--formatter <String: class> The name of a class to use for formatting kafka messages for display. (default: kafka.tools. DefaultMessageFormatter)
--from-beginning 如果消费者没有设置过offset,则从头开始读;否则从latest读;比如group A有个消费者组A1,A1消费者线程激活后被关闭,CURRENT-OFFSET=2, LOG-END-OFFSET=4,若此时groupA的新的A2消费者线程,会从3读;若是groupB线程,会从0读
--group <String: consumer group id > The consumer group id of the consumer.
--isolation-level <String> Set to read_committed in order to filter out transactional messages which are not committed. Set to read_uncommittedto read all messages. (default: read_uncommitted)
--key-deserializer --key-deserializerString: deserializer for key>
--max-messages <Integer: num_messages> The maximum number of messages to consume before exiting. If not set, consumption is continual.
--metrics-dir <String: metrics If csv-reporter-enable is set, and directory> this parameter isset, the csv metrics will be output here
--new-consumer Use the new consumer implementation. This is the default, so this option is deprecated and will be removed in a future release.
--offset <String: consume offset> The offset id to consume from (a non- negative number), or 'earliest' which means from beginning, or 'latest' which means from end (default: latest)
--partition <Integer: partition> The partition to consume from. Consumption starts from the end of the partition unless '--offset' is specified.
--property <String: prop> The properties to initialize the message formatter.
--skip-message-on-error If there is an error when processing a message, skip it instead of halt.
--timeout-ms <Integer: timeout_ms> If specified, exit if no message is available for consumption for the specified interval.
--topic <String: topic> The topic id to consume on.
--value-deserializer <String: deserializer for values>
--whitelist <String: whitelist> Whitelist of topics to include for consumption.
--zookeeper <String: urls> REQUIRED (only when using old consumer): The connection string for the zookeeper connection in the form host:port. Multiple URLS can be given to allow fail-over.

2.kafka-consumer-groups.sh
默认里面列出的都是java新api方式产生的数据

每个命令前面2个短横线

参数
–topicsConsider all topics assigned to a group in the reset-offsets process.
–bootstrap-server <String: server toREQUIRED (for consumer groups based on connect to> the new consumer): The server to connect to.
–by-duration <String: duration>Reset offsets to offset by duration from current timestamp. Format: ‘PnDTnHnMnS’
–command-config <String: commandProperty file containing configs to be config property file> passed to Admin Client and Consumer.
–deletePass in groups to delete topic partition offsets and ownership information over the entire consumer group. For instance --group g1 – group g2 Pass in groups with a single topic to just delete the given topic’s partition offsets and ownership information for the given consumer groups. For instance --group g1 – group g2
–topic t1 Pass in just a topic to delete the given topic’s partition offsets and ownership information for every consumer group. For instance
–topic t1 WARNING: Group deletion only works for old ZK-based consumer groups, and one has to use it carefully to only delete groups that are not active.
–describeDescribe consumer group and list offset lag (number of messages not yet processed) related to given group.
–executeExecute operation. Supported operations: reset-offsets.
–exportExport operation execution to a CSV file. Supported operations: reset- offsets.
–from-file <String: path to CSV file>Reset offsets to values defined in CSV file.
–group <String: consumer group>The consumer group we wish to act on.
–listList all consumer groups.
–new-consumerUse the new consumer implementation. This is the default, so this option is deprecated and will be removed in a future release.
–reset-offsetsReset offsets of consumer group. Supports one consumer group at the time, and instances should be inactive Has 3 execution options: (default) to plan which offsets to reset,
– execute to execute the reset-offsets process, and
–export to export the results to a CSV format. Has the following scenarios to choose:
–to-datetime, --by-period, --to- earliest, --to-latest, --shift-by, – from-file,
–to-current. One scenario must be choose To define the scope use: --all-topics or --topic. . One scope must be choose, unless you use ’
–from-file’ scenario
–shift-by <Long: number-of-offsets>Reset offsets shifting current offset by ‘n’, where ‘n’ can be positive or negative
–timeout <Long: timeout (ms)>The timeout that can be set for some use cases. For example, it can be used when describing the group to specify the maximum amount of time in milliseconds to wait before the group stabilizes (when the group is just created, or is going through some changes). (default: 5000)
–to-currentReset offsets to current offset.
–to-datetime <String: datetime>Reset offsets to offset from datetime. Format: ‘YYYY-MM-DDTHH:mm:SS.sss’
–to-earliestReset offsets to earliest offset.
–to-latestReset offsets to latest offset.
–to-offset <Long: offset>Reset offsets to a specific offset.
–topic <String: topic>The topic whose consumer group information should be deleted or topic whose should be included in the reset offset process. In reset- offsets case, partitions can be specified using this format: topic1: 0,1,2, where 0,1,2 are the partition to be included in the process. Reset-offsets also supports multiple topic inputs.
–zookeeper <String: urls>REQUIRED (for consumer groups based on the old consumer): The connection string for the zookeeper connection in the form host:port. Multiple URLS can be given to allow fail-over.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值