【Azure 事件中心】在Windows系统中使用 kafka-consumer-groups.bat 查看Event Hub中kafka的consumer groups信息
问题描述
使用 Apache Flink 连接支持 Apache Kafka的Azure Event Hub后,由于消费端的Consumer Group是动态创建,在门户页面和Service Bus Explorer工具中均无法查看,所以如何来查看 Kafka consumer group呢?可以参考以下内容:
使用前提
将 Apache Flink 与适用于 Apache Kafka 的 Azure 事件中心配合使用: https://docs.azure.cn/zh-cn/event-hubs/event-hubs-kafka-flink-tutorial
- 在Azure中创建一个支持Kafka的Event Hub(标准层及以上)
- 下载示例代码:git clone https://github.com/Azure/azure-event-hubs-for-kafka.git
- 修改 producer.config 和 consumer.config
操作步骤
If customer has an active group, they can check consumer lag (which indicate what data has been consumed) through Kafka's own kafka-consumer-groups.sh command (https://kafka.apache.org/documentation/#basic_ops_consumer_lag)
- Make sure you setup Java JDK on your machine. then download the Kafka binary downloads from (https://kafka.apache.org/downloads) - you just need the binary downloads, no need to get the source unless you intend to modify the source code that the script uses.
- from command prompt, navigate to your downloaded bin directory - e.g. F:\\kafka_2.13-3.0.0\bin\windows (for windows shell script).
- Create a properties file that has the connection string for your namespace. For example you can create a config.properties file that has the following.
bootstrap.servers=<your namespace>.servicebus.windows.net:9093
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="<Your connection string>";
- After that just run through the command as describe in https://kafka.apache.org/documentation/#basic_ops_consumer_lag to see your information. sample below. Note that currently, this only works if the group is an active group meaning it has active consumers running for the group. this command does not work for EventHub service if the group is inactive.
F:\kafka_2.13-3.0.0\bin\windows>.\kafka-consumer-groups.bat --bootstrap-server <your namespace>.servicebus.windows.net:9093 --command-config F:\kafka_2.13-3.0.0\bin\windows\config.properties --list
$hmlam-4 F:\kafka_2.13-3.0.0\bin\windows>.\kafka-consumer-groups.bat --bootstrap-server <your namespace>.servicebus.windows.net:9093 --command-config F:\kafka_2.13-3.0.0\bin\windows\config.properties --describe --group $hmlam-4 GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
$hmlam-4 hmlam-eh-2 1 52648 52651 3 hmlam-cbn04-001.servicebus.windows.net:c:$hmlam-4:I:perf_client#1-c391de052f2446ff85fbf6899160a236 0.0.0.0 perf_client#1
$hmlam-4 hmlam-eh-2 0 52932 52946 14 hmlam-cbn04-001.servicebus.windows.net:c:$hmlam-
目前遇见的问题
当根据以上步骤设置好,并且同时运行了生产者代码和消费组代码,可是却无法获取到kafka group信息

(TODO: 问题还在进一步的研究中)
【Azure 事件中心】在Windows系统中使用 kafka-consumer-groups.bat 查看Event Hub中kafka的consumer groups信息的更多相关文章
- 【Azure 事件中心】在Service Bus Explorer工具种查看到EventHub数据在分区中的各种属性问题
问题描述 通过Service Bus Explorer工具,查看到Event Hub的属性值,从而产生的问题及讨论: Size in Bytes: 这个是表示当前分区可以存储的最大字节数吗? La ...
- 【Azure 事件中心】在微软云中国区 (Mooncake) 上实验以Apache Kafka协议方式发送/接受Event Hubs消息 (Java版)
问题描述 事件中心提供 Kafka 终结点,现有的基于 Kafka 的应用程序可将该终结点用作运行你自己的 Kafka 群集的替代方案. 事件中心可与许多现有 Kafka 应用程序配合使用.在Azur ...
- 【Azure 事件中心】使用Azure AD认证方式创建Event Hub Consume Client + 自定义Event Position
问题描述 当使用SDK连接到Azure Event Hub时,最常规的方式为使用连接字符串.这种做法参考官网文档就可成功完成代码:https://docs.azure.cn/zh-cn/event-h ...
- 【Azure 事件中心】EPH (EventProcessorHost) 消费端观察到多次Shutdown,LeaseLost的error信息,这是什么情况呢?
问题详情 使用EPH获取Event Hub数据时,多次出现连接shutdown和LeaseLost的error ,截取某一次的error log如: Time:2021-03-10 08:43:48 ...
- 【Azure 事件中心】为应用程序网关(Application Gateway with WAF) 配置诊断日志,发送到事件中心
问题描述 在Application Gateway中,开启WAF(Web application firewall)后,现在需要把访问的日志输出到第三方分析代码中进行分析,如何来获取WAF的诊断日志呢 ...
- 【Azure 事件中心】Azure Event Hub 新功能尝试 -- 异地灾难恢复 (Geo-Disaster Recovery)
问题描述 关于Event Hub(事件中心)的灾备方案,大多数就是新建另外一个备用的Event Hub,当主Event Hub出现不可用的情况时,就需要切换到备Event Hub上. 而在切换的过程中 ...
- 【Azure 事件中心】Event Hub 无法连接,出现 Did not observe any item or terminal signal within 60000ms in 'flatMapMany' 的错误消息
问题描述 使用Java SDK连接Azure Event Hub,一直出现 java.util.concurrent.TimeoutException 异常, 消息为:java.util.concur ...
- 【Azure 事件中心】 org.slf4j.Logger 收集 Event Hub SDK(Java) 输出日志并以文件形式保存
问题描述 在使用Azure Event Hub的SDK时候,常规情况下,发现示例代码中并没有SDK内部的日志输出.因为在Java项目中,没有添加 SLF4J 依赖,已致于在启动时候有如下提示: SLF ...
- 【Azure API 管理】在APIM 中添加 log-to-eventhub 策略,把 Request Body 信息全部记录在Event Hub中
问题描述 根据文档 https://docs.azure.cn/zh-cn/api-management/api-management-howto-log-event-hubs, 可以将Azure A ...
- 【Azure 环境】在Windows系统中 使用Terraform创建中国区Azure资源步骤(入门级)
Terraform(全称:Hashicorp Terraform )是一种开源工具,用于预配和管理云基础结构. 它将基础结构编入描述云资源拓扑的配置文件中. 这些资源包括虚拟机.存储帐户和网络接口等. ...
随机推荐
- 一个PCI-E的硬盘参数
看了下 HDD 随机 IOPS 在 100-200 之间 (读写) SATA的 SSD 随机IOPS 在 读 100k 写 20k 左右U.2的SSD 的随机IOPS 在 读 500k 写 50k 左 ...
- ABP 使用Except 和EqualityHelper<T> 实现去重
先上一端代码!!! railwayCar中有10条记录,train参考railwayCar创建了5条记录.要实现,当train再次参考railwayCar创建记录时,使用过的记录在展示列表时不可以再次 ...
- 从零开始配置 vim(13)——标签页插件
原始的vim中标签页已经足够好用了.你完全可以使用原始 vim 提供的功能,但是使用插件可以让它更好看.这里我比较喜欢使用 bufferline 这个插件 安装 首先我们来安装它, 在使用 packe ...
- SqlSugar分页查询
同步分页 int pagenumber= 1; // pagenumber是从1开始的不是从零开始的 int pageSize = 20; int totalCount=0; //单表分页 ...
- 深度学习应用篇-元学习[14]:基于优化的元学习-MAML模型、LEO模型、Reptile模型
深度学习应用篇-元学习[14]:基于优化的元学习-MAML模型.LEO模型.Reptile模型 1.Model-Agnostic Meta-Learning Model-Agnostic Meta-L ...
- 特定领域知识图谱融合方案:文本匹配算法之预训练Simbert、ERNIE-Gram单塔模型等诸多模型【三】
特定领域知识图谱融合方案:文本匹配算法之预训练模型SimBert.ERNIE-Gram 文本匹配任务在自然语言处理中是非常重要的基础任务之一,一般研究两段文本之间的关系.有很多应用场景:如信息检索.问 ...
- 【四】超级快速pytorch安装,三步走,分分钟完成!
相关文章: [一]tensorflow安装.常用python镜像源.tensorflow 深度学习强化学习教学 [二]tensorflow调试报错.tensorflow 深度学习强化学习教学 [三]t ...
- C/C++ 实现Socket交互式服务端
在 Windows 操作系统中,原生提供了强大的网络编程支持,允许开发者使用 Socket API 进行网络通信,通过 Socket API,开发者可以创建.连接.发送和接收数据,实现网络通信.本文将 ...
- x64dbg 实现插件Socket反向通信
编写一个带有socket通信功能的插件,x64dbg运行后,用户点击链接按钮可直接连接到外部的python中,python作为服务端,当x64dbg内部出现某个事件后,自动将消息推送到外部python ...
- C++ Boost库 操作日期与时间
Boost库中默认针对日期与时间的操作库分为,timer,progress_timer,date_time这几类,如下是一些常用的使用方法总结. timer库 #include <iostrea ...