Kafka MirrorMaker 2多集群复制治理
概览
- MM2 使用 Kafka Connect 在源与目标集群之间复制主题数据与消费偏移,支持双向拓扑与故障切换。
- 通过复制策略类控制主题命名与前缀;心跳与检查点主题用于健康与偏移同步。
- 在切换期间治理生产/消费流向与一致性。
技术参数(已验证)
- 拓扑:配置
clusters、源/目标连接器;支持双向与单向复制;心跳与检查点主题自动创建。
- 命名:
replication.policy.class 控制前缀与名称规则;默认 DefaultReplicationPolicy。
- 偏移:自动同步消费组偏移到目标集群;在切换后进行偏移映射与验证。
- 安全:配置双集群的认证与授权;限制复制的主题集合与 ACL。
- 观测:监控复制滞后与错误;在演练中验证切换路径与一致性。
实战清单
- 配置并启动源/目标复制连接器;明确主题选择与命名策略。
- 演练偏移同步与故障切换;文档化切换步骤与回退路径。
- 建立复制健康与滞后监控;持续优化与限制范围。
- Importance: 以标准化复制与偏移治理支持多集群容灾与迁移。
基本
文件
流程
错误
SQL
调试
- 请求信息 : 2026-09-28 08:20:27 HTTP/2.0 GET : www.ybb.press/tutorial/2041.html
- 运行时间 : 0.346398s [ 吞吐率:2.89req/s ] 内存消耗:5,316.94kb 文件加载:115
- 查询信息 : 19 queries 2 writes
- 缓存信息 : 36 reads,3 writes
- 配置加载 : 80
- 会话信息 : SESSION_ID=me5ir9sutmodj10bhqptt0p47l
- [ BEHAVIOR ] Run Closure @app_init [ RunTime:0.000085s ]
- [ CACHE ] INIT File
- [ BEHAVIOR ] Run \addons\cms\Cms @app_init [ RunTime:0.008637s ]
- [ BEHAVIOR ] Run \addons\fastchat\Fastchat @app_init [ RunTime:0.000228s ]
- [ BEHAVIOR ] Run \addons\log\Log @app_init [ RunTime:0.000403s ]
- [ BEHAVIOR ] Run \addons\shop\Shop @app_init [ RunTime:0.003314s ]
- [ BEHAVIOR ] Run \addons\yunping\Yunping @app_init [ RunTime:0.000477s ]
- [ BEHAVIOR ] Run Closure @app_init [ RunTime:0.000613s ]
- [ BEHAVIOR ] Run app\common\behavior\Common @app_init [ RunTime:0.001380s ]
- [ LANG ] /www/wwwroot/yebinbing/thinkphp/lang/zh-cn.php
- [ BEHAVIOR ] Run app\common\behavior\Common @app_dispatch [ RunTime:0.000105s ]
- [ ROUTE ] array (
'type' => 'method',
'method' =>
array (
0 => '\\think\\addons\\Route',
1 => 'execute',
),
'var' =>
array (
'addon' => 'cms',
'controller' => 'archives',
'action' => 'index',
),
)
- [ HEADER ] array (
'x-forwarded-proto' => 'https',
'cf-visitor' => '{"scheme":"https"}',
'cf-ipcountry' => 'US',
'cf-connecting-ip' => '216.73.216.103',
'cdn-loop' => 'cloudflare; loops=1',
'user-agent' => 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])',
'accept-encoding' => 'gzip, br',
'accept' => '*/*',
'cf-ray' => 'a41e951dbabdcf79-CMH',
'x-forwarded-for' => '216.73.216.103',
'host' => 'www.ybb.press',
'content-length' => '',
'content-type' => '',
)
- [ PARAM ] array (
'catename' => 'tutorial',
'id' => '2041',
)
- [ RUN ] think\addons\Route->execute[ /www/wwwroot/yebinbing/vendor/fastadminnet/fastadmin-addons/src/addons/Route.php ]
- [ LANG ] /www/wwwroot/yebinbing/public/../application/common/lang/zh-cn/addon.php
- [ BEHAVIOR ] Run app\common\behavior\Common @addon_begin [ RunTime:0.004353s ]
- [ LANG ] /www/wwwroot/yebinbing/addons/cms/lang/zh-cn.php
- [ DB ] INIT mysql
- [ VIEW ] /www/wwwroot/yebinbing/addons/cms/view/default/show_article.html [ array (
0 => 'config',
1 => 'user',
2 => 'site',
3 => '__CHANNEL__',
4 => 'isWechat',
5 => 'canonical_url',
6 => '__ARCHIVES__',
7 => '__MODEL__',
) ]
- [ SESSION ] INIT array (
'id' => '',
'var_session_id' => '',
'prefix' => 'think',
'type' => '',
'auto_start' => true,
)
- [ BEHAVIOR ] Run \addons\cms\Cms @view_filter [ RunTime:0.000373s ]
- [ BEHAVIOR ] Run \addons\shop\Shop @view_filter [ RunTime:0.000103s ]

0.348897s
发表评论 取消回复