[{"data":1,"prerenderedAt":30181},["ShallowReactive",2],{"all-posts":3},[4,943,1499,2035,2750,3341,4652,5711,6701,6949,7444,7669,8050,8311,8913,10316,11927,13228,13937,14633,16022,16711,17686,17896,18418,20569,21520,22511,22901,23102],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"date":11,"tags":12,"body":19,"_type":937,"_id":938,"_source":939,"_file":940,"_stem":941,"_extension":942},"\u002Fblog\u002F2026-11-29-data-systems-in-ai-agents","blog",false,"","AI Agent 框架里，为什么到处是数据系统的老套路？","拆完 15 个主流数据与后端框架源码后再看 LangGraph 和 LangChain，发现它们解决的还是不丢进度、并发合并、阶段同步、写前记账和断点恢复这五个老问题。","2026-11-29",[13,14,15,16,17,18],"Agent 架构","架构设计","大数据","LangGraph","数据湖","Spring Boot",{"type":20,"children":21,"toc":923},"root",[22,30,35,49,56,61,70,75,82,93,155,161,206,226,232,244,288,294,306,318,324,337,366,371,379,385,390,398,521,527,532,829,835,840,884,889],{"type":23,"tag":24,"props":25,"children":26},"element","p",{},[27],{"type":28,"value":29},"text","11 月初我集中拆了一批主流框架的源码，从数据湖（Iceberg、Paimon、Hudi）、计算与存储引擎（Spark、Flink、StarRocks、HBase），一路拆到 Spring Boot、LangChain 和 LangGraph。",{"type":23,"tag":24,"props":31,"children":32},{},[33],{"type":28,"value":34},"拆到 LangGraph 那几份核心代码时，我有种很强的既视感。外面都把它当 AI 智能体框架讲，但掀开顶层的提示词和工具包装，里面跑着的其实是一套小型分布式执行引擎——每走一步怎么留存档、几个节点同时改一个字段怎么不打架、跑一半要停下来等人工审批怎么办、崩了怎么接着干。这些活，做数据系统的人已经干了几十年。",{"type":23,"tag":24,"props":36,"children":37},{},[38,40,47],{"type":28,"value":39},"最近我在给 ",{"type":23,"tag":41,"props":42,"children":44},"a",{"href":43},"\u002Fprojects\u002Fgenesis\u002F",[45],{"type":28,"value":46},"Genesis",{"type":28,"value":48}," 落 75 个受控工具的 Data Agent 运行时，用的正好是 Spring Boot 后端配 LangGraph Sidecar，两边源码放在一起对照，同款套路看得更清楚。",{"type":23,"tag":50,"props":51,"children":53},"h2",{"id":52},"langgraph-借来的五套数据系统老机制",[54],{"type":28,"value":55},"LangGraph 借来的五套数据系统老机制",{"type":23,"tag":24,"props":57,"children":58},{},[59],{"type":28,"value":60},"先看总图。左边五项是数据湖、计算引擎和存储系统里用烂了的机制，右边五项是 LangGraph 的核心部件，每一对解决的都是同一个工程问题。",{"type":23,"tag":24,"props":62,"children":63},{},[64],{"type":23,"tag":65,"props":66,"children":69},"img",{"alt":67,"src":68},"数据系统与 LangGraph 五组核心机制对照：Iceberg 快照与 Flink checkpoint 对应 checkpointer；Paimon merge-engine 对应 State 字段 reducer；Spark Stage 与 StarRocks 屏障对应 Pregel 超步；HBase WAL 对应 pending writes 暂存；Hudi instant 状态机对应 interrupt 与 resume","\u002Fimages\u002Fblog\u002Fdata-systems-in-ai-agents\u002Fdata-to-agent-map.svg",[],{"type":23,"tag":24,"props":71,"children":72},{},[73],{"type":28,"value":74},"逐个拆开来看它们到底在干什么，以及源码里真实的默认行为。",{"type":23,"tag":76,"props":77,"children":79},"h3",{"id":78},"_1-每走一步拍张照iceberg-快照-flink-checkpoint-langgraph-checkpointer",[80],{"type":28,"value":81},"1. 每走一步拍张照：Iceberg 快照 \u002F Flink checkpoint → LangGraph checkpointer",{"type":23,"tag":24,"props":83,"children":84},{},[85,91],{"type":23,"tag":86,"props":87,"children":88},"strong",{},[89],{"type":28,"value":90},"checkpoint（存档点）",{"type":28,"value":92}," 说白了就是给当前全部流程状态拍一张不可变快照。在数据湖里，Iceberg 每次提交都留一份快照，所以可以时间旅行、回退或者拉分支；在流计算里，Flink 定期做全站 checkpoint，节点挂了就从最近一次存档接着算。",{"type":23,"tag":24,"props":94,"children":95},{},[96,98,105,107,113,115,121,123,129,131,137,139,145,147,153],{"type":28,"value":97},"LangGraph 的 ",{"type":23,"tag":99,"props":100,"children":102},"code",{"className":101},[],[103],{"type":28,"value":104},"checkpointer",{"type":28,"value":106}," 干的是同一件事。它按 ",{"type":23,"tag":99,"props":108,"children":110},{"className":109},[],[111],{"type":28,"value":112},"thread_id",{"type":28,"value":114},"（一次独立会话或任务线）归档，每跑完一个回合就存一份当前状态。靠这层持久化，你可以回看历史每一步，甚至从过去某一步分叉重跑。在 ",{"type":23,"tag":99,"props":116,"children":118},{"className":117},[],[119],{"type":28,"value":120},"libs\u002Flanggraph\u002Flanggraph\u002Fpregel\u002Fmain.py",{"type":28,"value":122}," 里，持久化模式参数 ",{"type":23,"tag":99,"props":124,"children":126},{"className":125},[],[127],{"type":28,"value":128},"durability",{"type":28,"value":130}," 默认值是 ",{"type":23,"tag":99,"props":132,"children":134},{"className":133},[],[135],{"type":28,"value":136},"\"async\"",{"type":28,"value":138},"（异步刷盘），还提供 ",{"type":23,"tag":99,"props":140,"children":142},{"className":141},[],[143],{"type":28,"value":144},"sync",{"type":28,"value":146},"（同步落盘）和 ",{"type":23,"tag":99,"props":148,"children":150},{"className":149},[],[151],{"type":28,"value":152},"exit",{"type":28,"value":154},"（退出时再存）两档，和数据库里在性能与落盘安全性之间做权衡一模一样。",{"type":23,"tag":76,"props":156,"children":158},{"id":157},"_2-多个节点改同一字段paimon-合并引擎-state-reducer",[159],{"type":28,"value":160},"2. 多个节点改同一字段：Paimon 合并引擎 → State reducer",{"type":23,"tag":24,"props":162,"children":163},{},[164,166,172,174,180,182,188,190,196,198,204],{"type":28,"value":165},"如果两个并行分支同时更新 State 里的同一个字段，直接覆盖肯定丢数据。在流式数据湖 Paimon 里，这个问题靠 ",{"type":23,"tag":99,"props":167,"children":169},{"className":168},[],[170],{"type":28,"value":171},"CoreOptions",{"type":28,"value":173}," 里的 ",{"type":23,"tag":99,"props":175,"children":177},{"className":176},[],[178],{"type":28,"value":179},"merge-engine",{"type":28,"value":181}," 解决：默认是 ",{"type":23,"tag":99,"props":183,"children":185},{"className":184},[],[186],{"type":28,"value":187},"deduplicate",{"type":28,"value":189},"（同主键留最新），也可以按业务选 ",{"type":23,"tag":99,"props":191,"children":193},{"className":192},[],[194],{"type":28,"value":195},"partial-update",{"type":28,"value":197},"（部分列更新）或 ",{"type":23,"tag":99,"props":199,"children":201},{"className":200},[],[202],{"type":28,"value":203},"aggregation",{"type":28,"value":205},"（按字段做累加、取最大等聚合）。",{"type":23,"tag":24,"props":207,"children":208},{},[209,211,216,218,224],{"type":28,"value":210},"LangGraph 在 State 字段上挂的 ",{"type":23,"tag":86,"props":212,"children":213},{},[214],{"type":28,"value":215},"reducer（合并规则）",{"type":28,"value":217}," 是同一个思路。最常见的是消息列表字段上的 ",{"type":23,"tag":99,"props":219,"children":221},{"className":220},[],[222],{"type":28,"value":223},"add_messages",{"type":28,"value":225},"，新消息进来按规则追加合并，不会把上一轮的对话盖掉。而且 LangGraph 对这件事很严格：如果两个并行节点在同一轮里修改了同一个字段，你又没给这个字段配 reducer，运行时会直接报错，逼着你把合并规则写明确。",{"type":23,"tag":76,"props":227,"children":229},{"id":228},"_3-回合制同步spark-stage-starrocks-屏障-pregel-超步",[230],{"type":28,"value":231},"3. 回合制同步：Spark Stage \u002F StarRocks 屏障 → Pregel 超步",{"type":23,"tag":24,"props":233,"children":234},{},[235,237,242],{"type":28,"value":236},"为了防止并行节点你改你的、我改我的把状态写乱，分布式计算里有一套经典的 ",{"type":23,"tag":86,"props":238,"children":239},{},[240],{"type":28,"value":241},"BSP（整体同步并行）",{"type":28,"value":243}," 思路：把计算切成一个个回合，本回合里所有并行任务都跑完，过一道屏障统一汇总，再进下一回合。Spark 切分 Stage 时的阶段屏障、StarRocks 里各 Fragment 之间的同步屏障，走的都是这条路。",{"type":23,"tag":24,"props":245,"children":246},{},[247,249,254,256,262,264,270,272,278,280,286],{"type":28,"value":248},"LangGraph 底层用的 ",{"type":23,"tag":86,"props":250,"children":251},{},[252],{"type":28,"value":253},"Pregel 超步（Superstep）",{"type":28,"value":255}," 就是这套回合制模型。每一轮把当前被激活的节点跑完，等它们全部交卷，再统一把输出合并到状态里，触发下一轮节点。为了防止图里有环导致无限循环，总步数受 ",{"type":23,"tag":99,"props":257,"children":259},{"className":258},[],[260],{"type":28,"value":261},"recursion_limit",{"type":28,"value":263}," 约束，在 ",{"type":23,"tag":99,"props":265,"children":267},{"className":266},[],[268],{"type":28,"value":269},"libs\u002Flanggraph\u002Flanggraph\u002F_internal\u002F_config.py",{"type":28,"value":271}," 里 ",{"type":23,"tag":99,"props":273,"children":275},{"className":274},[],[276],{"type":28,"value":277},"DEFAULT_RECURSION_LIMIT",{"type":28,"value":279}," 默认是 ",{"type":23,"tag":99,"props":281,"children":283},{"className":282},[],[284],{"type":28,"value":285},"10007",{"type":28,"value":287},"。",{"type":23,"tag":76,"props":289,"children":291},{"id":290},"_4-先写流水账再提交hbase-wal-pending-writes",[292],{"type":28,"value":293},"4. 先写流水账再提交：HBase WAL → pending writes",{"type":23,"tag":24,"props":295,"children":296},{},[297,299,304],{"type":28,"value":298},"存储系统里，HBase 收到写入后不会直接只改内存里的 MemStore，而是先记一份 ",{"type":23,"tag":86,"props":300,"children":301},{},[302],{"type":28,"value":303},"WAL（预写日志）",{"type":28,"value":305},"，防止机器中途断电丢数据。",{"type":23,"tag":24,"props":307,"children":308},{},[309,311,316],{"type":28,"value":310},"LangGraph 在单个超步里也是这个路子：某个节点跑完产出状态更新时，并不会立刻改写全局状态，而是先作为 ",{"type":23,"tag":86,"props":312,"children":313},{},[314],{"type":28,"value":315},"pending writes（待提交写入）",{"type":28,"value":317}," 暂存下来。等到这一个超步所有节点都跑完，再统一按 reducer 合并提交。这样就算超步里某个节点失败重试，已经跑完的节点写入有迹可循，不会把状态留成一半新一半旧。",{"type":23,"tag":76,"props":319,"children":321},{"id":320},"_5-显式状态机与停点hudi-instant-状态机-interrupt-resume",[322],{"type":28,"value":323},"5. 显式状态机与停点：Hudi instant 状态机 → interrupt \u002F resume",{"type":23,"tag":24,"props":325,"children":326},{},[327,329,335],{"type":28,"value":328},"写数据湖时，Hudi 的每笔操作（instant）都要显式走完 ",{"type":23,"tag":99,"props":330,"children":332},{"className":331},[],[333],{"type":28,"value":334},"REQUESTED → INFLIGHT → COMPLETED",{"type":28,"value":336}," 三个状态，做到哪一步、卡在哪一步都写在时间线上，随时能接续或回滚。",{"type":23,"tag":24,"props":338,"children":339},{},[340,342,348,350,356,358,364],{"type":28,"value":341},"Agent 碰到高风险写操作（比如改表草案、跑沙箱、发外部通知）时，必须停下来等人工签字。LangGraph 提供的 ",{"type":23,"tag":99,"props":343,"children":345},{"className":344},[],[346],{"type":28,"value":347},"interrupt",{"type":28,"value":349},"（或在图编译时用 ",{"type":23,"tag":99,"props":351,"children":353},{"className":352},[],[354],{"type":28,"value":355},"interrupt_before",{"type":28,"value":357}," 指定停点）就是把暂停做成显式状态：运行到这里先存档停住，不需要后台线程空占着等；等人在界面上点完批准，外部用 ",{"type":23,"tag":99,"props":359,"children":361},{"className":360},[],[362],{"type":28,"value":363},"Command(resume=...)",{"type":28,"value":365}," 把决定送回来，引擎直接从断点接着往下一轮跑。",{"type":23,"tag":24,"props":367,"children":368},{},[369],{"type":28,"value":370},"把上面四五套机制串进一轮真实的执行里，就是下面这条链路：",{"type":23,"tag":24,"props":372,"children":373},{},[374],{"type":23,"tag":65,"props":375,"children":378},{"alt":376,"src":377},"一轮 Pregel 超步的执行流：本轮并行节点跑完后输出先暂存进 pending writes，全员通过阶段屏障后按 reducer 合并，由 checkpointer 按 thread_id 拍快照，遇到 interrupt 则显式停住等 Command(resume=...) 恢复","\u002Fimages\u002Fblog\u002Fdata-systems-in-ai-agents\u002Fpregel-superstep-wal.svg",[],{"type":23,"tag":50,"props":380,"children":382},{"id":381},"spring-boot-里也藏着同款套路",[383],{"type":28,"value":384},"Spring Boot 里也藏着同款套路",{"type":23,"tag":24,"props":386,"children":387},{},[388],{"type":28,"value":389},"做 Java 后端的人天天跟 Spring Boot 打交道。把 Spring Boot 源码和 LangChain、Hudi、LangGraph 放一起看，同样能对上四组熟面孔。",{"type":23,"tag":24,"props":391,"children":392},{},[393],{"type":23,"tag":65,"props":394,"children":397},{"alt":395,"src":396},"Spring Boot 与 LangChain、Hudi、LangGraph 的四组同款套路：AOP 与 Web 拦截器链对应 LangChain 中间件洋葱模型；SpringApplication 启动事件对应 LangChain Callbacks；Environment 多配置源优先级对应 Hudi 同主键合并语义；BeanDefinition 图纸登记对应 StateGraph 编译成 Pregel","\u002Fimages\u002Fblog\u002Fdata-systems-in-ai-agents\u002Fspring-langchain-twins.svg",[],{"type":23,"tag":399,"props":400,"children":401},"ul",{},[402,436,461,479],{"type":23,"tag":403,"props":404,"children":405},"li",{},[406,411,413,419,421,427,429,434],{"type":23,"tag":86,"props":407,"children":408},{},[409],{"type":28,"value":410},"横切能力怎么挂",{"type":28,"value":412},"：Spring 里一个业务方法外面套着事务、缓存、重试的 AOP 代理链，Web 层还有 ",{"type":23,"tag":99,"props":414,"children":416},{"className":415},[],[417],{"type":28,"value":418},"HandlerInterceptor",{"type":28,"value":420},"；到了 LangChain 的 ",{"type":23,"tag":99,"props":422,"children":424},{"className":423},[],[425],{"type":28,"value":426},"create_agent",{"type":28,"value":428},"，重试、脱敏、日志、人工审批同样做成一层套一层的 ",{"type":23,"tag":86,"props":430,"children":431},{},[432],{"type":28,"value":433},"中间件（洋葱模型）",{"type":28,"value":435},"，核心模型调用包在最里面。",{"type":23,"tag":403,"props":437,"children":438},{},[439,444,446,452,454,459],{"type":23,"tag":86,"props":440,"children":441},{},[442],{"type":28,"value":443},"流程进展怎么通知",{"type":28,"value":445},"：",{"type":23,"tag":99,"props":447,"children":449},{"className":448},[],[450],{"type":28,"value":451},"SpringApplication",{"type":28,"value":453}," 启动每走一步就向外广播事件，哪个监听器关心哪一步自己接；LangChain 的 ",{"type":23,"tag":86,"props":455,"children":456},{},[457],{"type":28,"value":458},"Callbacks",{"type":28,"value":460}," 一样，主流程只管在模型调用、工具执行前后发事件，追踪（Tracing）、计费和前端流式推送各自订阅，不用把观察逻辑硬塞进业务节点里。",{"type":23,"tag":403,"props":462,"children":463},{},[464,469,471,477],{"type":23,"tag":86,"props":465,"children":466},{},[467],{"type":28,"value":468},"同名键多份值听谁的",{"type":28,"value":470},"：Spring 的 ",{"type":23,"tag":99,"props":472,"children":474},{"className":473},[],[475],{"type":28,"value":476},"Environment",{"type":28,"value":478}," 把命令行参数、环境变量、配置文件排好优先级，查同一个 key 时按顺序裁决；Hudi 面对同一个主键发来的多条变更记录，靠预合并字段和合并语义裁决保留哪一份。",{"type":23,"tag":403,"props":480,"children":481},{},[482,487,489,495,497,503,505,511,513,519],{"type":23,"tag":86,"props":483,"children":484},{},[485],{"type":28,"value":486},"先建图纸再开工",{"type":28,"value":488},"：Spring IoC 容器在 ",{"type":23,"tag":99,"props":490,"children":492},{"className":491},[],[493],{"type":28,"value":494},"refresh",{"type":28,"value":496}," 时先扫描登记所有 ",{"type":23,"tag":99,"props":498,"children":500},{"className":499},[],[501],{"type":28,"value":502},"BeanDefinition",{"type":28,"value":504},"（图纸），检查完依赖关系再统一实例化；LangGraph 也是先声明 ",{"type":23,"tag":99,"props":506,"children":508},{"className":507},[],[509],{"type":28,"value":510},"StateGraph",{"type":28,"value":512}," 的节点和边，编译（compile）成可执行的 ",{"type":23,"tag":99,"props":514,"children":516},{"className":515},[],[517],{"type":28,"value":518},"Pregel",{"type":28,"value":520}," 运行时再跑。",{"type":23,"tag":50,"props":522,"children":524},{"id":523},"_15-个框架对照速查",[525],{"type":28,"value":526},"15 个框架对照速查",{"type":23,"tag":24,"props":528,"children":529},{},[530],{"type":28,"value":531},"这一批拆过的 15 个框架里，直接能和 Agent 运行时对上号的主要是下面 10 个（其余 ClickHouse、Hologres、Hadoop、Kafka、Elasticsearch 主要落在列存、索引、日志解耦等底层存储与消息思想上，不在这篇展开）：",{"type":23,"tag":533,"props":534,"children":535},"table",{},[536,560],{"type":23,"tag":537,"props":538,"children":539},"thead",{},[540],{"type":23,"tag":541,"props":542,"children":543},"tr",{},[544,550,555],{"type":23,"tag":545,"props":546,"children":547},"th",{},[548],{"type":28,"value":549},"框架",{"type":23,"tag":545,"props":551,"children":552},{},[553],{"type":28,"value":554},"常见机制",{"type":23,"tag":545,"props":556,"children":557},{},[558],{"type":28,"value":559},"Agent 框架里的对应",{"type":23,"tag":561,"props":562,"children":563},"tbody",{},[564,590,615,658,676,693,718,754,795,813],{"type":23,"tag":541,"props":565,"children":566},{},[567,573,578],{"type":23,"tag":568,"props":569,"children":570},"td",{},[571],{"type":28,"value":572},"Iceberg",{"type":23,"tag":568,"props":574,"children":575},{},[576],{"type":28,"value":577},"提交快照 + 时间旅行",{"type":23,"tag":568,"props":579,"children":580},{},[581,583,588],{"type":28,"value":582},"LangGraph ",{"type":23,"tag":99,"props":584,"children":586},{"className":585},[],[587],{"type":28,"value":104},{"type":28,"value":589}," 与状态历史，可分叉重跑",{"type":23,"tag":541,"props":591,"children":592},{},[593,598,603],{"type":23,"tag":568,"props":594,"children":595},{},[596],{"type":28,"value":597},"Flink",{"type":23,"tag":568,"props":599,"children":600},{},[601],{"type":28,"value":602},"周期性全站 checkpoint",{"type":23,"tag":568,"props":604,"children":605},{},[606,608,613],{"type":28,"value":607},"LangGraph 每超步按 ",{"type":23,"tag":99,"props":609,"children":611},{"className":610},[],[612],{"type":28,"value":112},{"type":28,"value":614}," 存档",{"type":23,"tag":541,"props":616,"children":617},{},[618,623,647],{"type":23,"tag":568,"props":619,"children":620},{},[621],{"type":28,"value":622},"Paimon",{"type":23,"tag":568,"props":624,"children":625},{},[626,631,633,638,640,645],{"type":23,"tag":99,"props":627,"children":629},{"className":628},[],[630],{"type":28,"value":179},{"type":28,"value":632},"（",{"type":23,"tag":99,"props":634,"children":636},{"className":635},[],[637],{"type":28,"value":195},{"type":28,"value":639}," \u002F ",{"type":23,"tag":99,"props":641,"children":643},{"className":642},[],[644],{"type":28,"value":203},{"type":28,"value":646},"）",{"type":23,"tag":568,"props":648,"children":649},{},[650,652],{"type":28,"value":651},"LangGraph State 字段 ",{"type":23,"tag":99,"props":653,"children":655},{"className":654},[],[656],{"type":28,"value":657},"reducer",{"type":23,"tag":541,"props":659,"children":660},{},[661,666,671],{"type":23,"tag":568,"props":662,"children":663},{},[664],{"type":28,"value":665},"Spark",{"type":23,"tag":568,"props":667,"children":668},{},[669],{"type":28,"value":670},"Stage 阶段屏障（BSP 回合制）",{"type":23,"tag":568,"props":672,"children":673},{},[674],{"type":28,"value":675},"LangGraph Pregel 超步",{"type":23,"tag":541,"props":677,"children":678},{},[679,684,689],{"type":23,"tag":568,"props":680,"children":681},{},[682],{"type":28,"value":683},"StarRocks",{"type":23,"tag":568,"props":685,"children":686},{},[687],{"type":28,"value":688},"MPP Fragment 阶段屏障",{"type":23,"tag":568,"props":690,"children":691},{},[692],{"type":28,"value":675},{"type":23,"tag":541,"props":694,"children":695},{},[696,701,706],{"type":23,"tag":568,"props":697,"children":698},{},[699],{"type":28,"value":700},"HBase",{"type":23,"tag":568,"props":702,"children":703},{},[704],{"type":28,"value":705},"先写 WAL 再写 MemStore",{"type":23,"tag":568,"props":707,"children":708},{},[709,710,716],{"type":28,"value":582},{"type":23,"tag":99,"props":711,"children":713},{"className":712},[],[714],{"type":28,"value":715},"pending writes",{"type":28,"value":717}," 暂存与超步提交",{"type":23,"tag":541,"props":719,"children":720},{},[721,726,737],{"type":23,"tag":568,"props":722,"children":723},{},[724],{"type":28,"value":725},"Hudi",{"type":23,"tag":568,"props":727,"children":728},{},[729,735],{"type":23,"tag":99,"props":730,"children":732},{"className":731},[],[733],{"type":28,"value":734},"instant",{"type":28,"value":736}," 状态机；同主键合并语义",{"type":23,"tag":568,"props":738,"children":739},{},[740,745,746,752],{"type":23,"tag":99,"props":741,"children":743},{"className":742},[],[744],{"type":28,"value":347},{"type":28,"value":639},{"type":23,"tag":99,"props":747,"children":749},{"className":748},[],[750],{"type":28,"value":751},"resume",{"type":28,"value":753},"；合并语义亦同款 Spring 配置优先级",{"type":23,"tag":541,"props":755,"children":756},{},[757,761,771],{"type":23,"tag":568,"props":758,"children":759},{},[760],{"type":28,"value":18},{"type":23,"tag":568,"props":762,"children":763},{},[764,766],{"type":28,"value":765},"拦截器链、启动事件、配置优先级、",{"type":23,"tag":99,"props":767,"children":769},{"className":768},[],[770],{"type":28,"value":502},{"type":23,"tag":568,"props":772,"children":773},{},[774,776,781,783,788,790],{"type":28,"value":775},"LangChain 中间件、",{"type":23,"tag":99,"props":777,"children":779},{"className":778},[],[780],{"type":28,"value":458},{"type":28,"value":782},"；",{"type":23,"tag":99,"props":784,"children":786},{"className":785},[],[787],{"type":28,"value":510},{"type":28,"value":789}," 编译成 ",{"type":23,"tag":99,"props":791,"children":793},{"className":792},[],[794],{"type":28,"value":518},{"type":23,"tag":541,"props":796,"children":797},{},[798,803,808],{"type":23,"tag":568,"props":799,"children":800},{},[801],{"type":28,"value":802},"LangChain",{"type":23,"tag":568,"props":804,"children":805},{},[806],{"type":28,"value":807},"Agent 应用层：中间件、Callbacks",{"type":23,"tag":568,"props":809,"children":810},{},[811],{"type":28,"value":812},"—",{"type":23,"tag":541,"props":814,"children":815},{},[816,820,825],{"type":23,"tag":568,"props":817,"children":818},{},[819],{"type":28,"value":16},{"type":23,"tag":568,"props":821,"children":822},{},[823],{"type":28,"value":824},"Agent 运行时：checkpoint、reducer、超步、pending writes、interrupt",{"type":23,"tag":568,"props":826,"children":827},{},[828],{"type":28,"value":812},{"type":23,"tag":50,"props":830,"children":832},{"id":831},"写-agent-时怎么借这些经验又别在哪用歪",[833],{"type":28,"value":834},"写 Agent 时怎么借这些经验，又别在哪用歪",{"type":23,"tag":24,"props":836,"children":837},{},[838],{"type":28,"value":839},"落地自己的 Agent 系统时，这些对应关系可以直接省掉不少踩坑：",{"type":23,"tag":399,"props":841,"children":842},{},[843,874],{"type":23,"tag":403,"props":844,"children":845},{},[846,851,853,858,860,865,867,872],{"type":23,"tag":86,"props":847,"children":848},{},[849],{"type":28,"value":850},"先定状态和合并规则，再写 Prompt",{"type":28,"value":852},"：只要某个状态字段会被多个节点或子代理更新，动笔前就先把它的 ",{"type":23,"tag":99,"props":854,"children":856},{"className":855},[],[857],{"type":28,"value":657},{"type":28,"value":859}," 定死，就像建湖表前先选好主键和合并引擎；长流程一律挂 ",{"type":23,"tag":99,"props":861,"children":863},{"className":862},[],[864],{"type":28,"value":104},{"type":28,"value":866},"，涉及写动作或外部调用的节点直接用 ",{"type":23,"tag":99,"props":868,"children":870},{"className":869},[],[871],{"type":28,"value":347},{"type":28,"value":873}," 停下来走审批。",{"type":23,"tag":403,"props":875,"children":876},{},[877,882],{"type":23,"tag":86,"props":878,"children":879},{},[880],{"type":28,"value":881},"横切治理放中间件，别往每个节点里贴代码",{"type":28,"value":883},"：超时熔断、凭据脱敏、审计日志、人工确认拦截这类能力，照着 Spring 拦截器链的方式包在工具网关或中间件层，节点本身只干业务活。",{"type":23,"tag":24,"props":885,"children":886},{},[887],{"type":28,"value":888},"同时也有三个地方不能把类比当硬真理：",{"type":23,"tag":890,"props":891,"children":892},"ol",{},[893,903,913],{"type":23,"tag":403,"props":894,"children":895},{},[896,901],{"type":23,"tag":86,"props":897,"children":898},{},[899],{"type":28,"value":900},"thread 快照不等于表数据版本",{"type":28,"value":902},"：LangGraph 的 checkpoint 存的是单次会话线程的内存状态快照，不是像 Iceberg 那样管理海量数据文件版本，别把大体积表数据直接塞进 State 里跟着每一轮序列化。",{"type":23,"tag":403,"props":904,"children":905},{},[906,911],{"type":23,"tag":86,"props":907,"children":908},{},[909],{"type":28,"value":910},"回合制有木桶效应",{"type":28,"value":912},"：Pregel 超步和 Spark Stage 一样，一轮里所有并行节点都跑完才能进下一轮。只要有一个工具调用卡了 30 秒，整轮状态合并就得干等它，超时控制必须下沉到单个工具里。",{"type":23,"tag":403,"props":914,"children":915},{},[916,921],{"type":23,"tag":86,"props":917,"children":918},{},[919],{"type":28,"value":920},"并行写不配 reducer 会直接炸",{"type":28,"value":922},"：设计并行分支时，宁可多花两分钟核对每个输出字段的归属和合并策略，别等联调时才看到并发写入冲突报错。",{"title":8,"searchDepth":924,"depth":924,"links":925},3,[926,934,935,936],{"id":52,"depth":927,"text":55,"children":928},2,[929,930,931,932,933],{"id":78,"depth":924,"text":81},{"id":157,"depth":924,"text":160},{"id":228,"depth":924,"text":231},{"id":290,"depth":924,"text":293},{"id":320,"depth":924,"text":323},{"id":381,"depth":927,"text":384},{"id":523,"depth":927,"text":526},{"id":831,"depth":927,"text":834},"markdown","content:blog:2026-11-29-data-systems-in-ai-agents.md","content","blog\u002F2026-11-29-data-systems-in-ai-agents.md","blog\u002F2026-11-29-data-systems-in-ai-agents","md",{"_path":944,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":945,"description":946,"date":947,"tags":948,"body":952,"_type":937,"_id":1496,"_source":939,"_file":1497,"_stem":1498,"_extension":942},"\u002Fblog\u002F2026-11-07-argus-architecture-illustrated","argus-quant 是怎么搭起来的：收盘后的一晚，和几处最难的地方","argus-quant 每天收盘后给全市场股票打分，第二天开盘前交出下单清单。这篇用七张图讲它分几层、一晚上跑什么，以及数据只有一个来源、信号买不到、滑点没校准、门槛被改、结果复现不了这几件事是怎么处理的。","2026-11-07",[949,950,14,951],"量化","回测","数据质量",{"type":20,"children":953,"toc":1485},[954,969,974,980,991,999,1004,1009,1014,1019,1024,1029,1034,1039,1044,1049,1057,1062,1067,1072,1077,1095,1100,1105,1110,1115,1123,1128,1165,1170,1175,1180,1185,1190,1196,1201,1206,1214,1219,1224,1229,1242,1247,1252,1264,1276,1287,1293,1298,1303,1311,1316,1321,1326,1331,1336,1342,1347,1352,1360,1365,1378,1383,1388,1393,1398,1403,1409,1414,1419,1427,1432,1437,1442,1447,1452,1480],{"type":23,"tag":24,"props":955,"children":956},{},[957,959,967],{"type":28,"value":958},"argus-quant 是我 2026 年 7 月开始做的 A 股日频选股研究与回测系统。它每天收盘后用模型给全市场的股票打分，我想回答的问题是：按分数买一小篮子股票，拿几天卖掉，扣完成本能不能跑赢市场。仓库不公开，线上入口 ",{"type":23,"tag":41,"props":960,"children":964},{"href":961,"rel":962},"https:\u002F\u002Fargus-quant.cn",[963],"nofollow",[965],{"type":28,"value":966},"argus-quant.cn",{"type":28,"value":968}," 需要登录。",{"type":23,"tag":24,"props":970,"children":971},{},[972],{"type":28,"value":973},"前面写过三篇，各讲一个具体问题。这次换个写法，用图把整个系统讲一遍，三篇里讲过的只简单带过，链接过去。",{"type":23,"tag":50,"props":975,"children":977},{"id":976},"分了几层谁调谁",[978],{"type":28,"value":979},"分了几层，谁调谁",{"type":23,"tag":24,"props":981,"children":982},{},[983,989],{"type":23,"tag":41,"props":984,"children":986},{"href":985},"\u002Fprojects\u002Fargus-quant\u002F",[987],{"type":28,"value":988},"项目页",{"type":28,"value":990},"那张主链路图是按数据流画的。这张换个角度，画谁调用谁、谁管着谁：",{"type":23,"tag":24,"props":992,"children":993},{},[994],{"type":23,"tag":65,"props":995,"children":998},{"alt":996,"src":997},"argus-quant 的分层与调用关系：左列 L0 数据、L1 因子、L2 组合与模型；L2 同时喂给 L3 回测撮合和 L5 每日信号；L3 之后是 L4 研究守卫和 L6 生命周期，L6 决定哪些策略能出信号；底座是 PostgreSQL","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Flayers.svg",[],{"type":23,"tag":24,"props":1000,"children":1001},{},[1002],{"type":28,"value":1003},"左边一列是数据往上走的路。L0 存行情和财务数据，按时点存储，也就是每条数据都记着它从哪天起才能被看到。L1 把原始数据算成因子，因子就是从行情、财务里算出来、用来给股票排序的指标。L2 用 LightGBM 把因子合成一个分数，再按分数定每只票该买多少，也就是目标权重。",{"type":23,"tag":24,"props":1005,"children":1006},{},[1007],{"type":28,"value":1008},"L2 的结果分两路用。一路进 L3 回测，拿历史数据逐日模拟买卖；一路进 L5，每天收盘后出第二天的下单清单，我照着清单人工下单，成交再导回来校准滑点。L4 管研究纪律，L6 管策略从研究到实盘的晋升和退役，决定哪些策略有资格出信号。图上标蓝的 L3、L4、L6 三层是自研的重点。",{"type":23,"tag":24,"props":1010,"children":1011},{},[1012],{"type":28,"value":1013},"有几个设计上的取舍，先在这里说清楚。",{"type":23,"tag":24,"props":1015,"children":1016},{},[1017],{"type":28,"value":1018},"第一个是回测和每日信号共用一份「打分 → 目标权重」代码。L3 和 L5 都从 L2 的同一个模块导入这个函数，不许各写一份，另有测试断言两条路径在同一输入上产出逐位相同的目标权重。要是各写一份，两边悄悄改出了差别，得等模拟盘跑满 60 个交易日、拿模拟和回测一对比才发现，中间隔好几个月。现在提交代码那一刻测试就会红。",{"type":23,"tag":24,"props":1020,"children":1021},{},[1022],{"type":28,"value":1023},"第二个是研究和生产走两条数据通道。研究时读样本外和留出集要扣预算，后面会讲。可策略一旦进了模拟盘，每天出信号必然要读最近的数据，而最近的数据正好落在留出集的时间范围里。所以生产通道单独开：不计预算，只有处在模拟盘及以上状态的策略能用，研究阶段的代码调它直接报错。两条通道的每次访问都记审计。",{"type":23,"tag":24,"props":1025,"children":1026},{},[1027],{"type":28,"value":1028},"第三个是正式产物原则上只写 PostgreSQL。因子值、回测账本、信号、净值、配置版本都写数据库，库上装了 TimescaleDB 扩展，它给 PostgreSQL 加上时间序列表的能力。DuckDB 只许在进程内存里算，不许落成文件；CSV、Parquet 也不能当正式发布物。例外是体量太大的训练特征矩阵，单独写了一篇 ADR（架构决策记录）豁免它落成文件，但它的治理和审计记录仍然在库里。这么做是为了只有一个事实源：一个数是用哪个数据快照、哪版代码算出来的，查库就能回答。",{"type":23,"tag":24,"props":1030,"children":1031},{},[1032],{"type":28,"value":1033},"第四个是因子引擎只借 qlib 的一小块。qlib 是微软开源的量化研究框架，我只用它的表达式解析和算子；数据通过自己写的 Provider 从 PostgreSQL 的封存快照里读，不用它的数据格式、缓存和回测。采用之前先做了 3 天验证，通过标准在验证开始前写死，三条都过了才用。",{"type":23,"tag":24,"props":1035,"children":1036},{},[1037],{"type":28,"value":1038},"最后是 Web 和跑批分开。前端 Vue 3 + ECharts，后端 FastAPI。Web 侧的定时任务用 APScheduler，每次运行写进数据库的任务台账，前端轮询台账看进度，没用消息队列和 WebSocket。小时级的跑批不放进 API 进程，由 systemd timer 单独拉起：跑批要是内存爆了，被杀的不能是正在提供服务的进程。生产上数据库、Web 服务和跑批计算分开部署，告警发飞书。",{"type":23,"tag":50,"props":1040,"children":1042},{"id":1041},"收盘后的一晚",[1043],{"type":28,"value":1041},{"type":23,"tag":24,"props":1045,"children":1046},{},[1047],{"type":28,"value":1048},"T 日是出信号的那个交易日，T+1 是下一个交易日。从 T 日收盘到 T+1 开盘，系统要跑这些：",{"type":23,"tag":24,"props":1050,"children":1051},{},[1052],{"type":23,"tag":65,"props":1053,"children":1056},{"alt":1054,"src":1055},"收盘后一晚上的调度：15:00 收盘，16:05 抓第二来源快照，17:00 主源日线链，17:25 两源逐字对账，18:30 数据族日更，19:00 数据集流水线，21:05 起尝试出信号直到次日清晨，07:45 看门狗，09:15 人工下单","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Fdaily-timeline.svg",[],{"type":23,"tag":24,"props":1058,"children":1059},{},[1060],{"type":28,"value":1061},"这张时间表是一点点改出来的。最早的版本是到点就跑，问题出在上游的发布时间会漂。日线链原来 15:30 触发，触发时数据要是还没发布，当天就是永久缺口，曾经连断 4 个交易日，没有任何自动恢复。现在主槽改到 17:00，没成功就每半小时补一次。补跑原本 20:00 截止。10 月 26 日上游 DNS 从 17:00 抖到 19:43，六次全失败；19:43 其实已经恢复了，可 20:00 以后没有补跑槽，当天只能半夜手工补。之后补跑延到 23:30。",{"type":23,"tag":24,"props":1063,"children":1064},{},[1065],{"type":28,"value":1066},"信号出得更晚。模型要等上游数据补齐，最早 20:30 以后才可能出来，9 月初那几天实测落在 21:10、21:27、次日 01:18、次日 04:11。所以出信号的尝试从 21:05 开始；跨过零点以后日期已经变了，改成补「前一交易日」；07:10 最后兜底一次，07:45 还没有就告警，赶在 09:15 集合竞价之前。集合竞价是开盘前撮合出开盘价的那段时间，我在这时按清单下单。",{"type":23,"tag":24,"props":1068,"children":1069},{},[1070],{"type":28,"value":1071},"「今天这一步跑成没有」，看的是数据库任务台账里当天有没有一条成功记录，不看进程里的重试计数器。容器一重启，内存里的计数就没了。",{"type":23,"tag":24,"props":1073,"children":1074},{},[1075],{"type":28,"value":1076},"比任务失败更难对付的，是任务报了成功、数据却没往前走。系统里出过好几次：",{"type":23,"tag":399,"props":1078,"children":1079},{},[1080,1085,1090],{"type":23,"tag":403,"props":1081,"children":1082},{},[1083],{"type":28,"value":1084},"任务判成功，实际拉到 0 行，连绿三天；",{"type":23,"tag":403,"props":1086,"children":1087},{},[1088],{"type":28,"value":1089},"66 次成功里 62 次是回填历史，当天的调度一次也没成功过；",{"type":23,"tag":403,"props":1091,"children":1092},{},[1093],{"type":28,"value":1094},"一个刷新因子 IC 的任务每天产出 0 项，照样报成功，绿了 25 天。IC 是因子值和之后实际收益的相关系数，用来看一个因子还灵不灵。",{"type":23,"tag":24,"props":1096,"children":1097},{},[1098],{"type":28,"value":1099},"后来定了几条规矩。监控先看各张表的最新交易日，再看任务状态。零行结果默认判失败，非交易日这种本来就该是零行的情况，要显式列进白名单。「产出 0 项 + 成功」这个组合禁止出现，除非同时证明今天本来就没东西可产。当天调度和回填在台账里分开记。流水线每一段的闸门失败一律不重试：闸门反映的是数据或代码的状态，重试改变不了状态，只会把红灯耗成碰巧的绿灯。",{"type":23,"tag":50,"props":1101,"children":1103},{"id":1102},"数据只有一个来源",[1104],{"type":28,"value":1102},{"type":23,"tag":24,"props":1106,"children":1107},{},[1108],{"type":28,"value":1109},"日线、复权因子、涨跌停价都来自一个主数据源。复权因子是一个乘数，用来把分红、送股前后的价格接成一条连续的线，算收益离不开它。出过的事故都是「格式对、值错」：一个因子接口整天返回重复数据，公告的覆盖量悄悄减半，官方通道静默返回空表。另外主源一旦断供，17:00 的日线链补到截止也没有后手，第二天就没有因子、没有信号。",{"type":23,"tag":24,"props":1111,"children":1112},{},[1113],{"type":28,"value":1114},"我想找个第二来源。能用的免费来源，最后只剩腾讯、新浪的公开行情页，其他几家实测要么缺成交额、前收这些字段，要么接口不稳，几个请求就被封或者干脆连不上。前收就是交易所给出的前一日收盘参考价，除权那天会调整。腾讯、新浪这两家的单位和精度又各不相同。更麻烦的是，原始行情表只追加，写进去的行没有回收路径，补错一天就永远错在那里。",{"type":23,"tag":24,"props":1116,"children":1117},{},[1118],{"type":23,"tag":65,"props":1119,"children":1122},{"alt":1120,"src":1121},"双源逐字对账、只追加存储和断供回退：主源进 bar_daily，第二来源进影子表，17:25 逐字对账；对账记录决定主源断供时能不能用影子行补一天，四条条件同时成立才写","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Fdual-source.svg",[],{"type":23,"tag":24,"props":1124,"children":1125},{},[1126],{"type":28,"value":1127},"第二来源平时只做对账；要拿它补数，先得攒够 30 个交易日的对账记录。",{"type":23,"tag":24,"props":1129,"children":1130},{},[1131,1133,1139,1141,1147,1149,1155,1157,1163],{"type":28,"value":1132},"存储这头，",{"type":23,"tag":99,"props":1134,"children":1136},{"className":1135},[],[1137],{"type":28,"value":1138},"bar_daily",{"type":28,"value":1140}," 只能经一个窄写入口插入，",{"type":23,"tag":99,"props":1142,"children":1144},{"className":1143},[],[1145],{"type":28,"value":1146},"UPDATE",{"type":28,"value":1148}," 和 ",{"type":23,"tag":99,"props":1150,"children":1152},{"className":1151},[],[1153],{"type":28,"value":1154},"DELETE",{"type":28,"value":1156}," 由触发器拒绝；重复写入是 ",{"type":23,"tag":99,"props":1158,"children":1160},{"className":1159},[],[1161],{"type":28,"value":1162},"ON CONFLICT DO NOTHING",{"type":28,"value":1164},"，所以任何一步重跑都幂等。",{"type":23,"tag":24,"props":1166,"children":1167},{},[1168],{"type":28,"value":1169},"对账这头，每天 16:05 把两家的全市场快照写进影子表，17:25 和主源逐字比：开高低收、前收、成交额要逐字相等，成交量差不超过 1 手。比的是相等率，不看均值差，「没取到」和「不相等」分开计数。相等率 ≥ 0.995 判绿；定下的规则是两家同时红才阻断，只有一家红只告警。",{"type":23,"tag":24,"props":1171,"children":1172},{},[1173],{"type":28,"value":1174},"真到主源断供、要拿影子行补数的时候，难点在复权因子：影子行里没有，只能推。今天的因子 = 昨天的因子 × 昨收 ÷ 今天的前收。这条式子每天都在对账里被单独验证。非除权日，也就是前收和昨收相差不到 0.005 元时，直接沿用昨天的因子，不做这次除法：在本该恒等的地方做浮点除法，会引入万分之一量级的漂移，而复权因子是后复权价的乘数，这点漂移会一路传进收益标签。准入门比日常判据严一档，0.999 对 0.995，因为后果不对称：日常判负只是记一条红色记录，回退写入会永久改变事实表。",{"type":23,"tag":24,"props":1176,"children":1177},{},[1178],{"type":28,"value":1179},"写错了也不改。推不出复权因子的股票整只跳过并报出代码，不拿 0 或收盘价顶替。主源恢复后再拉一次官方数据，只在内存里和已写入的行逐字比，不一致也不改数，纠正必须走 Issue 和新的 ADR。",{"type":23,"tag":24,"props":1181,"children":1182},{},[1183],{"type":28,"value":1184},"对账第一次跑，腾讯的逐字相等率只有 43.00%。查下来红的是我们自己的口径：腾讯科创板的成交量单位是股不是手，成交额是整数元。按板块核对，科创板 615 只全是这种情况，创业板 936 只一只都不是。复权因子那条自洽检查，首跑 5546 只全过。",{"type":23,"tag":24,"props":1186,"children":1187},{},[1188],{"type":28,"value":1189},"还有一处没解决。日常判据 0.995 和准入门 0.999 差 5 倍：可比 5549 只时，日常允许 27 条不等，准入门只允许 5 条。北交所有一批股票，两家第二来源给的量额一致、主源偏低，到 9 月 10 日已经占掉 3 条余量，而当日对账照样判绿，不会告警。对账天天绿，准入门的连续计数却可能根本没在往前走。这件事还挂在待决清单上。",{"type":23,"tag":50,"props":1191,"children":1193},{"id":1192},"信号算出来了不一定买得到",[1194],{"type":28,"value":1195},"信号算出来了，不一定买得到",{"type":23,"tag":24,"props":1197,"children":1198},{},[1199],{"type":28,"value":1200},"信号 T 日收盘后才算出来，最早 T+1 开盘成交。中间隔着 A 股的一堆制度：T+1（当天买的第二天才能卖）、涨跌停、停牌、整手、退市整理。",{"type":23,"tag":24,"props":1202,"children":1203},{},[1204],{"type":28,"value":1205},"这些规则哪条不处理都不会报错，只会让曲线更好看。涨跌停幅度还随板块和日期变：主板 10%，ST 5%，创业板和科创板 2020 年后 20%，北交所 30%，新股另有规则，所以涨跌停价必须从数据源摄取，不能用前收 × 1.1 推算。规则之间也互相牵连：跌停卖不出，持仓就延续到第二天，第二天还得接着卖。",{"type":23,"tag":24,"props":1207,"children":1208},{},[1209],{"type":23,"tag":65,"props":1210,"children":1213},{"alt":1211,"src":1212},"回测里一张单子的撮合判断：依次检查停牌或缺证据、买单开盘涨停、卖单开盘跌停、T+1 锁定、当日买卖合计超过 ADV20 的 5%，命中任一条就不成交或部分成交，都通过才按整手规则成交并扣成本","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Fmatching.svg",[],{"type":23,"tag":24,"props":1215,"children":1216},{},[1217],{"type":28,"value":1218},"一张单子从意图到成交，要依次过图里这几道关。撮合逐日模拟，成交价默认取 T+1 开盘价，禁止用信号日收盘价。13 条可交易规则只在一张表里定义，没成交的单子怎么处置也只在这张表里写，实盘的成交回填引用同一张表。倒数第二道关里的 ADV20，是这只票过去 20 个交易日的日均成交额。",{"type":23,"tag":24,"props":1220,"children":1221},{},[1222],{"type":28,"value":1223},"9 月加了「保守执行版 v2」，和旧版比改了几处：缺开盘价、涨跌停价这类证据，一律不成交，不拿冻结估值造报价；同一只股票当天的买卖合计共用 ADV20 的 5% 这个额度；进入退市整理期的股票从下一个交易日开始退出，跌停、停牌照样卖不出，不再像旧版那样强制全量成交。旧版冻结保留，用来复现历史结果，结果上标着「只能用于历史」，不能拿来签发新的准入。",{"type":23,"tag":24,"props":1225,"children":1226},{},[1227],{"type":28,"value":1228},"每条规则还有一个消融开关，给测试用：逐条关掉，断言影响的方向和量级。比如关掉涨停拦截，「完美预知未来」的策略夏普至少要翻一倍，否则说明这条规则没起作用。夏普比率是收益除以波动，表示每承担一份波动能换来多少收益。生产路径上有任何一条规则被关掉，直接抛异常。",{"type":23,"tag":24,"props":1230,"children":1231},{},[1232,1234,1240],{"type":28,"value":1233},"这些规则管不管用，",{"type":23,"tag":41,"props":1235,"children":1237},{"href":1236},"\u002Fblog\u002F2026-09-24-argus-cost-eats-returns\u002F",[1238],{"type":28,"value":1239},"成本那篇",{"type":28,"value":1241},"里有个现成的例子：一个两天换一次仓的模型，今年有 4.7% 的单子该卖那天封在跌停卖不出，这些单子平均又多亏 3.1 个百分点。不把跌停当回事，这部分亏损在回测里根本看不见。",{"type":23,"tag":50,"props":1243,"children":1245},{"id":1244},"回测骗人的三种方式",[1246],{"type":28,"value":1244},{"type":23,"tag":24,"props":1248,"children":1249},{},[1250],{"type":28,"value":1251},"这部分前面写了三篇，这里各用一段带过。",{"type":23,"tag":24,"props":1253,"children":1254},{},[1255,1257,1263],{"type":28,"value":1256},"第一种是未来函数：模拟某一天的决策时，用到了那一刻还不知道的信息。查出的四处都是早就在跑的代码，没有一处报错：收盘才到账的钱拿去买开盘的票；竞价表里存的其实是 09:30 那一分钟；判断在不在股票池，用了第二天的开盘价；补跑早几天的信号，用了后来才训出来的模型。详见",{"type":23,"tag":41,"props":1258,"children":1260},{"href":1259},"\u002Fblog\u002F2026-09-21-argus-lookahead-bias\u002F",[1261],{"type":28,"value":1262},"选股回测里查出的四处未来函数",{"type":28,"value":287},{"type":23,"tag":24,"props":1265,"children":1266},{},[1267,1269,1275],{"type":28,"value":1268},"第二种是同一段数据看太多次。数据按时间切成三段：样本内随便用；样本外是训练时没用过、留着检验的一段；留出集锁起来，最后确认时才看。样本外每个策略族最多看 20 次，超了直接抛异常，研究脚本跑不下去；留出集每族只能看 1 次，要一次性口令，全程审计。第一次看留出集，年化超额从样本外的 +25.6% 掉到 +3.8%。详见",{"type":23,"tag":41,"props":1270,"children":1272},{"href":1271},"\u002Fblog\u002F2026-09-22-argus-backtest-budget\u002F",[1273],{"type":28,"value":1274},"样本外数据要省着看",{"type":28,"value":287},{"type":23,"tag":24,"props":1277,"children":1278},{},[1279,1281,1286],{"type":28,"value":1280},"第三种是没算成本。同一批信号，纸面毛收益 +27.2%；扣掉佣金、印花税和滑点是 -6.9%；再算上跌停卖不出，是 -20.3%。买卖一次合计 36.7bp（1bp 是万分之一），八成多是滑点。滑点是想按某个价成交、实际成交价比它差的那一点。详见",{"type":23,"tag":41,"props":1282,"children":1283},{"href":1236},[1284],{"type":28,"value":1285},"回测毛收益 +27%，扣完成本变成 -20%",{"type":28,"value":287},{"type":23,"tag":50,"props":1288,"children":1290},{"id":1289},"滑点-15bp-只是一个假设",[1291],{"type":28,"value":1292},"滑点 15bp 只是一个假设",{"type":23,"tag":24,"props":1294,"children":1295},{},[1296],{"type":28,"value":1297},"买卖一次 36.7bp 的成本里，滑点占 30bp，用的是每边 15bp 的先验值。换手上限、成本预算全建在这个数上，它却没被真实成交验证过。",{"type":23,"tag":24,"props":1299,"children":1300},{},[1301],{"type":28,"value":1302},"能校准它的只有真实成交，而这个系统是人工下单，样本攒得很慢。设计时算过：10 万资金、8 只持仓、每月单边换手 60%，一年大约只有 58 笔成交，每个方向不到 30 笔。早先的设计要求每个方向 200 笔，等于永远达不到。反过来，样本一到 60 笔就上全特征模型，是 6 个左右的参数对 60 个观测，而且人工下单时机带来的波动可能比市场冲击本身还大，必然过拟合。",{"type":23,"tag":24,"props":1304,"children":1305},{},[1306],{"type":23,"tag":65,"props":1307,"children":1310},{"alt":1308,"src":1309},"滑点分级校准：不到 60 笔沿用每边 15bp 先验，60 到 200 笔只拟合买、卖各自的平均滑点，超过 200 笔才用 6 个左右参数的全特征模型，样本窗口 500 个交易日；下方说明 10 万资金、8 只持仓、月单边换手 60% 一年约 58 笔，还在用先验时小仓转满仓改判实际滑点每边小于 25bp","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Fslippage-tiers.svg",[],{"type":23,"tag":24,"props":1312,"children":1313},{},[1314],{"type":28,"value":1315},"所以校准分了级：成交不到 60 笔，沿用 15bp 先验；60 到 200 笔，只拟合买、卖两个方向各自的平均值；超过 200 笔才用全特征模型。样本窗口放到 500 个交易日。",{"type":23,"tag":24,"props":1317,"children":1318},{},[1319],{"type":28,"value":1320},"每次校准产生一个新版本，不改写任何历史回测；每次回测都记下用的是哪个滑点版本。设计上要求看板显式标出当前版本，还在用先验时醒目提示。成交数据靠导入券商成交明细、再人工确认，不手工逐笔录。一张下单意图可以对应 0 到多笔成交，部分成交、撤单都能表达。",{"type":23,"tag":24,"props":1322,"children":1323},{},[1324],{"type":28,"value":1325},"校准之前，晋升判据也得跟着换。小仓转满仓本来要求「实际滑点落在模型预测区间里」；还在用先验时，改判「实际滑点每边小于 25bp」。",{"type":23,"tag":24,"props":1327,"children":1328},{},[1329],{"type":28,"value":1330},"分钟线上也估过一次：能看出来的价差加冲击，中位每边大约 8bp。但分钟线看不见追价那部分，所以事先定了规则，估出来低于 10bp 也不往下调。",{"type":23,"tag":24,"props":1332,"children":1333},{},[1334],{"type":28,"value":1335},"到 11 月 5 日的研究记录为止，这 30bp 还没有用真实成交校准过。机制建好了，数还在等成交。",{"type":23,"tag":50,"props":1337,"children":1339},{"id":1338},"门槛写死浮亏的时候也改不动",[1340],{"type":28,"value":1341},"门槛写死，浮亏的时候也改不动",{"type":23,"tag":24,"props":1343,"children":1344},{},[1345],{"type":28,"value":1346},"一个策略从研究到满仓实盘要过好几道门。浮亏的时候，最想做的就是放宽标准，或者把状态直接改回去。一个人的项目，任何东西自己都改得动。",{"type":23,"tag":24,"props":1348,"children":1349},{},[1350],{"type":28,"value":1351},"门槛还有一个对称的难处：太松没有意义；太严什么都晋升不了，纪律迟早被整体放弃。",{"type":23,"tag":24,"props":1353,"children":1354},{},[1355],{"type":23,"tag":65,"props":1356,"children":1359},{"alt":1357,"src":1358},"策略从研究到实盘的状态和门槛：研究、样本外通过、模拟盘、小仓实盘、满仓实盘五个状态依次晋升；实盘出问题进入观察并继续影子记账，恢复后回到原状态，60 个交易日内不恢复则退役；图下列出每条边的门槛","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Flifecycle.svg",[],{"type":23,"tag":24,"props":1361,"children":1362},{},[1363],{"type":28,"value":1364},"每条边的门槛都写在版本化的门槛文件里。图里的 DSR（Deflated Sharpe Ratio）把试过多少次也算了进去，表示样本外超额夏普真的大于 0 的概率。",{"type":23,"tag":24,"props":1366,"children":1367},{},[1368,1370,1376],{"type":28,"value":1369},"门槛只增不改。门槛放在 git 里的 ",{"type":23,"tag":99,"props":1371,"children":1373},{"className":1372},[],[1374],{"type":28,"value":1375},"thresholds\u002Fv{N}.yaml",{"type":28,"value":1377},"，有测试断言每个版本的文件和提交历史逐字节一致，而且只被一个提交碰过，改完再改回去也会红。要改只能发新版本。每次状态转移都记下当时的门槛版本；工作区有没提交的改动时，判定器拒绝运行。单人项目可以重写 git 历史，所以这套机制的真实强度是「高摩擦、可检测」，谈不上不可篡改。",{"type":23,"tag":24,"props":1379,"children":1380},{},[1381],{"type":28,"value":1382},"状态由数据库把关。状态图写在数据库的触发器里，直接用 SQL 把状态改回去也过不了。实盘不能直接退役，必须先进观察期，清仓后继续影子记账，也就是不真买、只按信号记一本账。出观察只能回到原来的状态，并且重置回撤峰值，否则复出第一天就会再次触发清仓。账户回撤到 25% 时，切到更小的资金档。为什么不直接把仓位乘 0.5：直接减半，单仓金额变小，整手取整的误差会反过来主导结果。",{"type":23,"tag":24,"props":1384,"children":1385},{},[1386],{"type":28,"value":1387},"没拟合的参数拒绝运行。熔断恢复的四个参数一开始是空值，取用直接抛异常，不给默认值。给默认值，等于替还没做的拟合下了结论。",{"type":23,"tag":24,"props":1389,"children":1390},{},[1391],{"type":28,"value":1392},"拟合取平台，不取最优点。这四个参数在样本内 2011 年 4 月到 2018 年底的数据上用网格拟合，取表现好的那片区域的中位数，不取单个最优格。第一轮的好区域贴在网格边上，说明没封顶；扩大网格跑第二轮，封顶以后才发值。比如影子净值回升 20%、并持续 30 个交易日，才能复出。",{"type":23,"tag":24,"props":1394,"children":1395},{},[1396],{"type":28,"value":1397},"在样本内这条测试路径上，不带熔断的最大回撤中位数是 -54.1%，带上选定参数后是 -21.3%；代价是一半多的日子处在半仓或空仓，总收益中位数从 +292.7% 降到 +245.8%。按规则还要在样本外确认一次，发值时这一步还没做。",{"type":23,"tag":24,"props":1399,"children":1400},{},[1401],{"type":28,"value":1402},"太严的那一头也算过：DSR ≥ 0.95 这条门槛，在 1000 个交易日的样本、3 次试验下，需要年化超额夏普约 2.5。所以设计里要求，碰样本外之前先用样本内数据做一次可通过性演算，由结果决定新版门槛的数值。",{"type":23,"tag":50,"props":1404,"children":1406},{"id":1405},"同样的配置重跑要得到同样的结果",[1407],{"type":28,"value":1408},"同样的配置，重跑要得到同样的结果",{"type":23,"tag":24,"props":1410,"children":1411},{},[1412],{"type":28,"value":1413},"回测结果要能复现，线上那晚出的信号也要能事后复现，不然没法判断一次亏损是策略的问题，还是数据或代码变了。",{"type":23,"tag":24,"props":1415,"children":1416},{},[1417],{"type":28,"value":1418},"变量太多：代码在变，数据会补齐和更正，滑点模型、费率表、门槛也都有版本。连浮点数都会捣乱：多线程聚合时加法顺序不固定，同一次回测跑两遍，净值可能在小数点后十几位不一样。",{"type":23,"tag":24,"props":1420,"children":1421},{},[1422],{"type":23,"tag":65,"props":1423,"children":1426},{"alt":1424,"src":1425},"复现机制：左上每次回测绑定代码、参数、数据快照、滑点模型、成本表、门槛六样版本；右上 LightGBM 固定随机种子、单线程、确定性模式，依赖锁版本，复现路径上的聚合单线程或固定顺序；左下每晚出信号时冻结全市场分数和名次、代码版本、各特征非空率；右下 11 月 6 日核对，两个模型 35 个出信号的夜晚，第一名全部一致，Spearman 最低 0.999992","\u002Fimages\u002Fblog\u002Fargus-illustrated\u002Freproduce.svg",[],{"type":23,"tag":24,"props":1428,"children":1429},{},[1430],{"type":28,"value":1431},"每次回测绑定六样东西的版本：代码、参数、数据快照、滑点模型、成本表、门槛。LightGBM 固定随机种子、单线程、开确定性模式，依赖锁版本；复现校验路径上的聚合强制单线程或按固定顺序。每晚写入信号的同时，冻结全市场的分数和名次，记下代码版本和各特征的非空率。",{"type":23,"tag":24,"props":1433,"children":1434},{},[1435],{"type":28,"value":1436},"11 月 6 日做过一次核对：两个在跟的模型，一共 35 个线上出信号的夜晚，用当晚的模型对现在的数据重新打分，35 夜的第一名全部和当晚的信号一致。全市场分数的 Spearman 相关最低 0.999992，Spearman 只看排名，1 表示两边排序完全相同。其中一个模型的 24 夜，当晚跑在 22 个不同的代码版本上，用固定的一个提交重打分，仍然逐位复现。",{"type":23,"tag":24,"props":1438,"children":1439},{},[1440],{"type":28,"value":1441},"这个核对也有盲区：当晚和现在用的如果是同一份错的上游数据，两边会一起错，对照照样显示一致。已经知道有 6 列派生特征在部分夜里整列为空，记为未验证风险，另外排期修。",{"type":23,"tag":50,"props":1443,"children":1445},{"id":1444},"还在等的",[1446],{"type":28,"value":1444},{"type":23,"tag":24,"props":1448,"children":1449},{},[1450],{"type":28,"value":1451},"机制基本都搭起来了，缺的是真实成交和时间：",{"type":23,"tag":399,"props":1453,"children":1454},{},[1455,1460,1465,1470,1475],{"type":23,"tag":403,"props":1456,"children":1457},{},[1458],{"type":28,"value":1459},"滑点那 30bp 要等真实成交来校准；",{"type":23,"tag":403,"props":1461,"children":1462},{},[1463],{"type":28,"value":1464},"北交所那批股票吃掉准入门余量、对账却照样判绿，还在待决清单上；",{"type":23,"tag":403,"props":1466,"children":1467},{},[1468],{"type":28,"value":1469},"熔断恢复的四个参数，还差样本外确认那一步；",{"type":23,"tag":403,"props":1471,"children":1472},{},[1473],{"type":28,"value":1474},"部分夜里整列为空的 6 列派生特征，排期修；",{"type":23,"tag":403,"props":1476,"children":1477},{},[1478],{"type":28,"value":1479},"策略要晋升，只能一天天跑满模拟盘。",{"type":23,"tag":24,"props":1481,"children":1482},{},[1483],{"type":28,"value":1484},"这篇整理自 argus-quant 的设计文档、架构决策记录和 9 到 11 月的运行与研究记录。文中数字来自回测、纸面模拟和对账记录，不涉及真实资金。本文只讨论研究方法和工程实现，不构成任何投资建议。",{"title":8,"searchDepth":924,"depth":924,"links":1486},[1487,1488,1489,1490,1491,1492,1493,1494,1495],{"id":976,"depth":927,"text":979},{"id":1041,"depth":927,"text":1041},{"id":1102,"depth":927,"text":1102},{"id":1192,"depth":927,"text":1195},{"id":1244,"depth":927,"text":1244},{"id":1289,"depth":927,"text":1292},{"id":1338,"depth":927,"text":1341},{"id":1405,"depth":927,"text":1408},{"id":1444,"depth":927,"text":1444},"content:blog:2026-11-07-argus-architecture-illustrated.md","blog\u002F2026-11-07-argus-architecture-illustrated.md","blog\u002F2026-11-07-argus-architecture-illustrated",{"_path":1500,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":1501,"description":1502,"date":947,"tags":1503,"body":1505,"_type":937,"_id":2032,"_source":939,"_file":2033,"_stem":2034,"_extension":942},"\u002Fblog\u002F2026-11-07-genesis-architecture-illustrated","Genesis 是怎么搭起来的：一条 SQL 的上线路，和四个让我头疼的问题","Genesis 自己不算数据，它把页面上写的 SQL 变成调度系统里的工作流，再把结果收回来。这篇用五张图讲它的结构，以及发布断在半路、失败不报错、jar 太大、首屏太慢这四个问题是怎么处理的。",[46,14,1504],"数据平台",{"type":20,"children":1506,"toc":2023},[1507,1524,1537,1543,1548,1556,1561,1566,1609,1614,1619,1624,1630,1635,1643,1648,1660,1665,1670,1675,1680,1685,1690,1698,1703,1708,1721,1726,1732,1737,1742,1781,1786,1791,1814,1822,1827,1839,1844,1850,1855,1860,1865,1870,1875,1931,1939,1944,1949,1954,1959,1964,1969,1981,1986,1991],{"type":23,"tag":24,"props":1508,"children":1509},{},[1510,1514,1516,1523],{"type":23,"tag":41,"props":1511,"children":1512},{"href":43},[1513],{"type":28,"value":46},{"type":28,"value":1515}," 是我在做的数据平台，想做成一个能自己部署的 DataWorks，现在已经上线了，地址是 ",{"type":23,"tag":41,"props":1517,"children":1520},{"href":1518,"rel":1519},"https:\u002F\u002Fgenesis-platform.cn",[963],[1521],{"type":28,"value":1522},"genesis-platform.cn",{"type":28,"value":287},{"type":23,"tag":24,"props":1525,"children":1526},{},[1527,1529,1535],{"type":28,"value":1528},"9 月写过一篇",{"type":23,"tag":41,"props":1530,"children":1532},{"href":1531},"\u002Fblog\u002F2026-09-16-genesis-architecture-overview\u002F",[1533],{"type":28,"value":1534},"架构总览",{"type":28,"value":1536},"，东西列得很全，但一张图都没有，读起来很硬。这次换个写法，用图把它讲一遍。",{"type":23,"tag":50,"props":1538,"children":1540},{"id":1539},"genesis-自己不算数据",[1541],{"type":28,"value":1542},"Genesis 自己不算数据",{"type":23,"tag":24,"props":1544,"children":1545},{},[1546],{"type":28,"value":1547},"先说清楚一点：Genesis 不是大数据引擎，真正算数据的是背后那套集群。",{"type":23,"tag":24,"props":1549,"children":1550},{},[1551],{"type":23,"tag":65,"props":1552,"children":1555},{"alt":1553,"src":1554},"Genesis 整体架构：浏览器访问 Genesis 应用的三台 VM（genesis-web、genesis-server、MySQL 与 Redis），后端通过 REST、JDBC、HTTP 调用外部的 DolphinScheduler、Hive 与 Spark、Atlas、YARN 与 HDFS、DS Worker 和大模型接口","\u002Fimages\u002Fblog\u002Fgenesis-illustrated\u002Farchitecture.svg",[],{"type":23,"tag":24,"props":1557,"children":1558},{},[1559],{"type":28,"value":1560},"图里上面那个蓝框是 Genesis 本身，一共三台虚拟机：一台放前端页面，一台跑后端程序，一台放平台自己的数据库（MySQL）和缓存（Redis）。后端是 Spring Boot 写的，没拆微服务，就是一个程序，里面按功能分了 20 个模块。",{"type":23,"tag":24,"props":1562,"children":1563},{},[1564],{"type":28,"value":1565},"下面那一排是它要用到、但不归它管的系统：",{"type":23,"tag":399,"props":1567,"children":1568},{},[1569,1579,1589,1599],{"type":23,"tag":403,"props":1570,"children":1571},{},[1572,1577],{"type":23,"tag":86,"props":1573,"children":1574},{},[1575],{"type":28,"value":1576},"DolphinScheduler",{"type":28,"value":1578},"（下文简称 DS）：调度系统，负责「每天凌晨两点跑这段 SQL」这种事；",{"type":23,"tag":403,"props":1580,"children":1581},{},[1582,1587],{"type":23,"tag":86,"props":1583,"children":1584},{},[1585],{"type":28,"value":1586},"Hive 和 Spark",{"type":28,"value":1588},"：真正执行 SQL、算数据的地方；",{"type":23,"tag":403,"props":1590,"children":1591},{},[1592,1597],{"type":23,"tag":86,"props":1593,"children":1594},{},[1595],{"type":28,"value":1596},"Atlas",{"type":28,"value":1598},"：记录表和表之间的血缘，也就是「这张表的数据是从哪几张表来的」；",{"type":23,"tag":403,"props":1600,"children":1601},{},[1602,1607],{"type":23,"tag":86,"props":1603,"children":1604},{},[1605],{"type":28,"value":1606},"大模型接口",{"type":28,"value":1608},"：给写代码时的 AI 助手和发布前的 AI 预审用。",{"type":23,"tag":24,"props":1610,"children":1611},{},[1612],{"type":28,"value":1613},"所以 Genesis 干的活，说白了就两件：把用户在页面上写的 SQL 和调度配置，翻译成 DS 能跑的工作流；等跑完了，再把结果、质量和血缘收回来给人看。",{"type":23,"tag":24,"props":1615,"children":1616},{},[1617],{"type":28,"value":1618},"这个定位决定了后面我遇到的大部分麻烦。Genesis 里记着一份状态，DS 里也有一份，两边中间隔着网络，而且 DS 不归 Genesis 管。",{"type":23,"tag":24,"props":1620,"children":1621},{},[1622],{"type":28,"value":1623},"顺带说一句，下面那排外部系统都可以关掉。只有一台装了 Docker 的机器，也能用「单机 lite 模式」把整套平台跑起来，只是不能发布到调度。关掉的功能会提示「未配置」，不会报错，也不会白屏。",{"type":23,"tag":50,"props":1625,"children":1627},{"id":1626},"一条-sql-是怎么上线的",[1628],{"type":28,"value":1629},"一条 SQL 是怎么上线的",{"type":23,"tag":24,"props":1631,"children":1632},{},[1633],{"type":28,"value":1634},"站在用户的角度，从写好一段 SQL 到它每天自动跑，要点下面这几步：",{"type":23,"tag":24,"props":1636,"children":1637},{},[1638],{"type":23,"tag":65,"props":1639,"children":1642},{"alt":1640,"src":1641},"一个 SQL 节点的主链路，共八步：IDE 试跑、提交、审核、预检、发布到 DS、调度执行、发现故障、表指挥中心，其中发布到 DS、发现故障、表指挥中心三步标为蓝色","\u002Fimages\u002Fblog\u002Fgenesis-illustrated\u002Fmain-chain.svg",[],{"type":23,"tag":24,"props":1644,"children":1645},{},[1646],{"type":28,"value":1647},"先在网页上的编辑器里写 SQL，点运行试一下，日志一行一行推到浏览器上。没问题就提交，系统存一份当时的版本；如果项目要求审核，AI 先看一遍，把意见写进审核单，再通知审核人。",{"type":23,"tag":24,"props":1649,"children":1650},{},[1651,1653,1659],{"type":28,"value":1652},"审核过了还有一道预检。发布到生产之前，系统会跑 11 项检查：SQL 语法对不对，表存不存在，命名合不合规范，调度参数写没写全，调度系统有没有开，等等。只有最严重的那一级会拦住发布，其他的只是提醒。同一份内容 10 分钟内检查过就不重复检查，内容一改就重来。命名规范这块我单独写过",{"type":23,"tag":41,"props":1654,"children":1656},{"href":1655},"\u002Fblog\u002F2026-08-22-genesis-onedata-standards\u002F",[1657],{"type":28,"value":1658},"一篇",{"type":28,"value":287},{"type":23,"tag":24,"props":1661,"children":1662},{},[1663],{"type":28,"value":1664},"前面这几步都只在 Genesis 自己的数据库里打转，出了错，改完重来就行。麻烦是从第 5 步开始的，因为要跟 DS 打交道了。图里标蓝的三步，就是下面要讲的。",{"type":23,"tag":50,"props":1666,"children":1668},{"id":1667},"发布到一半断了怎么办",[1669],{"type":28,"value":1667},{"type":23,"tag":24,"props":1671,"children":1672},{},[1673],{"type":28,"value":1674},"把一个节点发布到 DS，Genesis 要依次调 DS 的四个接口：先要一个任务编号，再建（或者改）工作流，然后上线，最后同步排期。",{"type":23,"tag":24,"props":1676,"children":1677},{},[1678],{"type":28,"value":1679},"四步里哪一步都可能失败：网络抖一下，DS 嫌某个参数不对，或者正好赶上 Genesis 后端重启。",{"type":23,"tag":24,"props":1681,"children":1682},{},[1683],{"type":28,"value":1684},"最怕的是断在中间。比如 DS 那边工作流已经建好了，Genesis 还没来得及记下来。这时候用户点重试，DS 上就会多出一份一模一样的工作流。反过来也会出事：Genesis 以为发布成功了，DS 上其实没上线，到点不跑，也没人知道。",{"type":23,"tag":24,"props":1686,"children":1687},{},[1688],{"type":28,"value":1689},"这件事没法用数据库事务兜住，因为一半操作在 Genesis 的库里，一半在 DS 那边。我的办法是把发布过程拆开，每走一步都在自己库里记一笔：",{"type":23,"tag":24,"props":1691,"children":1692},{},[1693],{"type":23,"tag":65,"props":1694,"children":1697},{"alt":1695,"src":1696},"节点发布状态机：DRAFT 到 SUBMITTED 到 PUBLISHING 到 PUBLISHED；PUBLISHING 任一步失败进入 PUBLISH_FAILED，重试时因为工作流编码已落库会走更新；第二段按生成任务编码、建或改工作流、上线、同步排期四步调用 DS；对账任务每小时比对一次","\u002Fimages\u002Fblog\u002Fgenesis-illustrated\u002Fpublish-state.svg",[],{"type":23,"tag":24,"props":1699,"children":1700},{},[1701],{"type":28,"value":1702},"动 DS 之前，先把节点标成「发布中」。然后一步一步调 DS，每做完一步就记一下做到哪了。最关键的一条是：DS 返回的工作流编号一拿到，马上存进库里。这样哪怕后面哪一步失败了，重试的时候一看已经有编号，就去改那个已有的工作流，不会再建一个新的。全部做完标成「已发布」；中途失败就标成「发布失败」，同时记下停在哪一步、为什么失败，用户可以直接重试。",{"type":23,"tag":24,"props":1704,"children":1705},{},[1706],{"type":28,"value":1707},"这只管得住 Genesis 自己发起的发布。DS 上的工作流也可能被别人直接改了，或者 Genesis 恰好在「发布中」的时候重启。所以我又加了一个对账任务，每小时跑一次，拿 Genesis 里的记录去跟 DS 上的实际情况比。对不上的标出来，面板上点一下就能按 Genesis 的记录重新同步；一直卡在「发布中」的，改成「发布失败」。如果某一轮 DS 根本连不上，这一轮就跳过，免得把网络故障误判成两边不一致。",{"type":23,"tag":24,"props":1709,"children":1710},{},[1711,1713,1719],{"type":28,"value":1712},"这套东西真正派上用场是 9 月 4 号。那天我把 DS 从单机换成集群，旧环境里的工作流全都要在新集群上重建。87 个已发布的节点，就是靠这个「重新同步」恢复的，没有手工一个个重新发。那次迁移的全过程记在",{"type":23,"tag":41,"props":1714,"children":1716},{"href":1715},"\u002Fblog\u002F2026-09-06-gmall-dw-on-genesis\u002F",[1717],{"type":28,"value":1718},"电商数仓那篇",{"type":28,"value":1720},"里。",{"type":23,"tag":24,"props":1722,"children":1723},{},[1724],{"type":28,"value":1725},"还有一个小坑：DS 不同版本，接口里的字段名不一样。代码是照着 DS 3.3 写的，生产上跑的是 3.2.2，字段名对不上，DS 只回一句「参数无效」，别的什么都不说。现在会按配置里写的 DS 版本选字段名。",{"type":23,"tag":50,"props":1727,"children":1729},{"id":1728},"明明失败了页面却说正常",[1730],{"type":28,"value":1731},"明明失败了，页面却说正常",{"type":23,"tag":24,"props":1733,"children":1734},{},[1735],{"type":28,"value":1736},"9 月 3 号晚上，我在真实环境里把上面那条链路从头到尾走了一遍，后来又在平台上搭了一整套电商数仓，前后记了 30 个问题。最难查的几个，都有一个共同点：出错了，但是不报错。",{"type":23,"tag":24,"props":1738,"children":1739},{},[1740],{"type":28,"value":1741},"举四个例子：",{"type":23,"tag":399,"props":1743,"children":1744},{},[1745,1750,1755,1776],{"type":23,"tag":403,"props":1746,"children":1747},{},[1748],{"type":28,"value":1749},"审核接口返回成功，节点却悄悄变成了「发布失败」。原因是这个 SQL 节点没绑数据源，项目里也没配。审核人看不到任何提示，只有服务器日志里有一行 ERROR。",{"type":23,"tag":403,"props":1751,"children":1752},{},[1753],{"type":28,"value":1754},"我故意让一个任务跑失败，等了 2 分钟，平台每 30 秒查一次状态，查了 4 轮，一条故障记录都没有。查下来，发布的时候项目配置缺了会自动用全局默认值，负责检查运行状态的那段代码却没做这个兜底，直接把这个项目跳过了。",{"type":23,"tag":403,"props":1756,"children":1757},{},[1758,1760,1766,1768,1774],{"type":28,"value":1759},"SQL 里写的变量叫 ",{"type":23,"tag":99,"props":1761,"children":1763},{"className":1762},[],[1764],{"type":28,"value":1765},"${do_date}",{"type":28,"value":1767},"，调度参数里配的却叫 ",{"type":23,"tag":99,"props":1769,"children":1771},{"className":1770},[],[1772],{"type":28,"value":1773},"bizdate",{"type":28,"value":1775},"。从提交到发布，一路没有任何提示。到了运行的时候 DS 替换不了这个变量，SQL 就安安静静地去读了一个空分区。",{"type":23,"tag":403,"props":1777,"children":1778},{},[1779],{"type":28,"value":1780},"表详情页的某个查询失败了，代码在出错处理里塞了一份全是 0 的结果。页面上显示失败规则数为 0，健康状态亮绿灯。",{"type":23,"tag":24,"props":1782,"children":1783},{},[1784],{"type":28,"value":1785},"这类问题，单元测试是测不出来的。每一段代码单独看都没毛病，测试测的也正是单独那一段；只有把整条链路真走一遍，才会发现两头接不上。还有一个原因是「兜底」本身。为了页面不报错而填的默认值，为了流程不中断而吞掉的异常，都会把失败伪装成正常。",{"type":23,"tag":24,"props":1787,"children":1788},{},[1789],{"type":28,"value":1790},"后来我给自己定了一条规矩：宁可报错，宁可显示「不知道」，也不能显示「正常」。按这条规矩，上面四个问题是这么改的：",{"type":23,"tag":399,"props":1792,"children":1793},{},[1794,1799,1804,1809],{"type":23,"tag":403,"props":1795,"children":1796},{},[1797],{"type":28,"value":1798},"注定会失败的情况，预检直接拦住，审核接口把自动发布的结果一起返回，前端照实提示；",{"type":23,"tag":403,"props":1800,"children":1801},{},[1802],{"type":28,"value":1803},"检查运行状态的代码，跟发布那边用同一套兜底逻辑；",{"type":23,"tag":403,"props":1805,"children":1806},{},[1807],{"type":28,"value":1808},"加了一项检查：SQL 里用到的变量，调度参数里必须有；",{"type":23,"tag":403,"props":1810,"children":1811},{},[1812],{"type":28,"value":1813},"表详情页改成每一块数据单独报状态，见下图。",{"type":23,"tag":24,"props":1815,"children":1816},{},[1817],{"type":23,"tag":65,"props":1818,"children":1821},{"alt":1819,"src":1820},"表详情页改造前后对比：改之前，质量子查询失败后在 catch 里填零值，健康点亮绿灯；改之后，质量摘要、质量详情、活跃 Incident、最近变更、引用它的 IDE 节点五段并行查询并各自标记 OK 或 TIMEOUT，响应里多一个 sections 字段，非 OK 的段不给数据，健康点判灰并提示质量数据暂不可用","\u002Fimages\u002Fblog\u002Fgenesis-illustrated\u002Ftable-context.svg",[],{"type":23,"tag":24,"props":1823,"children":1824},{},[1825],{"type":28,"value":1826},"表详情页要展示五块数据，现在是同时去查，一共最多等 5 秒，每一块单独记「成功」「超时」或「出错」。没查到的那块干脆不返回数据，免得前端拿到一个假的 0。前端判断健康状态时，先看已知的问题：有失败就标红或标黄；没发现问题、但有一块数据没拿到，就标灰，写上「质量数据暂不可用」。",{"type":23,"tag":24,"props":1828,"children":1829},{},[1830,1832,1838],{"type":28,"value":1831},"查这五块数据用的线程池，参数改了三次才定下来。这里有个反直觉的地方：Java 的线程池是先把排队的位置占满，才会加线程。队列设得太长，请求就一直在队里等，等到 5 秒超时也轮不上。所以队列故意设得很小，满了就直接拒绝，记成「出错」，不让慢请求假装成「还在查」。来龙去脉写在",{"type":23,"tag":41,"props":1833,"children":1835},{"href":1834},"\u002Fblog\u002F2026-09-09-genesis-table-detail-truth\u002F",[1836],{"type":28,"value":1837},"这篇",{"type":28,"value":1720},{"type":23,"tag":24,"props":1840,"children":1841},{},[1842],{"type":28,"value":1843},"改完以后再测：任务失败 4 秒后，平台就记下了一条故障，关联的节点、质量结果和下游影响也都带上了。",{"type":23,"tag":50,"props":1845,"children":1847},{"id":1846},"一个驱动带进来半个-hadoop",[1848],{"type":28,"value":1849},"一个驱动，带进来半个 Hadoop",{"type":23,"tag":24,"props":1851,"children":1852},{},[1853],{"type":28,"value":1854},"9 月 4 号我量了一下，后端打出来的 jar 包有 247MB，里面装了 375 个依赖包。每次部署都要传这 247MB，生产上启动要 12.7 秒。",{"type":23,"tag":24,"props":1856,"children":1857},{},[1858],{"type":28,"value":1859},"大头几乎全是 Hive 的 JDBC 驱动带进来的。Genesis 只需要用它连 Hive，用到的就一个类，它却顺手拉进来十几个 HBase 的包、Hadoop 的一大堆服务端组件，还有一个 Derby 数据库，里面甚至混着两个版本的 Hadoop。",{"type":23,"tag":24,"props":1861,"children":1862},{},[1863],{"type":28,"value":1864},"第一反应是把用不到的都排除掉，问题是排错了不会马上发现。启动不报错，要等到真去连 Hive 的那一刻才出问题。我第一轮就把一个叫 Curator 的包排掉了，结果一连 Hive 就报找不到类，因为驱动连 ZooKeeper 的时候要用它。靠看代码，判断不出哪些包能删。",{"type":23,"tag":24,"props":1866,"children":1867},{},[1868],{"type":28,"value":1869},"另一层麻烦是版本冲突。平台要连十几种数据库：Hive、ClickHouse、Oracle、达梦、人大金仓……它们的驱动全塞在一个程序里，依赖的版本经常打架。ClickHouse 的驱动就跟 Spring Boot 自带的某个库版本冲突了，只能换成它那个把依赖全打包在一起的版本。",{"type":23,"tag":24,"props":1871,"children":1872},{},[1873],{"type":28,"value":1874},"最后分了三步解决：",{"type":23,"tag":890,"props":1876,"children":1877},{},[1878,1904,1921],{"type":23,"tag":403,"props":1879,"children":1880},{},[1881,1886,1888,1894,1896,1902],{"type":23,"tag":86,"props":1882,"children":1883},{},[1884],{"type":28,"value":1885},"一档一档地删，每删一档都真连一次。",{"type":28,"value":1887}," 删完跑一个测试，真去连 Hive 执行 ",{"type":23,"tag":99,"props":1889,"children":1891},{"className":1890},[],[1892],{"type":28,"value":1893},"SELECT 1",{"type":28,"value":1895},"，真去连 Spark 执行 ",{"type":23,"tag":99,"props":1897,"children":1899},{"className":1898},[],[1900],{"type":28,"value":1901},"SHOW DATABASES",{"type":28,"value":1903},"，过了才删下一档。Curator 那次踩的坑，写进了配置文件的注释里。",{"type":23,"tag":403,"props":1905,"children":1906},{},[1907,1912,1914,1920],{"type":23,"tag":86,"props":1908,"children":1909},{},[1910],{"type":28,"value":1911},"把驱动从 jar 里搬出去。",{"type":28,"value":1913}," 各家数据库的驱动不再打进主程序，放到外面一个单独的目录里，每家一个子目录，各用各的类加载器，互相看不见，版本也就打不起来了。缺了哪个驱动，测试连接时会直接说「缺少某某驱动，请放到哪个目录」，不再是一句看不懂的 ",{"type":23,"tag":99,"props":1915,"children":1917},{"className":1916},[],[1918],{"type":28,"value":1919},"No suitable driver",{"type":28,"value":287},{"type":23,"tag":403,"props":1922,"children":1923},{},[1924,1929],{"type":23,"tag":86,"props":1925,"children":1926},{},[1927],{"type":28,"value":1928},"镜像分层。",{"type":28,"value":1930}," Docker 镜像按变化频率分成四层，依赖没变的时候直接用缓存，只传改过的那一层。",{"type":23,"tag":24,"props":1932,"children":1933},{},[1934],{"type":23,"tag":65,"props":1935,"children":1938},{"alt":1936,"src":1937},"后端 jar 体积变化：瘦身前 247MB、375 个依赖 jar；排除 hive-jdbc 的传递依赖后 151.5MB、210 个；JDBC 驱动移出 jar 外置隔离加载后 93.7MB、139 个；累计减少 62%","\u002Fimages\u002Fblog\u002Fgenesis-illustrated\u002Fjar-size.svg",[],{"type":23,"tag":24,"props":1940,"children":1941},{},[1942],{"type":28,"value":1943},"结果是 jar 从 247MB 降到 151.5MB，再降到 93.7MB，一共少了 62%，启动时间从 12.7 秒降到 9.3 秒。生产上 12 种外置的数据库驱动都能正常加载，六类数据源测试连接全部通过。没改代码的重新部署，实际传输 0 字节；只改了业务代码的话，只传 6.3MB。",{"type":23,"tag":50,"props":1945,"children":1947},{"id":1946},"登录页为什么要下载代码编辑器",[1948],{"type":28,"value":1946},{"type":23,"tag":24,"props":1950,"children":1951},{},[1952],{"type":28,"value":1953},"前端的页面都是按需加载的，照理说，打开登录页只该下载登录页自己那点代码。8 月 21 号我按浏览器实际下载的文件量了一下：首屏要下载的 JS，压缩后 1462KB，连登录页也是这么多。",{"type":23,"tag":24,"props":1955,"children":1956},{},[1957],{"type":28,"value":1958},"一开始我是看打包结果里哪个文件大就优化哪个：把编辑器页面改成异步加载，删掉编辑器用不到的语言支持。两件都做了，打包出来的文件确实小了，总体积从 20.51MB 降到 11.30MB。可首屏一点没变，因为这些文件本来就不在首屏要下载的那批里。量错了地方，优化就没打到点子上。",{"type":23,"tag":24,"props":1960,"children":1961},{},[1962],{"type":28,"value":1963},"后来改成只量首屏真正下载了哪些文件，才找到原因。打包工具 Vite 有一个大约 200 字节的小函数，专门负责提前加载页面，87 个页面都要调用它。打包的时候，这个小函数被分到了代码编辑器 Monaco 那个包里。结果任何一个页面想用这个小函数，都得先把整个 Monaco 下载下来，压缩后 941KB。",{"type":23,"tag":24,"props":1965,"children":1966},{},[1967],{"type":28,"value":1968},"修起来很简单，把这个小函数单独分成一个包就行。不过这一步要是改错了，所有按需加载的页面都会失效，所以我拿生产环境的打包结果，在浏览器里实际跑了一遍：打开登录页不再下载 Monaco，进 SQL 编辑页的时候才加载，编辑器正常显示。",{"type":23,"tag":24,"props":1970,"children":1971},{},[1972,1974,1979],{"type":28,"value":1973},"首屏 JS 从 1462KB 降到 523KB，少了 64%。剩下的大头是 Ant Design Vue 组件库，9 月 3 号改成用到哪个组件才加载哪个，又从 502KB 降到 413KB，离目标还有距离，排在后面再弄。完整的排查过程写在",{"type":23,"tag":41,"props":1975,"children":1977},{"href":1976},"\u002Fblog\u002F2026-08-24-genesis-vite-preload-first-screen\u002F",[1978],{"type":28,"value":1837},{"type":28,"value":1980},"里。从那以后我定了个规矩：说自己做了首屏优化，就得拿出改前改后浏览器实际下载了哪些文件，光说打包文件变小了不算数。",{"type":23,"tag":50,"props":1982,"children":1984},{"id":1983},"还没解决的",[1985],{"type":28,"value":1983},{"type":23,"tag":24,"props":1987,"children":1988},{},[1989],{"type":28,"value":1990},"有几件事我知道，但还没做：",{"type":23,"tag":399,"props":1992,"children":1993},{},[1994,1999,2011],{"type":23,"tag":403,"props":1995,"children":1996},{},[1997],{"type":28,"value":1998},"模块之间传消息靠的是程序内部的事件，没有用消息队列。程序一重启，正在跑的质量检查就会悄悄丢掉。这个排在后面改。",{"type":23,"tag":403,"props":2000,"children":2001},{},[2002,2004,2010],{"type":28,"value":2003},"血缘现在主要到表这一级，还做不到字段级。迁移到 OpenMetadata 的方案定了，还没动手，为什么这么定写在",{"type":23,"tag":41,"props":2005,"children":2007},{"href":2006},"\u002Fblog\u002F2026-10-08-genesis-architecture-adr\u002F",[2008],{"type":28,"value":2009},"架构决策那篇",{"type":28,"value":1720},{"type":23,"tag":403,"props":2012,"children":2013},{},[2014,2016,2022],{"type":28,"value":2015},"大数据集群的七个节点都在同一台物理机上。主备是做了，可物理机一停就全停，9 月 20 号真停过一次。机器是怎么分布的，见",{"type":23,"tag":41,"props":2017,"children":2019},{"href":2018},"\u002Fblog\u002F2026-09-28-homelab-production-deployment\u002F",[2020],{"type":28,"value":2021},"家里这套生产环境",{"type":28,"value":287},{"title":8,"searchDepth":924,"depth":924,"links":2024},[2025,2026,2027,2028,2029,2030,2031],{"id":1539,"depth":927,"text":1542},{"id":1626,"depth":927,"text":1629},{"id":1667,"depth":927,"text":1667},{"id":1728,"depth":927,"text":1731},{"id":1846,"depth":927,"text":1849},{"id":1946,"depth":927,"text":1946},{"id":1983,"depth":927,"text":1983},"content:blog:2026-11-07-genesis-architecture-illustrated.md","blog\u002F2026-11-07-genesis-architecture-illustrated.md","blog\u002F2026-11-07-genesis-architecture-illustrated",{"_path":2036,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":2037,"description":2038,"date":2039,"tags":2040,"body":2044,"_type":937,"_id":2747,"_source":939,"_file":2748,"_stem":2749,"_extension":942},"\u002Fblog\u002F2026-10-12-ai-assisted-genesis","Genesis 的代码大多是 AI 写的：我怎么定规矩、过 spec，又在哪儿没管住","Genesis 的代码大多由 Claude Code 和 Codex 生成，我管需求、规格和放行。这篇记下这套流程是怎么跑的，以及测试全绿也照样漏掉的那些问题。","2026-10-12",[46,2041,2042,2043],"AI 协作研发","研发流程","Claude Code",{"type":20,"children":2045,"toc":2735},[2046,2061,2066,2072,2077,2082,2105,2118,2123,2128,2151,2260,2265,2301,2314,2337,2342,2347,2355,2360,2365,2371,2376,2381,2444,2449,2455,2460,2473,2478,2484,2489,2497,2516,2521,2604,2609,2614,2619,2624,2632,2637,2655,2660,2671,2676,2689,2694,2699,2704,2709,2714,2719,2724,2729],{"type":23,"tag":24,"props":2047,"children":2048},{},[2049,2053,2055,2060],{"type":23,"tag":41,"props":2050,"children":2051},{"href":43},[2052],{"type":28,"value":46},{"type":28,"value":2054}," 是我在做的数据平台，想做成一个能自己部署的阿里云 DataWorks，数据建模、开发、调度、血缘、质量、指标管理都在里面，已经上线了，地址是 ",{"type":23,"tag":41,"props":2056,"children":2058},{"href":1518,"rel":2057},[963],[2059],{"type":28,"value":1522},{"type":28,"value":287},{"type":23,"tag":24,"props":2062,"children":2063},{},[2064],{"type":28,"value":2065},"2026 年 4 月到 9 月，仓库里 465 次提交都挂在我一个人名下，可代码大部分是 Claude Code 和 Codex 写的。我负责需求、架构、规格、评审和关键决策。代码交给智能体以后，我要管的其实就两件事：让它做对的事，以及判断它什么时候算做完。为此我搭了一套「先写规格、再写代码」的流程。",{"type":23,"tag":50,"props":2067,"children":2069},{"id":2068},"我管什么智能体管什么",[2070],{"type":28,"value":2071},"我管什么，智能体管什么",{"type":23,"tag":24,"props":2073,"children":2074},{},[2075],{"type":28,"value":2076},"技术栈很常规：后端 Spring Boot 3 + MyBatis-Plus + MySQL，前端 Vue 3 + TypeScript + Vite + Ant Design Vue。仓库里原来有一个自己写的调度核心模块，一直没启用，9 月 6 日已经删掉；生产上的调度靠外部的 DolphinScheduler（下面简称 DS），节点发布时同步成 DS 里的工作流。生产环境是数据库、应用、前端三个节点，用 Docker Compose 部署，部署动作统一封装在一个脚本里。",{"type":23,"tag":24,"props":2078,"children":2079},{},[2080],{"type":28,"value":2081},"我做的事归起来是四类：",{"type":23,"tag":399,"props":2083,"children":2084},{},[2085,2090,2095,2100],{"type":23,"tag":403,"props":2086,"children":2087},{},[2088],{"type":28,"value":2089},"找需求：很多是我拿真实的数仓项目在平台上走流程时，顺手记下的体验问题；",{"type":23,"tag":403,"props":2091,"children":2092},{},[2093],{"type":28,"value":2094},"定方案：设计阶段从几个候选方案里挑一个，一节一节确认；",{"type":23,"tag":403,"props":2096,"children":2097},{},[2098],{"type":28,"value":2099},"定边界：模块怎么分、接口怎么约定，以及这一期明确不做什么；",{"type":23,"tag":403,"props":2101,"children":2102},{},[2103],{"type":28,"value":2104},"放行：看审查结论和验证记录，决定能不能合并、能不能动生产。",{"type":23,"tag":24,"props":2106,"children":2107},{},[2108,2110,2116],{"type":28,"value":2109},"剩下的交给智能体：读现有代码摸清现状，起草 spec（设计文档）和 plan（实现计划），按 plan 先写测试再写实现，跑验证命令。用子代理（主会话派出去干单项任务的另一个智能体）执行时，还会再派独立的子代理，一个查实现有没有照着规格做，一个查代码质量。这些 spec 和 plan 都存在仓库的 ",{"type":23,"tag":99,"props":2111,"children":2113},{"className":2112},[],[2114],{"type":28,"value":2115},"docs\u002Fsuperpowers\u002F",{"type":28,"value":2117}," 下，有 8 份设计 spec、15 份实现 plan。",{"type":23,"tag":50,"props":2119,"children":2121},{"id":2120},"规矩写在仓库里的三份文件",[2122],{"type":28,"value":2120},{"type":23,"tag":24,"props":2124,"children":2125},{},[2126],{"type":28,"value":2127},"每个会话都是从零开始的，规矩要让每个会话都读得到，只能写进仓库。Genesis 里管这件事的是三份文件。",{"type":23,"tag":24,"props":2129,"children":2130},{},[2131,2133,2140,2142,2149],{"type":28,"value":2132},"第一份是 CLAUDE.md，管 Claude Code 怎么干活。头一条是 skill 路由。skill 是一包事先写好的操作说明，智能体调用它以后，就照着里面的步骤做。CLAUDE.md 规定：请求能对上某个 skill，第一个动作就必须是调用它，不能直接回答。skill 分两组，",{"type":23,"tag":41,"props":2134,"children":2137},{"href":2135,"rel":2136},"https:\u002F\u002Fgithub.com\u002Fobra\u002Fsuperpowers",[963],[2138],{"type":28,"value":2139},"superpowers",{"type":28,"value":2141}," 管写代码之前的构思和计划，",{"type":23,"tag":41,"props":2143,"children":2146},{"href":2144,"rel":2145},"https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgstack",[963],[2147],{"type":28,"value":2148},"gstack",{"type":28,"value":2150}," 管浏览器 QA、Web 验证和生产发布。第一组的原文是：",{"type":23,"tag":2152,"props":2153,"children":2156},"pre",{"className":2154,"code":2155,"language":28,"meta":8,"style":8},"language-text shiki shiki-themes github-light github-dark","在写代码之前，所有构思、设计和实现规划都使用 superpowers skills。\n\n- 新功能、\"应该做什么\"、方案打磨 → invoke brainstorming\n- 拆解任务、写实现计划 → invoke writing-plans\n- 用并发子代理驱动执行 → invoke subagent-driven-development\n- 分批执行计划（含人工检查点）→ invoke executing-plans\n- TDD 循环，先写测试 → invoke test-driven-development\n- 调试、报错、\"为什么坏了\"、根因分析 → invoke systematic-debugging\n- 修完后验证确实解决了问题 → invoke verification-before-completion\n- 合并前请求代码审查 → invoke requesting-code-review\n- 响应代码审查反馈 → invoke receiving-code-review\n",[2157],{"type":23,"tag":99,"props":2158,"children":2159},{"__ignoreMap":8},[2160,2171,2180,2188,2197,2206,2215,2224,2233,2242,2251],{"type":23,"tag":2161,"props":2162,"children":2165},"span",{"class":2163,"line":2164},"line",1,[2166],{"type":23,"tag":2161,"props":2167,"children":2168},{},[2169],{"type":28,"value":2170},"在写代码之前，所有构思、设计和实现规划都使用 superpowers skills。\n",{"type":23,"tag":2161,"props":2172,"children":2173},{"class":2163,"line":927},[2174],{"type":23,"tag":2161,"props":2175,"children":2177},{"emptyLinePlaceholder":2176},true,[2178],{"type":28,"value":2179},"\n",{"type":23,"tag":2161,"props":2181,"children":2182},{"class":2163,"line":924},[2183],{"type":23,"tag":2161,"props":2184,"children":2185},{},[2186],{"type":28,"value":2187},"- 新功能、\"应该做什么\"、方案打磨 → invoke brainstorming\n",{"type":23,"tag":2161,"props":2189,"children":2191},{"class":2163,"line":2190},4,[2192],{"type":23,"tag":2161,"props":2193,"children":2194},{},[2195],{"type":28,"value":2196},"- 拆解任务、写实现计划 → invoke writing-plans\n",{"type":23,"tag":2161,"props":2198,"children":2200},{"class":2163,"line":2199},5,[2201],{"type":23,"tag":2161,"props":2202,"children":2203},{},[2204],{"type":28,"value":2205},"- 用并发子代理驱动执行 → invoke subagent-driven-development\n",{"type":23,"tag":2161,"props":2207,"children":2209},{"class":2163,"line":2208},6,[2210],{"type":23,"tag":2161,"props":2211,"children":2212},{},[2213],{"type":28,"value":2214},"- 分批执行计划（含人工检查点）→ invoke executing-plans\n",{"type":23,"tag":2161,"props":2216,"children":2218},{"class":2163,"line":2217},7,[2219],{"type":23,"tag":2161,"props":2220,"children":2221},{},[2222],{"type":28,"value":2223},"- TDD 循环，先写测试 → invoke test-driven-development\n",{"type":23,"tag":2161,"props":2225,"children":2227},{"class":2163,"line":2226},8,[2228],{"type":23,"tag":2161,"props":2229,"children":2230},{},[2231],{"type":28,"value":2232},"- 调试、报错、\"为什么坏了\"、根因分析 → invoke systematic-debugging\n",{"type":23,"tag":2161,"props":2234,"children":2236},{"class":2163,"line":2235},9,[2237],{"type":23,"tag":2161,"props":2238,"children":2239},{},[2240],{"type":28,"value":2241},"- 修完后验证确实解决了问题 → invoke verification-before-completion\n",{"type":23,"tag":2161,"props":2243,"children":2245},{"class":2163,"line":2244},10,[2246],{"type":23,"tag":2161,"props":2247,"children":2248},{},[2249],{"type":28,"value":2250},"- 合并前请求代码审查 → invoke requesting-code-review\n",{"type":23,"tag":2161,"props":2252,"children":2254},{"class":2163,"line":2253},11,[2255],{"type":23,"tag":2161,"props":2256,"children":2257},{},[2258],{"type":28,"value":2259},"- 响应代码审查反馈 → invoke receiving-code-review\n",{"type":23,"tag":24,"props":2261,"children":2262},{},[2263],{"type":28,"value":2264},"CLAUDE.md 还要求每次会话开始先读集群规划文档；涉及服务器和集群的操作必须跟文档一致，不一致就先改文档再动手；会话结束前对照清单检查一遍，拓扑、配置、部署流程有变化的，要同步进文档。",{"type":23,"tag":24,"props":2266,"children":2267},{},[2268,2270,2276,2278,2284,2286,2292,2293,2299],{"type":28,"value":2269},"第二份是 AGENTS.md，给所有智能体共用的项目说明：项目是干什么的、用什么技术、目录怎么分，再加几条开发约定。比如后端改完在 ",{"type":23,"tag":99,"props":2271,"children":2273},{"className":2272},[],[2274],{"type":28,"value":2275},"genesis-server\u002F",{"type":28,"value":2277}," 下跑 ",{"type":23,"tag":99,"props":2279,"children":2281},{"className":2280},[],[2282],{"type":28,"value":2283},"mvn compile",{"type":28,"value":2285},"，前端改完在 ",{"type":23,"tag":99,"props":2287,"children":2289},{"className":2288},[],[2290],{"type":28,"value":2291},"genesis-web\u002F",{"type":28,"value":2277},{"type":23,"tag":99,"props":2294,"children":2296},{"className":2295},[],[2297],{"type":28,"value":2298},"npm run build",{"type":28,"value":2300},"，部署变更统一走脚本，不直接操作 Docker。后半部分是跟常驻后台的 Agent Hermes 共享长期记忆的约定，踩过的坑和架构决策都记进笔记库。它没有规定 Claude Code 和 Codex 各自负责什么。",{"type":23,"tag":24,"props":2302,"children":2303},{},[2304,2306,2312],{"type":28,"value":2305},"第三份是项目开发规范（",{"type":23,"tag":99,"props":2307,"children":2309},{"className":2308},[],[2310],{"type":28,"value":2311},"docs\u002F04-项目开发规范.md",{"type":28,"value":2313},"），是我参考 Google Engineering Practices、Microsoft Engineering Fundamentals Playbook 与 SDL、AWS Builders' Library、Conventional Commits、Alibaba P3C 这些公开的工程实践整理的。里面直接管着智能体的是这几条：",{"type":23,"tag":399,"props":2315,"children":2316},{},[2317,2322,2327,2332],{"type":23,"tag":403,"props":2318,"children":2319},{},[2320],{"type":28,"value":2321},"需求进开发前要满足 Definition of Ready：验收标准可观察、可测试，“避免只写‘优化’‘完善’等模糊描述”；",{"type":23,"tag":403,"props":2323,"children":2324},{},[2325],{"type":28,"value":2326},"验证门禁按变更类型给出要跑的命令和要留的证据：后端是编译加目标测试，前端是构建、类型检查、lint 和单测，关键用户流程跑端到端测试（E2E）或记录等价的人工验收，只改了文档也要写明“仅文档变更，未运行构建”；",{"type":23,"tag":403,"props":2328,"children":2329},{},[2330],{"type":28,"value":2331},"数据平台特有的义务：动表结构、指标口径、词根命名、血缘、质量规则、调度配置、数据契约时，光代码对还不够，还要写清对数据有什么影响、怎么回滚、怎么补数；",{"type":23,"tag":403,"props":2333,"children":2334},{},[2335],{"type":28,"value":2336},"“禁止为了通过检查而注释、跳过或删除失败测试；如果测试本身不再合理，应在同一个变更里修正测试意图。”",{"type":23,"tag":50,"props":2338,"children":2340},{"id":2339},"一个需求要过的六关",[2341],{"type":28,"value":2339},{"type":23,"tag":24,"props":2343,"children":2344},{},[2345],{"type":28,"value":2346},"一个功能从想法到上线，要依次过下面几关：",{"type":23,"tag":24,"props":2348,"children":2349},{},[2350],{"type":23,"tag":65,"props":2351,"children":2354},{"alt":2352,"src":2353},"一个需求要过的六关：设计用 brainstorming，产出 specs\u002F 下的设计文档，我逐节确认；计划用 writing-plans，产出 plans\u002F 下的实现计划，自审 spec 全覆盖、无占位、类型名一致；实现用 subagent-driven-development 或 executing-plans 配 TDD，每个任务一次提交，先看到测试失败，子代理模式过两道审查；评审用 requesting-code-review 和 receiving-code-review，阻塞问题修完；验证用 verification-before-completion，plan 里记下命令、测试数和没做的事，每个提交在干净 worktree 里单独能编译；验收发布用 gstack 的 qa、ship、land-and-deploy，生产上走一遍主线，动生产由我放行","\u002Fimages\u002Fblog\u002Fai-assisted-genesis\u002Fpipeline.svg",[],{"type":23,"tag":24,"props":2356,"children":2357},{},[2358],{"type":28,"value":2359},"图里标蓝的两关要我本人点头。设计这关是一节一节过的，有的 spec 在对话里确认完，还要再书面复核一遍。动生产也是我一次一次放行。",{"type":23,"tag":24,"props":2361,"children":2362},{},[2363],{"type":28,"value":2364},"中间几关各有各的门槛。计划写完要自审三件事：spec 里的每一条有没有都落到任务上，有没有留着「待定」这种占位，前后用到的类型名是不是一致。实现阶段按 TDD 走，也就是先写一个测试，跑一下亲眼看它失败，再写实现让它通过，这样能确认测试真的在测这段新代码。用子代理执行时，每个任务做完都要过规格审查和质量审查。验证这关要求命令真的跑过，还要每个提交单独拿出来，在一个干净的 worktree 里能编译通过。worktree 是 Git 的一个功能，同一个仓库可以另外检出一份独立的工作目录，跟手上正在改的那份互不影响。最后一关用 gstack 在生产上把主线真实走一遍，留截图和验收记录。",{"type":23,"tag":76,"props":2366,"children":2368},{"id":2367},"一份-spec-长什么样",[2369],{"type":28,"value":2370},"一份 spec 长什么样",{"type":23,"tag":24,"props":2372,"children":2373},{},[2374],{"type":28,"value":2375},"拿 8 月 20 日那份《主线体验重塑：节点生命周期流水线》来说。需求来自我的体验日记：我拿一个真实的证券数仓项目，在平台上从头走到尾，反复碰到四类问题：页面之间跳来跳去，状态前后对不上，报错看不懂，还有失败了却什么提示都没有。我给的要求只有一句：“完整的整个流程我需要简单便捷不出错”。spec 把这句话翻成了三条能验证的指标：写完代码到发起上线只要 1 个按钮；主线上所有失败路径 100% 给出“原因 + 建议动作”；任何时刻都不会出现“UI 显示已发布，但 DolphinScheduler 里没有对应工作流”。",{"type":23,"tag":24,"props":2377,"children":2378},{},[2379],{"type":28,"value":2380},"设计原则里有一条叫“状态是结果，不是意图”：页面上显示「已发布」，必须是后端确认同步成功以后的事实，不能是「已经发出发布请求」。spec 里的状态机是这么画的：",{"type":23,"tag":2152,"props":2382,"children":2384},{"className":2154,"code":2383,"language":28,"meta":8,"style":8}," ① 草稿 ──保存\u002F试跑循环──┐\n ② 预检 ←────────────────┘   失败 → 面板列出阻塞项(可解释卡片) → 修复后重检\n ③ 提交 → 生成版本快照,节点锁定\n ④ 审核 → 项目开启 requireCodeReview 时进入;异步人工步骤,面板显示\"待 XX 审核\"\n │         审核通过 → 通知推送回 IDE;「通过后自动继续发布」默认开、可关\n ⑤ 发布 → DS 同步(创建工作流 + 建调度 + 上线)→ 同步验证 → 才置 PUBLISHED\n ⑥ 运行 → 面板显示最近实例状态\u002F下次调度时间;失败挂 Incident 徽标一键跳运维\n",[2385],{"type":23,"tag":99,"props":2386,"children":2387},{"__ignoreMap":8},[2388,2396,2404,2412,2420,2428,2436],{"type":23,"tag":2161,"props":2389,"children":2390},{"class":2163,"line":2164},[2391],{"type":23,"tag":2161,"props":2392,"children":2393},{},[2394],{"type":28,"value":2395}," ① 草稿 ──保存\u002F试跑循环──┐\n",{"type":23,"tag":2161,"props":2397,"children":2398},{"class":2163,"line":927},[2399],{"type":23,"tag":2161,"props":2400,"children":2401},{},[2402],{"type":28,"value":2403}," ② 预检 ←────────────────┘   失败 → 面板列出阻塞项(可解释卡片) → 修复后重检\n",{"type":23,"tag":2161,"props":2405,"children":2406},{"class":2163,"line":924},[2407],{"type":23,"tag":2161,"props":2408,"children":2409},{},[2410],{"type":28,"value":2411}," ③ 提交 → 生成版本快照,节点锁定\n",{"type":23,"tag":2161,"props":2413,"children":2414},{"class":2163,"line":2190},[2415],{"type":23,"tag":2161,"props":2416,"children":2417},{},[2418],{"type":28,"value":2419}," ④ 审核 → 项目开启 requireCodeReview 时进入;异步人工步骤,面板显示\"待 XX 审核\"\n",{"type":23,"tag":2161,"props":2421,"children":2422},{"class":2163,"line":2199},[2423],{"type":23,"tag":2161,"props":2424,"children":2425},{},[2426],{"type":28,"value":2427}," │         审核通过 → 通知推送回 IDE;「通过后自动继续发布」默认开、可关\n",{"type":23,"tag":2161,"props":2429,"children":2430},{"class":2163,"line":2208},[2431],{"type":23,"tag":2161,"props":2432,"children":2433},{},[2434],{"type":28,"value":2435}," ⑤ 发布 → DS 同步(创建工作流 + 建调度 + 上线)→ 同步验证 → 才置 PUBLISHED\n",{"type":23,"tag":2161,"props":2437,"children":2438},{"class":2163,"line":2217},[2439],{"type":23,"tag":2161,"props":2440,"children":2441},{},[2442],{"type":28,"value":2443}," ⑥ 运行 → 面板显示最近实例状态\u002F下次调度时间;失败挂 Incident 徽标一键跳运维\n",{"type":23,"tag":24,"props":2445,"children":2446},{},[2447],{"type":28,"value":2448},"再往后是分期（Phase 0 到 Phase 5，每期结束都要求工作区干净、能单独验收）、风险和对策，以及明确不做的事，比如不新建一个总控页面，那是讨论时被否掉的方案三。最后一节叫“现状核实”，是对着代码一项一项核的，列了 9 个确认存在的缺陷和它们在代码里的位置，并且据此回头改了前面的设计。",{"type":23,"tag":76,"props":2450,"children":2452},{"id":2451},"一份-plan-长什么样",[2453],{"type":28,"value":2454},"一份 plan 长什么样",{"type":23,"tag":24,"props":2456,"children":2457},{},[2458],{"type":28,"value":2459},"plan 开头一般先写给执行它的智能体看，指明用 subagent-driven-development 还是 executing-plans；接着是目标（Goal）、架构（Architecture）、技术栈（Tech Stack）和对应的 spec；然后是一节“关键事实（来自代码勘察）”，列出会碰到的类、行号和现成的调用写法，有的 plan 直接注明“执行者无需重新考证”。",{"type":23,"tag":24,"props":2461,"children":2462},{},[2463,2465,2471],{"type":28,"value":2464},"每个任务一般拆成五步：写一个会失败的测试，跑一下确认它失败，写实现，再跑确认通过，提交。另有一节“全局约束”对所有任务都生效。比如 Phase 1 规定 ID 一律当字符串处理，因为主键是 19 位的雪花 ID，超出了 JavaScript 数字能精确表示的范围；还规定每个任务只 ",{"type":23,"tag":99,"props":2466,"children":2468},{"className":2467},[],[2469],{"type":28,"value":2470},"git add",{"type":28,"value":2472}," 自己改的文件。",{"type":23,"tag":24,"props":2474,"children":2475},{},[2476],{"type":28,"value":2477},"执行过程中，plan 本身就是记录：每做完一个任务，补上对应的提交和新增的测试数；终验写明跑了哪些命令、多少个用例。没做的也写进去，比如表详情页那份 plan 写着“未做：真实后端下的运行时核验……本任务证据为单测 + 类型检查 + 构建”。",{"type":23,"tag":50,"props":2479,"children":2481},{"id":2480},"codex-上夜班",[2482],{"type":28,"value":2483},"Codex 上夜班",{"type":23,"tag":24,"props":2485,"children":2486},{},[2487],{"type":28,"value":2488},"Codex 这边，我写了一个夜间 Runner，专门跑目标明确、不用人盯的任务。它把 Codex CLI 变成一个任务队列，晚上挨个执行，早上我看报告验收。",{"type":23,"tag":24,"props":2490,"children":2491},{},[2492],{"type":23,"tag":65,"props":2493,"children":2496},{"alt":2494,"src":2495},"Codex 夜间 Runner 的流程：任务文件是普通 Markdown，分背景、要求、验收三段；进串行队列一次只跑一个，避免多个 Codex 同时改同一个工作区；codex exec 执行，默认 workspace-write sandbox；输出里出现 429、usage limit、insufficient_quota 时进入等待，有 Retry-After 按它等，否则等 1800 秒，然后 codex exec resume 接回同一个 session；任务结束按改动所在模块跑 mvn compile 或 npm run build，再跑下一个任务；早报里有执行前后的 git status、diff stat、每个任务的 session id 和日志位置，夜里不部署、不 push、不 commit","\u002Fimages\u002Fblog\u002Fai-assisted-genesis\u002Fnight-runner.svg",[],{"type":23,"tag":24,"props":2498,"children":2499},{},[2500,2502,2507,2509,2514],{"type":28,"value":2501},"任务文件就是普通 Markdown，模板只有三段：背景，写现象和相关的页面或接口；要求，写只修这个问题、不做无关的重构、不部署、不提交 commit；验收，写后端改动跑 ",{"type":23,"tag":99,"props":2503,"children":2505},{"className":2504},[],[2506],{"type":28,"value":2283},{"type":28,"value":2508},"、前端改动跑 ",{"type":23,"tag":99,"props":2510,"children":2512},{"className":2511},[],[2513],{"type":28,"value":2298},{"type":28,"value":2515},"，最后说明改了哪些文件、验证结果如何、还有什么风险。",{"type":23,"tag":24,"props":2517,"children":2518},{},[2519],{"type":28,"value":2520},"几个设计上的选择：",{"type":23,"tag":399,"props":2522,"children":2523},{},[2524,2529,2573,2586],{"type":23,"tag":403,"props":2525,"children":2526},{},[2527],{"type":28,"value":2528},"任务一个接一个跑，不并发。说明文档里写的理由是，避免多个 Codex 同时改同一个工作区。",{"type":23,"tag":403,"props":2530,"children":2531},{},[2532,2534,2540,2542,2548,2549,2555,2557,2563,2565,2571],{"type":28,"value":2533},"碰到额度用完就等着，等完接着跑原来那个会话。Runner 认得 ",{"type":23,"tag":99,"props":2535,"children":2537},{"className":2536},[],[2538],{"type":28,"value":2539},"429",{"type":28,"value":2541},"、",{"type":23,"tag":99,"props":2543,"children":2545},{"className":2544},[],[2546],{"type":28,"value":2547},"usage limit",{"type":28,"value":2541},{"type":23,"tag":99,"props":2550,"children":2552},{"className":2551},[],[2553],{"type":28,"value":2554},"insufficient_quota",{"type":28,"value":2556}," 这类信号，服务端给了 ",{"type":23,"tag":99,"props":2558,"children":2560},{"className":2559},[],[2561],{"type":28,"value":2562},"Retry-After",{"type":28,"value":2564}," 就按它等，没给就默认等 1800 秒，然后用 ",{"type":23,"tag":99,"props":2566,"children":2568},{"className":2567},[],[2569],{"type":28,"value":2570},"codex exec resume",{"type":28,"value":2572}," 恢复原来的 session，做到一半的上下文都还在，不用从头再来。",{"type":23,"tag":403,"props":2574,"children":2575},{},[2576,2578,2584],{"type":28,"value":2577},"边界直接写进 prompt：禁止自动部署、push、commit 和会破坏 Git 历史的命令。默认用 ",{"type":23,"tag":99,"props":2579,"children":2581},{"className":2580},[],[2582],{"type":28,"value":2583},"workspace-write",{"type":28,"value":2585}," 这一档 sandbox，只能改工作区里的文件，要完整的本机权限得显式打开。",{"type":23,"tag":403,"props":2587,"children":2588},{},[2589,2591,2596,2598,2603],{"type":28,"value":2590},"早报要带证据：执行前后的 git status、diff stat，每个任务的 session id 和日志位置。Runner 还会看改动落在哪个模块，分别跑 ",{"type":23,"tag":99,"props":2592,"children":2594},{"className":2593},[],[2595],{"type":28,"value":2283},{"type":28,"value":2597}," 或 ",{"type":23,"tag":99,"props":2599,"children":2601},{"className":2600},[],[2602],{"type":28,"value":2298},{"type":28,"value":287},{"type":23,"tag":24,"props":2605,"children":2606},{},[2607],{"type":28,"value":2608},"夜里不产生提交，早上看完报告和 diff，再决定留不留。",{"type":23,"tag":50,"props":2610,"children":2612},{"id":2611},"测试全绿之后",[2613],{"type":28,"value":2611},{"type":23,"tag":24,"props":2615,"children":2616},{},[2617],{"type":28,"value":2618},"规格和门禁能保证按计划做完，保证不了计划里的假设是对的。",{"type":23,"tag":24,"props":2620,"children":2621},{},[2622],{"type":28,"value":2623},"主线体验一期部署以后，我让智能体在生产环境把整条链路真调了一遍：API 这层用两个账号直接调，浏览器这层用 Playwright 一路截图。两小时里挖出五个 P0（最高优先级）的断链，其中四个当场修好上线。spec 里对它们的描述是，全部带着“静态检查与单测全绿、真实链路断死”的特征，而且层层互相掩护：上游断在那里，下游的缺陷就根本没机会触发。",{"type":23,"tag":24,"props":2625,"children":2626},{},[2627],{"type":23,"tag":65,"props":2628,"children":2631},{"alt":2629,"src":2630},"测试全绿、真实链路却断在三处：提交、审核、自动发布、发布到 DS、运行这条链上，① 审核死锁，提交时不指定审核人就回退成提交者自己审，再叠加禁止自审；② 自动发布必败，审核通过后的自动发布被提交者持有的锁拦住，一直被 ① 挡着没暴露；③ SQL 节点从没真正发布成功过，任务参数结构不对，DolphinScheduler 必然拒绝，之前的成功要么是演示数据里的假编码，要么工作流编码为空","\u002Fimages\u002Fblog\u002Fai-assisted-genesis\u002Fgreen-but-broken.svg",[],{"type":23,"tag":24,"props":2633,"children":2634},{},[2635],{"type":28,"value":2636},"图里是其中三个：",{"type":23,"tag":399,"props":2638,"children":2639},{},[2640,2645,2650],{"type":23,"tag":403,"props":2641,"children":2642},{},[2643],{"type":28,"value":2644},"提交时不指定审核人，系统就回退成提交者自己审，再叠加「禁止自审」这条规则，审核直接卡死；",{"type":23,"tag":403,"props":2646,"children":2647},{},[2648],{"type":28,"value":2649},"审核通过后会自动发布，可发布被提交者持有的锁拦住了，两个人审核的场景下自动发布必败。只是它一直被上一个问题挡着，从来没暴露过；",{"type":23,"tag":403,"props":2651,"children":2652},{},[2653],{"type":28,"value":2654},"单个 SQL 节点发布到真实的 DolphinScheduler，从来没成功过：任务参数的结构不对，DS 必然拒绝。之前看到的「成功」都是假象，要么是演示数据里的假编码，要么工作流编码是空的，真正跑通的全是 SHELL 节点。",{"type":23,"tag":24,"props":2656,"children":2657},{},[2658],{"type":28,"value":2659},"第三个是在 Phase 4 修掉的，做法是把 SQL 节点包成一个调用 beeline（Hive 自带的命令行客户端）的 SHELL 任务。生产复验那条记录写的是“平台史上第一个真正发布并运行成功的单 SQL 节点”。",{"type":23,"tag":24,"props":2661,"children":2662},{},[2663,2665,2670],{"type":28,"value":2664},"对着代码核实的时候，还查出过同一类问题：发布记录的状态写死成 SUCCESS，整个仓库没有一处把它设成 FAILED；审核通过后，“已自动发布到生产”的通知比发布动作先发出去，发布出了异常被 catch 住，只打一行 warn。spec 把后面这个称作“状态是结果，不是意图”最典型的反例。9 月的两份 plan 修的也是这一类：表详情页的子查询失败时，填了一组零值冒充结果，页面上一切正常；还有两个 Tab 一直读错了数据源，给它们准备好的懒加载接口从来没人调过。这一块我单独写过：",{"type":23,"tag":41,"props":2666,"children":2667},{"href":1834},[2668],{"type":28,"value":2669},"表详情页说真话",{"type":28,"value":287},{"type":23,"tag":24,"props":2672,"children":2673},{},[2674],{"type":28,"value":2675},"审查意见也得自己重新量一遍，不能光听。表上下文服务那份 plan 里，审查指出线程池的队列容量设成 100 时，Java 线程池要先把这 100 个排队位置占满才会加线程，配好的拒绝策略基本用不上，于是先收到 32，最后定在 16。湖仓组件启动隔离那份 plan 的第一个任务过了四轮审查才关掉，规格审查和质量审查的结论里都注明是“measuring rather than accepting the implementer's account”，意思是自己动手测了，没有照单收下实现者的说法。",{"type":23,"tag":24,"props":2677,"children":2678},{},[2679,2681,2687],{"type":28,"value":2680},"动生产由我逐次放行。Hudi 和 Iceberg 上线前要先过 canary，也就是先在小范围试跑。第三次卡在 HDFS 上一串必需的父目录从来没建过；第四次是从别处复制来的启动环境脚本把路径指回了旧的安装目录，PID 是空的也没被拦下来。两次都停在切生产之前，修好以后要先过两轮独立审查才允许再试。启动隔离那份 plan 里写着“Passing local gates are not deployment approval.”，本地门禁全过不等于可以上生产。截至 9 月的记录，生产一直没有切过去，经过记在",{"type":23,"tag":41,"props":2682,"children":2684},{"href":2683},"\u002Fblog\u002F2026-09-12-genesis-lakehouse-hudi-iceberg\u002F",[2685],{"type":28,"value":2686},"湖仓接入",{"type":28,"value":2688},"那篇里。",{"type":23,"tag":24,"props":2690,"children":2691},{},[2692],{"type":28,"value":2693},"所以有人说「全绿」的时候，得问清是哪一种绿。单测、类型检查、构建、逐个提交编译、生产走查，各自证明的东西不一样。plan 里大多写明了跑了什么、没跑什么，回头查问题的时候，这些记录比「已完成」三个字有用得多。",{"type":23,"tag":50,"props":2695,"children":2697},{"id":2696},"几个会话挤在一个工作区",[2698],{"type":28,"value":2696},{"type":23,"tag":24,"props":2700,"children":2701},{},[2702],{"type":28,"value":2703},"8 月下旬，有三个会话共用同一个工作区和暂存区，没提交的文件一度堆到 118 个，只好专门开一个会话来拆分提交。主线体验那份 spec 干脆把「等工作区清干净」列成了 Phase 0 的硬前置条件。规矩也跟着收紧：每个任务只 add 自己的文件，add 完立刻提交。",{"type":23,"tag":24,"props":2705,"children":2706},{},[2707],{"type":28,"value":2708},"有一次提交漏了一个还没被 Git 跟踪的新文件，工作区里测试全绿，可单独把那个提交检出来就编译不过。从那以后，每个提交都要在干净的 worktree 里单独验证。Phase 1 中途还碰上过一次外部的整文件回退。",{"type":23,"tag":24,"props":2710,"children":2711},{},[2712],{"type":28,"value":2713},"主线体验这几期最后都是在当前会话里直接执行的，没用子代理并发，plan 里写的理由是“三会话共享工作区，时序需人工掌控”。可隔离也有代价：Tushare 接入那份 plan 要用的一个工具类，只存在于另一个会话还没提交的改动里，所在分支上根本看不到，最后只好改成完全自包含的实现。这两头出的事，根子都在改动没有及时变成提交。",{"type":23,"tag":50,"props":2715,"children":2717},{"id":2716},"规则文件自己也会写错",[2718],{"type":28,"value":2716},{"type":23,"tag":24,"props":2720,"children":2721},{},[2722],{"type":28,"value":2723},"开发规范里写前端用 Element Plus，AGENTS.md 和前端相关的 plan 写的都是 Ant Design Vue。开发规范要求大改动先写 OpenSpec proposal 或者一份简短的设计说明，CLAUDE.md 却把设计和计划交给 superpowers，同一件事有两套约定。湖仓那份 spec 盘点现场时还发现，集群规划文档里同时写着两个 Iceberg 版本。这些文件都是写给智能体读的，集群规划文档在 CLAUDE.md 里还被列为权威信息源。",{"type":23,"tag":24,"props":2725,"children":2726},{},[2727],{"type":28,"value":2728},"所以 spec 里的「现状核实」、plan 里的「关键事实」，都要对着代码和现场重新核一遍，不能只信文件。",{"type":23,"tag":2730,"props":2731,"children":2732},"style",{},[2733],{"type":28,"value":2734},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":924,"depth":924,"links":2736},[2737,2738,2739,2743,2744,2745,2746],{"id":2068,"depth":927,"text":2071},{"id":2120,"depth":927,"text":2120},{"id":2339,"depth":927,"text":2339,"children":2740},[2741,2742],{"id":2367,"depth":924,"text":2370},{"id":2451,"depth":924,"text":2454},{"id":2480,"depth":927,"text":2483},{"id":2611,"depth":927,"text":2611},{"id":2696,"depth":927,"text":2696},{"id":2716,"depth":927,"text":2716},"content:blog:2026-10-12-ai-assisted-genesis.md","blog\u002F2026-10-12-ai-assisted-genesis.md","blog\u002F2026-10-12-ai-assisted-genesis",{"_path":2751,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":2752,"description":2753,"date":2754,"tags":2755,"body":2759,"_type":937,"_id":3338,"_source":939,"_file":3339,"_stem":3340,"_extension":942},"\u002Fblog\u002F2026-10-09-genesis-intelligent-governance","让守规范变成最省事的做法：Genesis 智能化与降本增效方案","上手难、活多、规范难守，根子是规范在平台里属于额外的活。方案想把命名、检查、监控改成默认就发生，目前只落地了表上下文服务，其余几项哪些在计划里、哪些还是候选，都标出来了。","2026-10-09",[46,2756,2757,2758],"数据治理","降本增效","平台设计",{"type":20,"children":2760,"toc":3325},[2761,2766,2771,2776,2781,2786,2799,2804,2809,2814,2819,2825,2830,2835,2840,2845,2850,2855,2888,2893,2898,2906,2911,2916,2921,2926,2931,2936,2941,2946,2951,2956,2992,2997,3002,3007,3013,3018,3023,3028,3036,3041,3054,3059,3064,3069,3092,3097,3102,3107,3112,3117,3122,3135,3146,3151,3156,3161,3169,3192,3197,3218,3223,3228,3315,3320],{"type":23,"tag":24,"props":2762,"children":2763},{},[2764],{"type":28,"value":2765},"Genesis 是我在做的一站式数据平台，面向中小团队自部署，产品形态参照 DataWorks。功能铺到一定程度以后，缺功能反倒不是最大的问题了，拖住人的是三件事：新人上手难，日常的活太多，规范很难守住。",{"type":23,"tag":24,"props":2767,"children":2768},{},[2769],{"type":28,"value":2770},"今年 9 月我把这三件事和对应的设计写成了一份方案，想做的就一条：让守规范成为最省事的那条路。下面的内容按那份方案整理，跟环境、账号有关的都删了；哪些已经落地、哪些还停在纸面上，每一项我都标出来。",{"type":23,"tag":50,"props":2772,"children":2774},{"id":2773},"现在各自卡在哪",[2775],{"type":28,"value":2773},{"type":23,"tag":24,"props":2777,"children":2778},{},[2779],{"type":28,"value":2780},"下面这些现状，写方案时都对着代码核过。",{"type":23,"tag":24,"props":2782,"children":2783},{},[2784],{"type":28,"value":2785},"新人做对一件事要跨六个模块。开发一个新指标并上线，标准路径是六步：OneData 建模、IDE 写 SQL、质量页配规则、提交审核、发布、到运维中心看 Incident。新人得先知道数据域、词根、命名规范、模型、契约、新鲜度监控分别在哪个菜单，才做得出一张合规的表。平台把治理能力做成了六个并列的工具箱，没有铺出一条路。",{"type":23,"tag":24,"props":2787,"children":2788},{},[2789,2791,2797],{"type":28,"value":2790},"资深开发碰到的问题是检查来得太晚，而且只会说不行。写方案时，发布前有 9 个检查器（",{"type":23,"tag":99,"props":2792,"children":2794},{"className":2793},[],[2795],{"type":28,"value":2796},"PrePublishChecker",{"type":28,"value":2798},"）串成预检，覆盖命名、词根、字段、SQL 语法、数据质量等，但它们只在发布那一刻跑。（后来又加了调度参数占位符和调度引擎可用性两项，现在是 11 个。）开发者写完 SQL、试跑、提交、等审核，到发布时才被告知\"表名不符合命名规范\"，这时候改名就意味着 SQL、模型、审核记录全部返工。IDE 里已经有 Problems 面板，可预检结果不进去，也没有一键修复。",{"type":23,"tag":24,"props":2800,"children":2801},{},[2802],{"type":28,"value":2803},"运维这边，监控要逐表手开，故障要靠人拼。可观测能力本身是齐的：每 30 分钟一轮的新鲜度巡检（数据有没有按时更新）、Schema 漂移检测（表结构有没有被悄悄改）、数据剖析、异常基线，还能从剖析结果推出规则建议。问题是每一项都要人工逐表注册：新鲜度要手动登记，质量规则要逐条建，契约要手填三段 JSON。一张表发布以后，默认什么都没监控，表越多配置量越大，而大部分表永远不会有人去配。",{"type":23,"tag":24,"props":2805,"children":2806},{},[2807],{"type":28,"value":2808},"出故障时 Incident 链路是通的，但一次故障要回答四个问题：哪张表坏了、谁改的、影响几张下游、该通知谁。答案散在 Incident、血缘、发布历史和代码评审四处，全靠人脑拼。",{"type":23,"tag":24,"props":2810,"children":2811},{},[2812],{"type":28,"value":2813},"AI 助手只读、只答，看不到治理信息。Agent 框架能用，但全局 Agent 实际只注册了 4 个只读工具（类注释里写的是 10 个），IDE 助手又在内部另注册了一套名字不同、功能重叠的工具。Agent 知道表结构，却不知道这张表的规范绑定、契约、健康度、最近发布和 Owner，而这些数据就在同一个 MySQL 里。",{"type":23,"tag":24,"props":2815,"children":2816},{},[2817],{"type":28,"value":2818},"这几条拆开看原因各不相同。新人上手难，是因为治理能力按模块并列，没有默认路径；活多，是因为监控、规则、契约全靠人工逐表配，默认为空；规范守不住，是因为卡口到发布时才生效，只拦不修，绕过去比遵守还省事。可它们背后是同一件事：规范和质量在平台里属于额外要做的事，不会默认发生。整份方案就是要把它反过来。",{"type":23,"tag":50,"props":2820,"children":2822},{"id":2821},"三条路我选了最不起眼的那条",[2823],{"type":28,"value":2824},"三条路，我选了最不起眼的那条",{"type":23,"tag":24,"props":2826,"children":2827},{},[2828],{"type":28,"value":2829},"能走的路有三条。",{"type":23,"tag":24,"props":2831,"children":2832},{},[2833],{"type":28,"value":2834},"第一条是继续补功能广度：更多规则类型、更多页面、更多向导。我没选。跟 DataWorks 拼功能广度是最容易做死的路，每多一个页面，新人就多一个概念要学。",{"type":23,"tag":24,"props":2836,"children":2837},{},[2838],{"type":28,"value":2839},"第二条是全面 Agent 化，一切走对话，告诉 AI 你要什么就行。也没选：新人不知道该问什么；模型输出不可控，规范保证不了；私有部署模型的工具调用也还没做过回归。",{"type":23,"tag":24,"props":2841,"children":2842},{},[2843],{"type":28,"value":2844},"我选的是第三条：规范内建的默认路径，加上自动化默认值，再让 Agent 加速。具体做法是把已有的生成、检查、监控能力串成一条\"新建即合规、发布即监控\"的主路径。这条路看着最不起眼，但几乎不用新造能力，复用率最高。",{"type":23,"tag":24,"props":2846,"children":2847},{},[2848],{"type":28,"value":2849},"Agent 在这条路上是加速器：它和页面读同一份上下文、调同一组服务，写操作一律走\"提案 → 审批 → 执行 → 审计\"。真要说省了什么，省下的主要是人的时间：逐表配监控，发布时才发现命名不对的返工，处理本来可以自动重跑的抖动。",{"type":23,"tag":24,"props":2851,"children":2852},{},[2853],{"type":28,"value":2854},"方案里定了六条设计原则，后面每一项设计都拿它们对照：",{"type":23,"tag":890,"props":2856,"children":2857},{},[2858,2863,2868,2873,2878,2883],{"type":23,"tag":403,"props":2859,"children":2860},{},[2861],{"type":28,"value":2862},"默认即规范（Paved Road）：合规的路径必须是最省力的路径。用户不需要知道词根是什么，也能拿到一个用了已审批词根的表名。",{"type":23,"tag":403,"props":2864,"children":2865},{},[2866],{"type":28,"value":2867},"规范前移（Shift-Left）：能在编辑器里报的不留到提交，能在提交时报的不留到发布。发布卡口是最后一道网，不该是第一道。",{"type":23,"tag":403,"props":2869,"children":2870},{},[2871],{"type":28,"value":2872},"发布即监控（Zero-Config Observability）：表进生产的同时，监控和基础规则自动就位，人只做调整。",{"type":23,"tag":403,"props":2874,"children":2875},{},[2876],{"type":28,"value":2877},"一份上下文，两种消费者：一张表的全部知识由一个服务聚合，页面和 Agent 读同一份。",{"type":23,"tag":403,"props":2879,"children":2880},{},[2881],{"type":28,"value":2882},"自动化必须可解释、可撤销、可变红：自动产物标明依据，可以一键关掉，交付时附上故意制造的失败确实变红的证据。",{"type":23,"tag":403,"props":2884,"children":2885},{},[2886],{"type":28,"value":2887},"不新造能力，先串已有能力：确实要新建，先说明现有的为什么不够用。",{"type":23,"tag":24,"props":2889,"children":2890},{},[2891],{"type":28,"value":2892},"第 5 条是被教训逼出来的。8 月做存量清理时，我记下了 11 处绿灯断链：代码在、测试全绿，功能却从没生效，也不报错，比如命名检查器恒返回通过、契约校验是占位实现。这些后来都修了，但自动化越多，这种失效越危险，所以每一项设计我都写了变红场景，也就是\"故意弄坏它，它必须报错\"的测试。",{"type":23,"tag":50,"props":2894,"children":2896},{"id":2895},"目标架构",[2897],{"type":28,"value":2895},{"type":23,"tag":24,"props":2899,"children":2900},{},[2901],{"type":23,"tag":65,"props":2902,"children":2905},{"alt":2903,"src":2904},"智能化方案的目标架构：意图层（建表向导、任务脚手架、全局 Agent、IDE 助手）、生成层（命名生成、DDL 生成、标准字段模板、ETL 骨架、规则建议、契约起草、调度建议，标蓝，规范放在这一层）、卡口层（编辑期 Lint、提交期、发布期、运行期）、运行与自愈层（发布即监控、失败分类与重试、挂起检测、根因链路、值班报告、Agent 写操作审批）自上而下单向依赖；左侧虚线表示手工建节点跳过生成层但绕不开卡口；右侧是横切四层的表上下文服务，四层读，运行层写","\u002Fimages\u002Fblog\u002Fgenesis-governance\u002Ftarget-layers.svg",[],{"type":23,"tag":24,"props":2907,"children":2908},{},[2909],{"type":28,"value":2910},"目标架构是四层，外加一个横切的表上下文服务。",{"type":23,"tag":24,"props":2912,"children":2913},{},[2914],{"type":28,"value":2915},"意图层负责接住用户想干什么，比如\"我要一张 DWD 交易明细表，按天分区\"，部件有建表向导、任务脚手架、全局 Agent（Cmd+K）、IDE 助手。生成层把规范内建在产物里，包括命名生成、DDL 生成、标准字段模板、ETL 骨架、规则建议、契约起草、调度建议。卡口层分阶段检查，越早越宽松：编辑期 Lint → 提交期 → 发布期（写方案时的 9 个既有检查器，加规划中的契约卡口）→ 运行期。运行与自愈层管表上线之后的事，包括发布即监控、失败分类与重试、挂起检测、根因链路、值班报告、Agent 写操作审批。",{"type":23,"tag":24,"props":2917,"children":2918},{},[2919],{"type":28,"value":2920},"表上下文服务横切四层，汇总一张表的全部知识：结构、规范绑定、血缘、质量、契约、健康度、Incident、发布、Owner。",{"type":23,"tag":24,"props":2922,"children":2923},{},[2924],{"type":28,"value":2925},"依赖是单向的：意图层调生成层，生成层的产物进卡口层，卡口放行后进入运行层；表上下文服务被四层共同读取，只由运行层写入。",{"type":23,"tag":24,"props":2927,"children":2928},{},[2929],{"type":28,"value":2930},"规范放在生成层，没写在哪个页面里。向导和 Agent 调同一组生成服务；手工建节点的人跳过了生成层，也绕不开同一组卡口。入口可以有很多个，规范只有一份。",{"type":23,"tag":50,"props":2932,"children":2934},{"id":2933},"方案拆开看",[2935],{"type":28,"value":2933},{"type":23,"tag":24,"props":2937,"children":2938},{},[2939],{"type":28,"value":2940},"方案一共七项，这里讲其中五项，按用户碰到它的先后排。每一项要解决的都是同一件事：让合规的做法比绕过去更省事。",{"type":23,"tag":76,"props":2942,"children":2944},{"id":2943},"建表向导",[2945],{"type":28,"value":2943},{"type":23,"tag":24,"props":2947,"children":2948},{},[2949],{"type":28,"value":2950},"命名、建模、DDL、ETL 骨架、规则、调度，这六样能力其实都有：命名生成（HanLP 分词加词根匹配，AI 翻译补候选）、OneData 表设计、按分层注入审计字段的 DDL 生成、标准字段模板、剖析驱动的规则建议、调度建议 Agent。缺的是把它们串起来的入口。命名也没打算交给纯 LLM：词根审批是规范的锚，LLM 只出翻译候选。",{"type":23,"tag":24,"props":2952,"children":2953},{},[2954],{"type":28,"value":2955},"设计是在 IDE 文件树的\"新建\"里加一项\"新建数据表（向导）\"，五步，每步都能跳过、能回退：",{"type":23,"tag":890,"props":2957,"children":2958},{},[2959,2964,2969,2982,2987],{"type":23,"tag":403,"props":2960,"children":2961},{},[2962],{"type":28,"value":2963},"意图：用户写一句中文描述（比如\"交易订单明细，按天分区\"）并选分层；平台推断数据域和频次后缀，生成标准表名，标出每段用了哪个词根、哪些待审批。",{"type":23,"tag":403,"props":2965,"children":2966},{},[2967],{"type":28,"value":2968},"字段：勾选上游表或手填；平台从上游拉字段，按模板补审计和分区字段，字段名走同一套命名生成。",{"type":23,"tag":403,"props":2970,"children":2971},{},[2972,2974,2980],{"type":28,"value":2973},"DDL 与 ETL 骨架：用户确认；平台生成 DDL 节点和带 ",{"type":23,"tag":99,"props":2975,"children":2977},{"className":2976},[],[2978],{"type":28,"value":2979},"INSERT OVERWRITE ... PARTITION",{"type":28,"value":2981}," 骨架的 SQL 节点，SELECT 列表按字段映射填好。",{"type":23,"tag":403,"props":2983,"children":2984},{},[2985],{"type":28,"value":2986},"质量与契约：勾选默认项；平台加主键 NOT_NULL \u002F UNIQUE、分区日期 RANGE、行数异常基线，外加一份契约草稿。",{"type":23,"tag":403,"props":2988,"children":2989},{},[2990],{"type":28,"value":2991},"调度：选频次；平台根据上游节点推荐依赖和 cron。",{"type":23,"tag":24,"props":2993,"children":2994},{},[2995],{"type":28,"value":2996},"走完会产出一份表设计（可选进 OneData）、DDL 和 ETL 两个开发节点、若干条标注\"来自向导\"的质量规则和一份草稿契约，都能回到各自模块继续编辑，向导本身不引入新的存储。目标是新人照着走，拿到的表默认就合规。",{"type":23,"tag":24,"props":2998,"children":2999},{},[3000],{"type":28,"value":3001},"变红场景：描述里出现未审批的词根时，第 1 步必须显示\"待审批\"并且不许跳过；命名生成服务抛异常时，向导必须报错，不能给出空表名。验收看向导产出的表首次预检零 BLOCK 的比例（目标 ≥ 90%），以及新人从零到首张合规表上线的用时（目标是建立基线后减半）。",{"type":23,"tag":24,"props":3003,"children":3004},{},[3005],{"type":28,"value":3006},"这一项还只是设计，没实现。它是候选项，做不做看新人观察的结论：如果新人在建表环节卡得最久，它就排第一。",{"type":23,"tag":76,"props":3008,"children":3010},{"id":3009},"编辑期-lint",[3011],{"type":28,"value":3012},"编辑期 Lint",{"type":23,"tag":24,"props":3014,"children":3015},{},[3016],{"type":28,"value":3017},"检查器的接口不动，只加一个\"支持哪些阶段\"的声明。命名、词根、字段、SQL 语法这类纯静态检查，只看代码本身就能判断，在编辑、提交、发布三个阶段都跑；表存在性、数据源、数据质量、Catalog 绑定这类要连数据源的，还是只在发布期跑，免得编辑时去打远端。",{"type":23,"tag":24,"props":3019,"children":3020},{},[3021],{"type":28,"value":3022},"新增的 lint 接口只跑编辑期检查器，在内存里算，不落库。前端在保存时和停止输入 2 秒后调用，结果进 Problems 面板。检查结果加一个可选的修复字段，命名类检查器把建议名放进去，面板上就出现\"应用修复\"按钮。修复只是建议，点了才生效，但总比到发布时再返工省事。",{"type":23,"tag":24,"props":3024,"children":3025},{},[3026],{"type":28,"value":3027},"同一个检查项，越早越宽松，越晚越严格，下图是方案里那张表的节选：",{"type":23,"tag":24,"props":3029,"children":3030},{},[3031],{"type":23,"tag":65,"props":3032,"children":3035},{"alt":3033,"src":3034},"检查前移设计：上方红框是现状，检查器只在发布那一刻跑，表名不对就要全部返工；中间表格是同一检查项在编辑期、提交期、发布期的级别：表和字段命名模式编辑期 WARN 带修复建议、之后 BLOCK，词根合规编辑期 WARN 带待审批提示、之后 BLOCK，字段合规编辑期和提交期 WARN、发布期 BLOCK，SQL 语法编辑期行内 WARN、之后 BLOCK，已生效的数据契约编辑期不查、提交期 WARN 预告违约、发布期 BLOCK 可豁免；底部是 STRICT、STANDARD（缺省）、RELAXED 三个档位","\u002Fimages\u002Fblog\u002Fgenesis-governance\u002Fshift-left.svg",[],{"type":23,"tag":24,"props":3037,"children":3038},{},[3039],{"type":28,"value":3040},"项目还能整体调档：STRICT 完全按上图，STANDARD 把提交期全部降为 WARN，RELAXED 只保留发布期 BLOCK。缺省是 STANDARD，因为建模规范在 Genesis 里是可选的加速器，没打算做成必经关卡。",{"type":23,"tag":24,"props":3042,"children":3043},{},[3044,3046,3052],{"type":28,"value":3045},"最大的风险是拖慢编辑器，所以只跑静态检查、加 2 秒防抖，验收要求 lint 接口 P95 ≤ 300ms，达不到就降级成只在保存时触发。变红场景：故意写 ",{"type":23,"tag":99,"props":3047,"children":3049},{"className":3048},[],[3050],{"type":28,"value":3051},"dwd_order",{"type":28,"value":3053},"（缺数据域、缺频次后缀），保存后 2 秒内面板必须出现命名警告和建议名；把命名检查器改成恒返回通过（这事真发生过），lint 单测必须失败。",{"type":23,"tag":24,"props":3055,"children":3056},{},[3057],{"type":28,"value":3058},"这一项也还在设计阶段，和建表向导一样是候选。",{"type":23,"tag":76,"props":3060,"children":3062},{"id":3061},"发布即监控",[3063],{"type":28,"value":3061},{"type":23,"tag":24,"props":3065,"children":3066},{},[3067],{"type":28,"value":3068},"表发布到生产时，自动做四件事：",{"type":23,"tag":399,"props":3070,"children":3071},{},[3072,3077,3082,3087],{"type":23,"tag":403,"props":3073,"children":3074},{},[3075],{"type":28,"value":3076},"注册新鲜度监控：由 cron 推导更新周期，SLA = 周期 × 1.5，系数可调。",{"type":23,"tag":403,"props":3078,"children":3079},{},[3080],{"type":28,"value":3081},"打 Schema 快照：发布后立即快照，之后交给已有的巡检比对。",{"type":23,"tag":403,"props":3083,"children":3084},{},[3085],{"type":28,"value":3086},"剖析并记基线：首次发布后异步剖析一次，记入异常基线；分区表只剖析最新分区。",{"type":23,"tag":403,"props":3088,"children":3089},{},[3090],{"type":28,"value":3091},"生成基础质量规则：只在非空率 100% 的列加 NOT_NULL、唯一率 100% 的列加 UNIQUE，描述里写明依据哪次剖析。",{"type":23,"tag":24,"props":3093,"children":3094},{},[3095],{"type":28,"value":3096},"自动产物都带\"自动\"标记，在界面上和人工配置分开，可以一键接受成人工规则；项目级和表级都能关，用户删掉的自动规则不会被重建。",{"type":23,"tag":24,"props":3098,"children":3099},{},[3100],{"type":28,"value":3101},"约束里最重要的一条：自动规则固定为 WARN，绝不生成 BLOCK 级规则。剖析样本有偏差，自动规则一旦能拦发布，就会引发对卡口的反弹；自动化一旦开始制造噪音，用户就会无视告警，那比没有监控还糟。契约也一样，只起草、不自动生效：草稿取当前列清单、推导出的 SLA 和当前启用的规则，通知表 Owner 审阅，Owner 点了生效才参与发布卡口。",{"type":23,"tag":24,"props":3103,"children":3104},{},[3105],{"type":28,"value":3106},"变红场景：发布后把 cron 停掉，超过 SLA 新鲜度必须变成 STALE 并进入健康度；剖析返回空结果时不得生成任何规则，并且要打警告日志。验收看生产表\"至少有一项监控\"的覆盖率（目标 ≥ 90%），以及自动规则误报率，也就是被用户关掉的占比（目标 ≤ 20%，超过就收紧生成条件）。",{"type":23,"tag":24,"props":3108,"children":3109},{},[3110],{"type":28,"value":3111},"这一项同样没实现。它要排在健康度物化前面，不然信号源默认为空，物化出来全是 UNKNOWN。",{"type":23,"tag":76,"props":3113,"children":3115},{"id":3114},"表上下文服务",[3116],{"type":28,"value":3114},{"type":23,"tag":24,"props":3118,"children":3119},{},[3120],{"type":28,"value":3121},"原来表详情页的聚合逻辑写在 Controller 里，Agent 拿不到，各个工具只能各拼各的上下文。",{"type":23,"tag":24,"props":3123,"children":3124},{},[3125,3127,3133],{"type":28,"value":3126},"设计是把聚合下沉成独立的表上下文服务（",{"type":23,"tag":99,"props":3128,"children":3130},{"className":3129},[],[3131],{"type":28,"value":3132},"TableContextService",{"type":28,"value":3134},"），调用方用 Scope 声明要哪几段，比如结构、血缘、质量、契约、Owner。每段单独超时，失败时明确返回 TIMEOUT 或 ERROR，不许返回 null 假装没有数据。血缘服务超时的时候，Agent 必须说\"血缘信息暂不可用\"，不能说\"没有下游\"。在这之上再给 Agent 加一个读上下文的工具，IDE 助手和全局 Agent 共用一份工具注册。运维那四个问题（哪张表坏了、谁改的、影响几张下游、该通知谁），其实就是这个服务的几个 Scope，根因链路和值班 Agent 都建在它上面。",{"type":23,"tag":24,"props":3136,"children":3137},{},[3138,3140,3144],{"type":28,"value":3139},"五项里只有它落了地，而且是首批。质量、质量明细、Incident、最近一次生产发布、关联 IDE 节点五个 Scope 已经下沉成独立服务，段状态是 OK \u002F TIMEOUT \u002F ERROR 三态，失败态不会被转成空集合；超时、异常、空数据、线程池拒绝四类失败都有变红测试。截至 10 月初，这部分已经在生产版本里。实现过程写在",{"type":23,"tag":41,"props":3141,"children":3142},{"href":1834},[3143],{"type":28,"value":2669},{"type":28,"value":3145},"那篇。",{"type":23,"tag":24,"props":3147,"children":3148},{},[3149],{"type":28,"value":3150},"前端随后改成按段状态展示：某段拿不到、又没有已知异常时，健康点判灰，并说明是哪段不可用；整个请求失败时显示\"加载失败\"，不再谎报\"无权限\"或\"无数据\"。排查时还修掉了表详情页六处更早就存在的断链。这部分代码已经合入，但截至 10 月初还不在生产版本里。",{"type":23,"tag":76,"props":3152,"children":3154},{"id":3153},"失败分类",[3155],{"type":28,"value":3153},{"type":23,"tag":24,"props":3157,"children":3158},{},[3159],{"type":28,"value":3160},"现在所有失败都一视同仁地建 Incident，网络抖动和 SQL 逻辑错误得到的是同样的人工处置。设计是建 Incident 之前，先按规则表从任务日志尾部分个类。",{"type":23,"tag":24,"props":3162,"children":3163},{},[3164],{"type":23,"tag":65,"props":3165,"children":3168},{"alt":3166,"src":3167},"失败分类设计：任务失败后、建 Incident 之前，先按规则表看日志尾部分类，首轮不用 LLM。TRANSIENT（YARN 资源不足、连接超时、Container 被抢占）自动重跑 1 次、间隔 10 分钟，还失败才建 Incident 并注明已重试；DATA（分区不存在、上游为空）和 LOGIC（SQL 语法错误、字段不存在）立即建 Incident 并写入分类；UNKNOWN（规则表没命中）立即建 Incident、永不自动重试，用户点 AI 分析时 LLM 才介入；底部是两个变红场景","\u002Fimages\u002Fblog\u002Fgenesis-governance\u002Ffailure-class.svg",[],{"type":23,"tag":399,"props":3170,"children":3171},{},[3172,3177,3182,3187],{"type":23,"tag":403,"props":3173,"children":3174},{},[3175],{"type":28,"value":3176},"TRANSIENT：YARN 资源不足、连接超时、Container 被抢占这类。自动重跑（缺省 1 次，间隔 10 分钟），还失败才建 Incident，并注明已经重试过。",{"type":23,"tag":403,"props":3178,"children":3179},{},[3180],{"type":28,"value":3181},"DATA：分区不存在、上游为空。立即建 Incident，写入分类。",{"type":23,"tag":403,"props":3183,"children":3184},{},[3185],{"type":28,"value":3186},"LOGIC：SQL 语法错误、字段不存在。处置同 DATA。",{"type":23,"tag":403,"props":3188,"children":3189},{},[3190],{"type":28,"value":3191},"UNKNOWN：规则表没命中。立即建 Incident，永不自动重试。",{"type":23,"tag":24,"props":3193,"children":3194},{},[3195],{"type":28,"value":3196},"首轮分类故意不用 LLM：规则可解释、零延迟、零成本。LLM 只在 UNKNOWN、并且用户主动点\"AI 分析\"时才介入。",{"type":23,"tag":24,"props":3198,"children":3199},{},[3200,3202,3208,3210,3216],{"type":28,"value":3201},"自动重试可能掩盖真实故障，所以只对命中规则的 TRANSIENT 重试，最多一次，并且留记录。变红场景：",{"type":23,"tag":99,"props":3203,"children":3205},{"className":3204},[],[3206],{"type":28,"value":3207},"sleep 1; exit 1",{"type":28,"value":3209}," 的 Shell 节点日志不命中任何规则，必须落成 UNKNOWN 并建 Incident，不得重试；日志里有 ",{"type":23,"tag":99,"props":3211,"children":3213},{"className":3212},[],[3214],{"type":28,"value":3215},"Container killed by YARN",{"type":28,"value":3217}," 的，必须先重试一次再建 Incident。验收看 TRANSIENT 被自动吸收的占比（目标 ≥ 30%）和分类准确率（人工抽检 50 条，目标 ≥ 85%）。",{"type":23,"tag":24,"props":3219,"children":3220},{},[3221],{"type":28,"value":3222},"这一项也还没实现。",{"type":23,"tag":50,"props":3224,"children":3226},{"id":3225},"做到哪了",[3227],{"type":28,"value":3225},{"type":23,"tag":533,"props":3229,"children":3230},{},[3231,3247],{"type":23,"tag":537,"props":3232,"children":3233},{},[3234],{"type":23,"tag":541,"props":3235,"children":3236},{},[3237,3242],{"type":23,"tag":545,"props":3238,"children":3239},{},[3240],{"type":28,"value":3241},"部分",{"type":23,"tag":545,"props":3243,"children":3244},{},[3245],{"type":28,"value":3246},"状态",{"type":23,"tag":561,"props":3248,"children":3249},{},[3250,3263,3276,3289,3302],{"type":23,"tag":541,"props":3251,"children":3252},{},[3253,3258],{"type":23,"tag":568,"props":3254,"children":3255},{},[3256],{"type":28,"value":3257},"表上下文服务首批（5 个 Scope、三态段状态）",{"type":23,"tag":568,"props":3259,"children":3260},{},[3261],{"type":28,"value":3262},"已落地，截至 10 月初在生产版本中",{"type":23,"tag":541,"props":3264,"children":3265},{},[3266,3271],{"type":23,"tag":568,"props":3267,"children":3268},{},[3269],{"type":28,"value":3270},"表详情页按段状态展示，及修掉的 6 处既有断链",{"type":23,"tag":568,"props":3272,"children":3273},{},[3274],{"type":28,"value":3275},"代码已合入，截至 10 月初不在生产版本中",{"type":23,"tag":541,"props":3277,"children":3278},{},[3279,3284],{"type":23,"tag":568,"props":3280,"children":3281},{},[3282],{"type":28,"value":3283},"其余 Scope、Agent 读上下文的工具、工具注册统一",{"type":23,"tag":568,"props":3285,"children":3286},{},[3287],{"type":28,"value":3288},"计划中",{"type":23,"tag":541,"props":3290,"children":3291},{},[3292,3297],{"type":23,"tag":568,"props":3293,"children":3294},{},[3295],{"type":28,"value":3296},"发布即监控、契约自动起草、失败分类与自动重试",{"type":23,"tag":568,"props":3298,"children":3299},{},[3300],{"type":28,"value":3301},"已排进后续批次，未实现",{"type":23,"tag":541,"props":3303,"children":3304},{},[3305,3310],{"type":23,"tag":568,"props":3306,"children":3307},{},[3308],{"type":28,"value":3309},"建表向导、编辑期 Lint 与一键修复、卡口分档",{"type":23,"tag":568,"props":3311,"children":3312},{},[3313],{"type":28,"value":3314},"候选，等新人观察的结论再决定是否启动",{"type":23,"tag":24,"props":3316,"children":3317},{},[3318],{"type":28,"value":3319},"现在落地的只有表上下文这一块，这个顺序是有意排的：根因链路和值班 Agent 都要消费表上下文，它越早越好；契约起草也必须排在契约卡口之前，不然没有契约可卡。",{"type":23,"tag":24,"props":3321,"children":3322},{},[3323],{"type":28,"value":3324},"文中那些 ≥ 90%、≤ 20%、≥ 30% 都还只是目标值，没有实测数据。按方案的纪律，每一项都要先把度量接上再做功能，度量本身也得能在故意制造的失败里变红。",{"title":8,"searchDepth":924,"depth":924,"links":3326},[3327,3328,3329,3330,3337],{"id":2773,"depth":927,"text":2773},{"id":2821,"depth":927,"text":2824},{"id":2895,"depth":927,"text":2895},{"id":2933,"depth":927,"text":2933,"children":3331},[3332,3333,3334,3335,3336],{"id":2943,"depth":924,"text":2943},{"id":3009,"depth":924,"text":3012},{"id":3061,"depth":924,"text":3061},{"id":3114,"depth":924,"text":3114},{"id":3153,"depth":924,"text":3153},{"id":3225,"depth":927,"text":3225},"content:blog:2026-10-09-genesis-intelligent-governance.md","blog\u002F2026-10-09-genesis-intelligent-governance.md","blog\u002F2026-10-09-genesis-intelligent-governance",{"_path":3342,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":3343,"description":3344,"date":3345,"tags":3346,"body":3348,"_type":937,"_id":4649,"_source":939,"_file":4650,"_stem":4651,"_extension":942},"\u002Fblog\u002F2026-10-08-genesis-architecture-adr","改 Genesis 架构之前，我先定下的 6 条决策","后端近 5 万行单体、类覆盖率 11.5%、没有 CI。动手前我先摸清现状，再定下 6 条架构决策和五个阶段的路线，每一步都先想好怎么退。","2026-10-08",[46,14,3347,1504],"ADR",{"type":20,"children":3349,"toc":4631},[3350,3355,3360,3365,3370,3375,3380,3425,3454,3459,3472,3501,3546,3551,3556,3577,3582,3587,3592,3598,3603,3779,3785,3790,3795,3807,3827,3848,3854,3875,3880,3885,3908,3914,3919,3924,3929,3937,3957,3970,3975,3980,3986,3998,4032,4037,4058,4079,4085,4090,4111,4116,4124,4137,4142,4178,4213,4233,4238,4244,4249,4261,4292,4297,4305,4310,4323,4351,4356,4361,4366,4371,4376,4564,4569,4575,4580,4621,4626],{"type":23,"tag":24,"props":3351,"children":3352},{},[3353],{"type":28,"value":3354},"Genesis 是我在做的一站式数据平台，对标 DataWorks，面向中小团队自部署。到 2026 年 8 月，功能已经铺开了，底子却很薄：后端是一个近 5 万行的单模块单体，类测试覆盖率 11.5%，没有 CI，镜像也回滚不了。这时候直接上手重构，改坏了连退路都没有。",{"type":23,"tag":24,"props":3356,"children":3357},{},[3358],{"type":28,"value":3359},"所以我先把现状摸了一遍，再把几处必须拍板的取舍写成 6 条架构决策记录（ADR，Architecture Decision Record：每条写清楚当时的情况、选了什么、没选什么、为什么），排成从止血到云原生的五个阶段。素材是我 2026 年 8 月写的架构优化方案和之后的执行记录，环境和账号相关的部分删掉了。",{"type":23,"tag":50,"props":3361,"children":3363},{"id":3362},"先摸家底",[3364],{"type":28,"value":3362},{"type":23,"tag":24,"props":3366,"children":3367},{},[3368],{"type":28,"value":3369},"方案前期做了 5 项并行调研：后端、前端、部署、调度选型、血缘选型。这里只挑对决策有直接影响的事实。",{"type":23,"tag":76,"props":3371,"children":3373},{"id":3372},"后端",[3374],{"type":28,"value":3372},{"type":23,"tag":24,"props":3376,"children":3377},{},[3378],{"type":28,"value":3379},"后端是单模块 Maven 工程，461 个类、48,575 行；测试 53 个类、7,830 行，类覆盖率 11.5%。20 个业务模块按 feature 分包，但模块之间有依赖环：devnode 和 transfer、engine、lineage、scheduler 互相引用，devnode 被 6 个模块引用，自己又引用了 10 个。",{"type":23,"tag":24,"props":3381,"children":3382},{},[3383,3385,3391,3393,3399,3401,3407,3409,3415,3417,3423],{"type":28,"value":3384},"有两个 God Class，也就是一个类揽了太多职责、谁都离不开它。",{"type":23,"tag":99,"props":3386,"children":3388},{"className":3387},[],[3389],{"type":28,"value":3390},"DevNodeServiceImpl",{"type":28,"value":3392}," 2,846 行、101 个方法、24 个依赖，里面还有 2 处 ",{"type":23,"tag":99,"props":3394,"children":3396},{"className":3395},[],[3397],{"type":28,"value":3398},"@Autowired",{"type":28,"value":3400}," 字段注入。Spring 项目一般用构造器注入，还在用字段注入，通常是因为有循环依赖，构造器注入会直接启动失败。",{"type":23,"tag":99,"props":3402,"children":3404},{"className":3403},[],[3405],{"type":28,"value":3406},"DatasourceServiceImpl",{"type":28,"value":3408}," 1,494 行，13 处裸 ",{"type":23,"tag":99,"props":3410,"children":3412},{"className":3411},[],[3413],{"type":28,"value":3414},"DriverManager",{"type":28,"value":3416}," 连接（每次现建连接，不走连接池），方言靠字符串前缀判断。演示用的 ",{"type":23,"tag":99,"props":3418,"children":3420},{"className":3419},[],[3421],{"type":28,"value":3422},"demo",{"type":28,"value":3424}," 模块有 2,638 行，横着引用了全部 12 个业务域。",{"type":23,"tag":24,"props":3426,"children":3427},{},[3428,3430,3436,3438,3444,3446,3452],{"type":28,"value":3429},"其他几处：事件全在进程内（",{"type":23,"tag":99,"props":3431,"children":3433},{"className":3432},[],[3434],{"type":28,"value":3435},"ApplicationEventPublisher",{"type":28,"value":3437},"，10 个事件、13 个监听器），没有 MQ，也没有 Outbox；121 处 ",{"type":23,"tag":99,"props":3439,"children":3441},{"className":3440},[],[3442],{"type":28,"value":3443},"@Transactional",{"type":28,"value":3445}," 里有 106 处是裸用，Spring 默认只在运行时异常时回滚，碰到受检异常不回滚；没有 Flyway，58 个 SQL 脚本散在两个目录，另有 2 个用 ",{"type":23,"tag":99,"props":3447,"children":3449},{"className":3448},[],[3450],{"type":28,"value":3451},"JdbcTemplate",{"type":28,"value":3453}," 在运行时建表的初始化器；调 DolphinScheduler（下面简称 DS）、Atlas、Hive、YARN、HDFS 全是手写 REST\u002FJDBC，没有熔断降级，业务错误全部塌成同一个错误码 1000。",{"type":23,"tag":76,"props":3455,"children":3457},{"id":3456},"前端",[3458],{"type":28,"value":3456},{"type":23,"tag":24,"props":3460,"children":3461},{},[3462,3464,3470],{"type":28,"value":3463},"前端是 Vue 3.5 + Ant Design Vue 4.2.6 + Pinia 2 + Vite 6，124 个 ",{"type":23,"tag":99,"props":3465,"children":3467},{"className":3466},[],[3468],{"type":28,"value":3469},".vue",{"type":28,"value":3471}," 文件、65,706 行、93 个路由。dist 有 21MB，其中 JS 占 20MB。",{"type":23,"tag":24,"props":3473,"children":3474},{},[3475,3477,3483,3485,3491,3493,3499],{"type":28,"value":3476},"当时我认定的头号问题是 ",{"type":23,"tag":99,"props":3478,"children":3480},{"className":3479},[],[3481],{"type":28,"value":3482},"IdeLayout.vue",{"type":28,"value":3484},"：它静态导入了 8 个 IDE 重组件，打出来是一个 3.5MB（gzip 后 815KB）的 chunk，而它又是所有登录后路由的父布局。Monaco 的 4 个语言 worker 加起来约 8.7MB，一点没裁，代码里有 6 处 ",{"type":23,"tag":99,"props":3486,"children":3488},{"className":3487},[],[3489],{"type":28,"value":3490},"import * as monaco",{"type":28,"value":3492}," 全量静态导入；antd 是 ",{"type":23,"tag":99,"props":3494,"children":3496},{"className":3495},[],[3497],{"type":28,"value":3498},"app.use(Antd)",{"type":28,"value":3500}," 全量注册，1.6MB（gzip 后 486KB）。后面会看到，这个\"头号问题\"的判断是错的。",{"type":23,"tag":24,"props":3502,"children":3503},{},[3504,3506,3512,3514,3520,3522,3528,3530,3536,3538,3544],{"type":28,"value":3505},"再往下看：29 处 ",{"type":23,"tag":99,"props":3507,"children":3509},{"className":3508},[],[3510],{"type":28,"value":3511},"setInterval",{"type":28,"value":3513}," 只配了 21 处 ",{"type":23,"tag":99,"props":3515,"children":3517},{"className":3516},[],[3518],{"type":28,"value":3519},"clearInterval",{"type":28,"value":3521},"，页面不可见也不暂停，最短间隔 3 秒；没有服务端状态库，123 个组件里 83 个直接调 API，重复的 ",{"type":23,"tag":99,"props":3523,"children":3525},{"className":3524},[],[3526],{"type":28,"value":3527},"message.error",{"type":28,"value":3529}," 有 177 处；最大的 13 个文件合计约 21,000 行，占 32%，光 ",{"type":23,"tag":99,"props":3531,"children":3533},{"className":3532},[],[3534],{"type":28,"value":3535},"DataTransferEditor.vue",{"type":28,"value":3537}," 就有 5,154 行，store ",{"type":23,"tag":99,"props":3539,"children":3541},{"className":3540},[],[3542],{"type":28,"value":3543},"ide.ts",{"type":28,"value":3545}," 2,499 行；i18n 是 0。",{"type":23,"tag":76,"props":3547,"children":3549},{"id":3548},"部署和基础设施",[3550],{"type":28,"value":3548},{"type":23,"tag":24,"props":3552,"children":3553},{},[3554],{"type":28,"value":3555},"应用侧的数据库、后端、前端三个节点在同一台物理宿主机上，大数据集群的 7 个节点在另一台上。节点层面做的高可用，被物理单点抵消了。",{"type":23,"tag":24,"props":3557,"children":3558},{},[3559,3561,3567,3569,3575],{"type":28,"value":3560},"没有 CI\u002FCD，没有镜像仓库，镜像全是 ",{"type":23,"tag":99,"props":3562,"children":3564},{"className":3563},[],[3565],{"type":28,"value":3566},":latest",{"type":28,"value":3568},"，回滚不了；构建产物依赖我这台开发用的 Mac。还有一条 hotpatch 通道，用 ",{"type":23,"tag":99,"props":3570,"children":3572},{"className":3571},[],[3573],{"type":28,"value":3574},"docker cp",{"type":28,"value":3576}," 直接改运行中的容器，容器和镜像就这么漂开了。",{"type":23,"tag":24,"props":3578,"children":3579},{},[3580],{"type":28,"value":3581},"调研时还记了一条：一个 MySQL 单实例同时扛着平台库、Hive Metastore 和 DS 元数据库，没有备份。这条后来被推翻了一半。9 月 3 日上备份时核对，平台库那台 MySQL 上只有 genesis 一个库，Hive Metastore 和 DS 的库早就迁到了大数据主节点的 MySQL 上；没有备份倒是真的。凭据管理也不合格，细节这里不展开。",{"type":23,"tag":24,"props":3583,"children":3584},{},[3585],{"type":28,"value":3586},"可观测性有缺口：容器环境没暴露 prometheus 端点，MySQL、Redis 没有 exporter，日志没接 Loki；部署脚本的健康等待，在容器还处于 starting 时就判成功了。已经能用的外部集成有 DS 3.2.2、Atlas 2.3.0 + Solr 8.11（混部），以及 Iceberg 加 Spark 3.5.8 Thrift Server。",{"type":23,"tag":24,"props":3588,"children":3589},{},[3590],{"type":28,"value":3591},"这些摆在一起，顺序其实就定了：没有安全网的大改不能做，安全网得排在拆分前面。",{"type":23,"tag":50,"props":3593,"children":3595},{"id":3594},"_6-条决策",[3596],{"type":28,"value":3597},"6 条决策",{"type":23,"tag":24,"props":3599,"children":3600},{},[3601],{"type":28,"value":3602},"先放总表，后面逐条说。",{"type":23,"tag":533,"props":3604,"children":3605},{},[3606,3631],{"type":23,"tag":537,"props":3607,"children":3608},{},[3609],{"type":23,"tag":541,"props":3610,"children":3611},{},[3612,3616,3621,3626],{"type":23,"tag":545,"props":3613,"children":3614},{},[3615],{"type":28,"value":3347},{"type":23,"tag":545,"props":3617,"children":3618},{},[3619],{"type":28,"value":3620},"管什么",{"type":23,"tag":545,"props":3622,"children":3623},{},[3624],{"type":28,"value":3625},"定下的做法",{"type":23,"tag":545,"props":3627,"children":3628},{},[3629],{"type":28,"value":3630},"没选的方向",{"type":23,"tag":561,"props":3632,"children":3633},{},[3634,3657,3680,3703,3734,3756],{"type":23,"tag":541,"props":3635,"children":3636},{},[3637,3642,3647,3652],{"type":23,"tag":568,"props":3638,"children":3639},{},[3640],{"type":28,"value":3641},"1",{"type":23,"tag":568,"props":3643,"children":3644},{},[3645],{"type":28,"value":3646},"演进路线",{"type":23,"tag":568,"props":3648,"children":3649},{},[3650],{"type":28,"value":3651},"模块化单体 → 事件跨进程化（Outbox + Kafka）→ 选择性微服务",{"type":23,"tag":568,"props":3653,"children":3654},{},[3655],{"type":28,"value":3656},"直接拆微服务",{"type":23,"tag":541,"props":3658,"children":3659},{},[3660,3665,3670,3675],{"type":23,"tag":568,"props":3661,"children":3662},{},[3663],{"type":28,"value":3664},"2",{"type":23,"tag":568,"props":3666,"children":3667},{},[3668],{"type":28,"value":3669},"调度",{"type":23,"tag":568,"props":3671,"children":3672},{},[3673],{"type":28,"value":3674},"保留 DolphinScheduler，3.2.2 升到 3.3.2",{"type":23,"tag":568,"props":3676,"children":3677},{},[3678],{"type":28,"value":3679},"迁到 Airflow、Kestra 等",{"type":23,"tag":541,"props":3681,"children":3682},{},[3683,3688,3693,3698],{"type":23,"tag":568,"props":3684,"children":3685},{},[3686],{"type":28,"value":3687},"3",{"type":23,"tag":568,"props":3689,"children":3690},{},[3691],{"type":28,"value":3692},"血缘",{"type":23,"tag":568,"props":3694,"children":3695},{},[3696],{"type":28,"value":3697},"Atlas 迁到 OpenMetadata（headless）+ OpenLineage",{"type":23,"tag":568,"props":3699,"children":3700},{},[3701],{"type":28,"value":3702},"留在 Atlas、纯自研（DataHub 列为次选）",{"type":23,"tag":541,"props":3704,"children":3705},{},[3706,3711,3716,3729],{"type":23,"tag":568,"props":3707,"children":3708},{},[3709],{"type":28,"value":3710},"4",{"type":23,"tag":568,"props":3712,"children":3713},{},[3714],{"type":28,"value":3715},"数据源",{"type":23,"tag":568,"props":3717,"children":3718},{},[3719,3721,3727],{"type":28,"value":3720},"统一 ",{"type":23,"tag":99,"props":3722,"children":3724},{"className":3723},[],[3725],{"type":28,"value":3726},"DataSourceConnector",{"type":28,"value":3728}," SPI",{"type":23,"tag":568,"props":3730,"children":3731},{},[3732],{"type":28,"value":3733},"继续在一个大类里按字符串前缀分支",{"type":23,"tag":541,"props":3735,"children":3736},{},[3737,3742,3746,3751],{"type":23,"tag":568,"props":3738,"children":3739},{},[3740],{"type":28,"value":3741},"5",{"type":23,"tag":568,"props":3743,"children":3744},{},[3745],{"type":28,"value":3456},{"type":23,"tag":568,"props":3747,"children":3748},{},[3749],{"type":28,"value":3750},"性能优先，首屏 gzip \u003C 300KB；i18n 只做文案收口",{"type":23,"tag":568,"props":3752,"children":3753},{},[3754],{"type":28,"value":3755},"现在就上 vue-i18n、换 UI 库",{"type":23,"tag":541,"props":3757,"children":3758},{},[3759,3764,3769,3774],{"type":23,"tag":568,"props":3760,"children":3761},{},[3762],{"type":28,"value":3763},"6",{"type":23,"tag":568,"props":3765,"children":3766},{},[3767],{"type":28,"value":3768},"安全与交付",{"type":23,"tag":568,"props":3770,"children":3771},{},[3772],{"type":28,"value":3773},"凭据治理、制品化、备份都是 P0",{"type":23,"tag":568,"props":3775,"children":3776},{},[3777],{"type":28,"value":3778},"先做架构改造",{"type":23,"tag":76,"props":3780,"children":3782},{"id":3781},"adr-1先做模块化单体微服务以后再说",[3783],{"type":28,"value":3784},"ADR-1：先做模块化单体，微服务以后再说",{"type":23,"tag":24,"props":3786,"children":3787},{},[3788],{"type":28,"value":3789},"依赖环、God Class、横切所有业务域的 demo，说明边界已经糊了；11.5% 的覆盖率、没有 CI、镜像不能版本化，说明改动没有安全网。这种条件下直接拆微服务，风险远大于收益，所以我没拆。",{"type":23,"tag":24,"props":3791,"children":3792},{},[3793],{"type":28,"value":3794},"我定的是先在单体里把限界上下文（按业务划的边界，边界内的代码自己管自己的数据和规则）立起来，用 ArchUnit 固化。ArchUnit 是一个跑在单测里的架构检查库，可以写\"A 模块不许依赖 B 模块\"这类规则，违反了测试就红。事件从进程内升级成 Outbox + Kafka，复用大数据集群现成的 3 个 Broker；6–12 个月后再按边界评估拆不拆，首批候选是 onedata 和 engine，devnode 放最后。",{"type":23,"tag":24,"props":3796,"children":3797},{},[3798,3800,3805],{"type":28,"value":3799},"上下文划成身份与租户、数据开发（核心域）、数据集成、调度运维、数据治理、数据建模、数据源（共享内核）和支撑域；",{"type":23,"tag":99,"props":3801,"children":3803},{"className":3802},[],[3804],{"type":28,"value":3422},{"type":28,"value":3806}," 剥成独立的 Maven 模块，用 profile 控制打不打包。这么走，每一步都有单独的收益，最后决定不拆也不算白做。",{"type":23,"tag":24,"props":3808,"children":3809},{},[3810,3812,3818,3820,3825],{"type":28,"value":3811},"落到 Phase 2 的模块化线上，就是剥离 demo、下沉 ",{"type":23,"tag":99,"props":3813,"children":3815},{"className":3814},[],[3816],{"type":28,"value":3817},"genesis-common",{"type":28,"value":3819},"、加 ArchUnit 边界规则（现存违规进冻结清单，只禁新增）。",{"type":23,"tag":99,"props":3821,"children":3823},{"className":3822},[],[3824],{"type":28,"value":3390},{"type":28,"value":3826}," 先补特征测试（≥40 个用例、行覆盖 ≥60%），再按\"门面 + 5 个子服务\"分 5 步拆，门面压到 400 行以内。特征测试是先把现有行为原样记下来的测试，不管行为对不对，拆完以后行为一变它就报警。拆分评估排在 12 个月那个节点，看边界的运行数据、模块的变更频率和团队规模，结论交给我决定，不自动实施。",{"type":23,"tag":24,"props":3828,"children":3829},{},[3830,3832,3838,3840,3846],{"type":28,"value":3831},"动手前这条还改过一次。2026-08-20 复核时发现 onedata 并没有做到\"零外部依赖\"：",{"type":23,"tag":99,"props":3833,"children":3835},{"className":3834},[],[3836],{"type":28,"value":3837},"ModelService",{"type":28,"value":3839}," 用全限定类名声明了 datastandard 的 ",{"type":23,"tag":99,"props":3841,"children":3843},{"className":3842},[],[3844],{"type":28,"value":3845},"NameGenerationService",{"type":28,"value":3847}," 字段，绕开了 import 语句，按 import 文本做的静态扫描看不见它。onedata 当首批拆分候选的前提就不成立了，排序得重估。方案顺带规定：ArchUnit 规则必须基于字节码分析，依赖白名单落地前，要把同类的隐藏依赖全量排查一遍。",{"type":23,"tag":76,"props":3849,"children":3851},{"id":3850},"adr-2调度继续用-dolphinscheduler升到-332",[3852],{"type":28,"value":3853},"ADR-2：调度继续用 DolphinScheduler，升到 3.3.2",{"type":23,"tag":24,"props":3855,"children":3856},{},[3857,3859,3865,3867,3873],{"type":28,"value":3858},"生产调度跑在 DS 3.2.2 上，Genesis 这边的 ",{"type":23,"tag":99,"props":3860,"children":3862},{"className":3861},[],[3863],{"type":28,"value":3864},"DsApiClient",{"type":28,"value":3866}," 被 11 个类用着。仓库里另外还有一个自研调度核心 ",{"type":23,"tag":99,"props":3868,"children":3870},{"className":3869},[],[3871],{"type":28,"value":3872},"genesis-scheduler-core",{"type":28,"value":3874}," 的骨架。",{"type":23,"tag":24,"props":3876,"children":3877},{},[3878],{"type":28,"value":3879},"我没迁 Airflow、Kestra 这些。拖拽 DAG、多租户、补数、Dependent 跨工作流依赖、DataX 和 SeaTunnel 原生任务类型，都是 Genesis 的核心需求，正好是 DS 的强项、竞品的短板；DS 和 Genesis 都是 Spring Boot 技术栈；DS 在 2025 年发了 4 个 release，社区还算健康。所以定的是升到 3.3.2，跳过 3.3.0-alpha，3.4.0 先观察。自研调度核心封存，README 里标明不投产。后来 9 月 6 日核实它从没被装配过，就直接从仓库删了。",{"type":23,"tag":24,"props":3881,"children":3882},{},[3883],{"type":28,"value":3884},"升级的代价不小：",{"type":23,"tag":399,"props":3886,"children":3887},{},[3888,3893,3898,3903],{"type":23,"tag":403,"props":3889,"children":3890},{},[3891],{"type":28,"value":3892},"DSIP-68（DS 社区的一个改进提案）统一了表结构，升级要做 schema 迁移，必须先备份元数据库，所以这条线依赖 Phase 0 的备份。",{"type":23,"tag":403,"props":3894,"children":3895},{},[3896],{"type":28,"value":3897},"3.3 移除了数据质量模块和 Dynamic 任务类型，这部分由 Genesis 自己的 quality 模块接，Phase 3 单列一条线做质量规则和调度的联动。",{"type":23,"tag":403,"props":3899,"children":3900},{},[3901],{"type":28,"value":3902},"升级前先排查被移除特性的使用面和 REST 端点兼容性。测试环境按 Runbook 至少演练两轮，第二轮要求零人工干预；补数（跨天、并发）、Dependent、告警通道三个场景强制回归，外加发布链路的端到端。",{"type":23,"tag":403,"props":3904,"children":3905},{},[3906],{"type":28,"value":3907},"客户端不做双版本兼容层。升级是一次性切换，代码直接对齐 3.3.2，回滚靠 revert 那次提交。Runbook 要写明不可回滚的点：schema 升级之后新产生的调度数据。",{"type":23,"tag":76,"props":3909,"children":3911},{"id":3910},"adr-3血缘从-atlas-迁到-openmetadata-openlineage",[3912],{"type":28,"value":3913},"ADR-3：血缘从 Atlas 迁到 OpenMetadata + OpenLineage",{"type":23,"tag":24,"props":3915,"children":3916},{},[3917],{"type":28,"value":3918},"血缘后端现在是 Atlas 2.3.0，和 Solr 8.11 混部，覆盖以 Hive 表级为主。Genesis 的核心场景是把血缘嵌进自己的 UI，Atlas 偏偏在这上面最弱：社区近乎停滞（2.3 到 2.4 隔了两年），对 Spark 没有列级血缘，图模型 API 很难二次开发。",{"type":23,"tag":24,"props":3920,"children":3921},{},[3922],{"type":28,"value":3923},"所以决定迁。OpenMetadata（下面简称 OM）只当元数据和血缘后端，也就是 headless 用法：不用它自带的界面，Genesis 只调它的 API，血缘图还在自己的前端画。采集侧统一到 OpenLineage，这是一个描述\"哪个作业读了哪些表、写了哪些表\"的开放标准。平台自己 SQL 的列级血缘交给一个 sqlglot sidecar（和主程序并排跑的独立小服务），慢慢替掉 JSqlParser。选 OM 是因为技术栈同构（Java + MySQL + ES），有官方 Java SDK，月度发版，6GB 内存就能跑；DataHub 列为次选。纯自研也想过，最后只在两处自己做：血缘图渲染，和 SQL 列级解析的 sidecar。",{"type":23,"tag":24,"props":3925,"children":3926},{},[3927],{"type":28,"value":3928},"迁移估算 2–3 人月，按\"先接口化 → 双实现并存 → 双写灰度比对 → 切换\"走：",{"type":23,"tag":24,"props":3930,"children":3931},{},[3932],{"type":23,"tag":65,"props":3933,"children":3936},{"alt":3934,"src":3935},"血缘迁移四步：1 先接口化，定义 MetadataProvider、LineageProvider，Atlas 实现先挂上去、行为不变；2 双实现并存，Atlas 和 OM 两个实现挂在同一组接口后面；3 双写灰度比对（标蓝），CompositeLineageProvider 同时写两边、读走 Atlas，每天抽样比对，零差异持续至少一周；4 切换，provider 从 dual 切到 openmetadata，Atlas 只读再留一个月。右侧是 sqlglot sidecar 的超时、熔断和回退 JSqlParser，底部是任何一步都能切回 dual 或 atlas 的退路","\u002Fimages\u002Fblog\u002Fgenesis-adr\u002Flineage-migration.svg",[],{"type":23,"tag":24,"props":3938,"children":3939},{},[3940,3942,3948,3949,3955],{"type":28,"value":3941},"先定义 ",{"type":23,"tag":99,"props":3943,"children":3945},{"className":3944},[],[3946],{"type":28,"value":3947},"MetadataProvider",{"type":28,"value":1148},{"type":23,"tag":99,"props":3950,"children":3952},{"className":3951},[],[3953],{"type":28,"value":3954},"LineageProvider",{"type":28,"value":3956}," 两个接口。领域模型按 Genesis 自己的语义设计，不照抄 Atlas 或 OM，免得换后端时再把调用方洗一遍。Atlas 的调用已经收敛到 5 个调用方，先让 Atlas 实现挂到接口上，行为不变。",{"type":23,"tag":24,"props":3958,"children":3959},{},[3960,3962,3968],{"type":28,"value":3961},"双写期由 ",{"type":23,"tag":99,"props":3963,"children":3965},{"className":3964},[],[3966],{"type":28,"value":3967},"CompositeLineageProvider",{"type":28,"value":3969}," 同时写 Atlas 和 OM，读还走 Atlas；OM 写失败只告警计数，不挡主链路。每天抽样比对两边的血缘图，零差异持续至少一周才算过。",{"type":23,"tag":24,"props":3971,"children":3972},{},[3973],{"type":28,"value":3974},"sqlglot sidecar 是独立的 Python FastAPI 服务，Java 侧调用带超时和熔断，失败降级回 JSqlParser；JSqlParser 留到 sidecar 稳定一个季度之后。",{"type":23,"tag":24,"props":3976,"children":3977},{},[3978],{"type":28,"value":3979},"切换时 provider 从 dual 切到 openmetadata，Atlas 转只读再留一个月，然后评估下线。任何一步出问题，配置切回 dual 或 atlas。",{"type":23,"tag":76,"props":3981,"children":3983},{"id":3982},"adr-4数据源统一走-connector-spi",[3984],{"type":28,"value":3985},"ADR-4：数据源统一走 Connector SPI",{"type":23,"tag":24,"props":3987,"children":3988},{},[3989,3991,3996],{"type":28,"value":3990},"engine 是被 6 个域引用的共享内核，里面的 ",{"type":23,"tag":99,"props":3992,"children":3994},{"className":3993},[],[3995],{"type":28,"value":3406},{"type":28,"value":3997}," 有 1,494 行、13 处裸连接，引擎之间的差异全靠字符串前缀分支。照这个样子，每接一个引擎就要在同一个类里再加一套分支和裸连接。",{"type":23,"tag":24,"props":3999,"children":4000},{},[4001,4003,4008,4010,4016,4017,4023,4025,4030],{"type":28,"value":4002},"我定了一个 ",{"type":23,"tag":99,"props":4004,"children":4006},{"className":4005},[],[4007],{"type":28,"value":3726},{"type":28,"value":4009}," 接口（testConnection、listDatabases、listTables、getTableSchema、executeQuery、getDdl、getPartitions），配上 ",{"type":23,"tag":99,"props":4011,"children":4013},{"className":4012},[],[4014],{"type":28,"value":4015},"TypeMapper",{"type":28,"value":1148},{"type":23,"tag":99,"props":4018,"children":4020},{"className":4019},[],[4021],{"type":28,"value":4022},"DialectAdapter",{"type":28,"value":4024},"。SPI 的意思是接口定好，每种引擎各写一个实现，运行时按类型找到对应实现，新加引擎不用改调用方。",{"type":23,"tag":99,"props":4026,"children":4028},{"className":4027},[],[4029],{"type":28,"value":3406},{"type":28,"value":4031}," 重构成 SPI 的注册和路由，目标 400 行以内。",{"type":23,"tag":24,"props":4033,"children":4034},{},[4035],{"type":28,"value":4036},"一次铺满所有引擎没必要，按集群就绪程度和接入成本排了三档：P1 是 Hive、MySQL、PostgreSQL（存量重构），加上 Iceberg（集群已就绪，走 Spark 3.5.8 Thrift Server 接入，成本最低）；P2 是 ClickHouse、StarRocks（纯 JDBC），加上 HBase（集群里已有 2.5.8）；P3 是 Hudi、MaxCompute、Databricks、Snowflake、Oracle，等有真实需求再做。",{"type":23,"tag":24,"props":4038,"children":4039},{},[4040,4042,4048,4050,4056],{"type":28,"value":4041},"地基在 Phase 1 先打：13 处裸连接改成按数据源隔离的 HikariCP 连接池（最小 0、最大 5，数据源删改时驱逐），封装成 ",{"type":23,"tag":99,"props":4043,"children":4045},{"className":4044},[],[4046],{"type":28,"value":4047},"DatasourceConnectionManager",{"type":28,"value":4049},"，SPI 就建在它上面。每个 Connector 都配 Testcontainers 契约测试，也就是在测试里用 Docker 真起一个对应的数据库，拿同一套用例去跑每个实现。StarRocks 复用 MySQL 协议，继承 ",{"type":23,"tag":99,"props":4051,"children":4053},{"className":4052},[],[4054],{"type":28,"value":4055},"MysqlConnector",{"type":28,"value":4057}," 只改差异点；HBase 优先走 Phoenix JDBC，集群没装 Phoenix 的话，再决定是装 Phoenix，还是用原生 API 只做只读的元数据浏览。",{"type":23,"tag":24,"props":4059,"children":4060},{},[4061,4063,4069,4071,4077],{"type":28,"value":4062},"配套还有几件事：元数据缓存，",{"type":23,"tag":99,"props":4064,"children":4066},{"className":4065},[],[4067],{"type":28,"value":4068},"engineType",{"type":28,"value":4070}," 改成枚举，连接配置里的密码用 AES-GCM 加密存储；transfer 模块的 ",{"type":23,"tag":99,"props":4072,"children":4074},{"className":4073},[],[4075],{"type":28,"value":4076},"TypeMappingRegistry",{"type":28,"value":4078}," 上收到 SPI 层，给 DataX、SeaTunnel 写 ClickHouse、StarRocks 时做字段映射。",{"type":23,"tag":76,"props":4080,"children":4082},{"id":4081},"adr-5前端先抓性能国际化往后放",[4083],{"type":28,"value":4084},"ADR-5：前端先抓性能，国际化往后放",{"type":23,"tag":24,"props":4086,"children":4087},{},[4088],{"type":28,"value":4089},"写方案时，首屏 JS 是按 chunk 体积估的，约 1.3MB（gzip），dist 21MB；i18n 是 0，也没有真实的多语言需求。",{"type":23,"tag":24,"props":4091,"children":4092},{},[4093,4095,4101,4103,4109],{"type":28,"value":4094},"目标定在首屏 gzip 300KB 以内、dist 8MB 以内。手段是五板斧：IdeLayout 异步化、Monaco worker 裁剪、antd 按需引入、",{"type":23,"tag":99,"props":4096,"children":4098},{"className":4097},[],[4099],{"type":28,"value":4100},"usePolling",{"type":28,"value":4102}," 统一轮询（页面不可见时暂停）加高频轮询迁 SSE、删遗留页面。服务端状态交给 ",{"type":23,"tag":99,"props":4104,"children":4106},{"className":4105},[],[4107],{"type":28,"value":4108},"@tanstack\u002Fvue-query",{"type":28,"value":4110},"。i18n 只做文案收口，把 177 处硬编码提示收到常量层，key 的结构给以后留好；现在就上 vue-i18n，等于为还不存在的需求付钱（YAGNI）。UI 库也不换，继续用 Ant Design Vue 4。后来的实测也说明，antd 体积大是全量注册造成的，换库解决不了。",{"type":23,"tag":24,"props":4112,"children":4113},{},[4114],{"type":28,"value":4115},"这是 6 条里唯一已经有实测结果的一条，2026-08-21 回写进了方案。过程比计划曲折。",{"type":23,"tag":24,"props":4117,"children":4118},{},[4119],{"type":23,"tag":65,"props":4120,"children":4123},{"alt":4121,"src":4122},"前端首屏 JS（gzip）三步优化的实测：基线 1462KB；第 1 步编辑器组件异步化，IdeLayout chunk 从 815KB 降到 689KB，首屏仍是 1462KB；第 2 步 Monaco 裁剪，产物从 20.51MB 降到 11.30MB，首屏仍是 1462KB；第 3 步分离 Vite 预加载助手，首屏降到 523KB，少 64%；红色虚线是 300KB 目标；底部说明 523KB 里 antd 占 438KB","\u002Fimages\u002Fblog\u002Fgenesis-adr\u002Ffirst-screen.svg",[],{"type":23,"tag":24,"props":4125,"children":4126},{},[4127,4129,4135],{"type":28,"value":4128},"第一步是纠正度量口径。首屏 JS 只能按 ",{"type":23,"tag":99,"props":4130,"children":4132},{"className":4131},[],[4133],{"type":28,"value":4134},"index.html",{"type":28,"value":4136}," 里的 modulepreload \u002F script 集合（浏览器打开页面时一定会下载的那批文件），加上入口 chunk 的静态 import 来算。按这个口径，实测基线是 1462KB（gzip），比估的 1.3MB 还多。",{"type":23,"tag":24,"props":4138,"children":4139},{},[4140],{"type":28,"value":4141},"IdeLayout 异步化实际往下沉了一层，改的是 EditorPane 里的 6 个编辑器和 ProblemsPanel，重量在它们身上。IdeLayout chunk 从 815KB 降到 689KB（gzip），首屏收益却是 0，因为它是路由级 chunk，本来就不在首屏集合里。",{"type":23,"tag":24,"props":4143,"children":4144},{},[4145,4147,4153,4155,4160,4162,4168,4170,4176],{"type":28,"value":4146},"裁 Monaco 时发现插件配置一直是对的。4 个语言 worker 来自 monaco-editor 内部的 ",{"type":23,"tag":99,"props":4148,"children":4150},{"className":4149},[],[4151],{"type":28,"value":4152},"new Worker(new URL(...))",{"type":28,"value":4154},"，被 Vite 原生识别后自动拆了出来，触发点是 ",{"type":23,"tag":99,"props":4156,"children":4158},{"className":4157},[],[4159],{"type":28,"value":3490},{"type":28,"value":4161}," 拉进了 ",{"type":23,"tag":99,"props":4163,"children":4165},{"className":4164},[],[4166],{"type":28,"value":4167},"editor.main",{"type":28,"value":4169},"。改成组合 ",{"type":23,"tag":99,"props":4171,"children":4173},{"className":4172},[],[4174],{"type":28,"value":4175},"edcore.main",{"type":28,"value":4177}," 和实际用到的 sql、python、shell 语法以后，assets 从 20.51MB 降到 11.30MB（-45%），4 个 worker 共 8.71MB 没了。首屏收益还是 0，worker 本来就按需加载。",{"type":23,"tag":24,"props":4179,"children":4180},{},[4181,4183,4189,4191,4197,4199,4205,4207,4212],{"type":28,"value":4182},"真正的病灶不在计划里。Rollup 把 Vite 的预加载助手 ",{"type":23,"tag":99,"props":4184,"children":4186},{"className":4185},[],[4187],{"type":28,"value":4188},"__vitePreload",{"type":28,"value":4190},"（约 200 字节，87 个懒加载路由都调它）并进了 ",{"type":23,"tag":99,"props":4192,"children":4194},{"className":4193},[],[4195],{"type":28,"value":4196},"manualChunks",{"type":28,"value":4198}," 划出来的 monaco 分组，入口因此对 monaco 有了一条静态边：任何页面，包括登录页，都得先下载 gzip 后 941KB 的 Monaco。把 ",{"type":23,"tag":99,"props":4200,"children":4202},{"className":4201},[],[4203],{"type":28,"value":4204},"vite\u002Fpreload-helper",{"type":28,"value":4206}," 单独划进一个分组后，首屏从 1462KB 降到 523KB（-64%）。这个问题从初始提交起就在，之前从没被记录过。这一步改错会让 87 个懒加载路由全部失效，静态分析又看不出来，所以要求做运行时验证：用生产产物加无头浏览器，确认登录页不拉 Monaco，进 SQL 编辑页时按需加载并挂载成功，零失败请求。排查过程单独写过一篇：",{"type":23,"tag":41,"props":4208,"children":4209},{"href":1976},[4210],{"type":28,"value":4211},"首屏 JS 从 1462KB 降到 523KB",{"type":28,"value":287},{"type":23,"tag":24,"props":4214,"children":4215},{},[4216,4218,4224,4226,4231],{"type":28,"value":4217},"截至那次回写，剩下的差距全在 antd：438KB，占首屏 523KB 的 84%。模板实际用了 69 种组件、155 种图标。单独把图标库拆成独立 chunk，实测只少了 7KB，因为只要 ",{"type":23,"tag":99,"props":4219,"children":4221},{"className":4220},[],[4222],{"type":28,"value":4223},"main.ts",{"type":28,"value":4225}," 里还是全量 ",{"type":23,"tag":99,"props":4227,"children":4229},{"className":4228},[],[4230],{"type":28,"value":3498},{"type":28,"value":4232},"，整个 antd 就在入口的静态依赖图里。按需引入得从注册方式改起。",{"type":23,"tag":24,"props":4234,"children":4235},{},[4236],{"type":28,"value":4237},"前三项里有两项首屏收益是 0，因为量的是 chunk 体积；最大的收益反而来自计划外的发现。现在 Phase 1 文档开头写着\"chunk 变小 ≠ 首屏变小\"，凡是声称做了首屏优化的改动，验收都要给出改前改后的 modulepreload 集合对比。",{"type":23,"tag":76,"props":4239,"children":4241},{"id":4240},"adr-6凭据治理和制品化都是-p0",[4242],{"type":28,"value":4243},"ADR-6：凭据治理和制品化都是 P0",{"type":23,"tag":24,"props":4245,"children":4246},{},[4247],{"type":28,"value":4248},"凭据管理不合格、MySQL 没备份、镜像不能回滚、hotpatch 造成漂移，这些看着像运维问题，可它们决定了后面每一步出错时还有没有退路。先做架构、安全和交付以后再补，等于没有退路就去动数据库和部署；风险矩阵里有三行的回滚手段（恢复元数据库快照、按备份恢复、按 tag 回滚镜像）都建立在备份和制品化上面。",{"type":23,"tag":24,"props":4250,"children":4251},{},[4252,4254,4259],{"type":28,"value":4253},"所以凭据治理排第一，包括凭据外置、生产口令轮换，以及评估历史遗留的清理代价。制品化同样是 P0：多阶段 Dockerfile + 私有 Registry + git-sha tag，先把回滚解锁；废掉 ",{"type":23,"tag":99,"props":4255,"children":4257},{"className":4256},[],[4258],{"type":28,"value":3574},{"type":28,"value":4260}," 那种 hotpatch。MySQL 备份排在一切架构改造之前。具体下来是这几件：",{"type":23,"tag":399,"props":4262,"children":4263},{},[4264,4269,4274,4287],{"type":23,"tag":403,"props":4265,"children":4266},{},[4267],{"type":28,"value":4268},"Phase 0 的第一批提交必须是脏树清理。当时工作区里有误提交又删掉的 Maven 本地仓库文件，dirty 数远超停工阈值，不清掉就不许提交别的。",{"type":23,"tag":403,"props":4270,"children":4271},{},[4272],{"type":28,"value":4273},"口令轮换按 Runbook 一个服务一个服务地来：先建新凭据，再改配置、滚动重启、健康检查，最后废弃旧凭据，旧口令一直留到全部验证通过。Runbook 本身不含任何真实口令。",{"type":23,"tag":403,"props":4275,"children":4276},{},[4277,4279,4285],{"type":28,"value":4278},"备份是三个库逐库 ",{"type":23,"tag":99,"props":4280,"children":4282},{"className":4281},[],[4283],{"type":28,"value":4284},"mysqldump --single-transaction",{"type":28,"value":4286},"，保留 14 天，本地和 NAS 各一份，每天定时跑，并且和调度的凌晨任务错开。验收看恢复演练核对通过，光脚本跑通不算。",{"type":23,"tag":403,"props":4288,"children":4289},{},[4290],{"type":28,"value":4291},"制品链的具体任务（多阶段 Dockerfile、私有 Registry、CI 流水线、按 tag 部署与一键回滚、废除 hotpatch 并拆分 2,644 行的部署主脚本）排在 Phase 4 的交付链，标成那个阶段的最高优先。",{"type":23,"tag":50,"props":4293,"children":4295},{"id":4294},"五个阶段怎么排",[4296],{"type":28,"value":4294},{"type":23,"tag":24,"props":4298,"children":4299},{},[4300],{"type":23,"tag":65,"props":4301,"children":4304},{"alt":4302,"src":4303},"五个阶段的路线：Phase 0 止血 1–2 周（凭据治理、备份、可观测性速赢，第一批提交必须是脏树清理），Phase 1 性能与 UX 2–3 周，Phase 2 模块化与血缘 6–10 周，Phase 3 调度升级与引擎 4–6 周，Phase 4 云原生与治理 8–12 周，最后是 12 个月节点的微服务拆分评估；右侧蓝框列出阶段依赖，红框标出制品化定为 P0、镜像 tag 回滚却排在 Phase 4 的脱节","\u002Fimages\u002Fblog\u002Fgenesis-adr\u002Froadmap.svg",[],{"type":23,"tag":24,"props":4306,"children":4307},{},[4308],{"type":28,"value":4309},"图左边是五个阶段和各自估的工期，右边是阶段之间的依赖，以及一处没对齐的地方，放到文末说。",{"type":23,"tag":24,"props":4311,"children":4312},{},[4313,4315,4321],{"type":28,"value":4314},"Phase 0 的完成标准是全部任务提交、工作区干净、备份恢复演练通过、生产口令轮换完成。顺手做几件速赢的事：暴露 prometheus 端点并拆开 liveness \u002F readiness 探针（一个回答\"进程还活着吗\"，一个回答\"能接流量了吗\"），修正健康等待的误判，给 JVM 加容器内存参数（",{"type":23,"tag":99,"props":4316,"children":4318},{"className":4317},[],[4319],{"type":28,"value":4320},"MaxRAMPercentage=75.0",{"type":28,"value":4322},"、OOM 即退出），更正文档里记错的技术栈。",{"type":23,"tag":24,"props":4324,"children":4325},{},[4326,4328,4333,4335,4341,4343,4349],{"type":28,"value":4327},"Phase 1 可以和 Phase 0 的尾巴并行，前端线就是上面 ADR-5 那些。后端线是：接入 Flyway（第一次只 baseline，存量脚本归档）；运行时建表器转成迁移脚本；错误码按域分 6 段；用 Resilience4j 给 DS、Atlas、Hive 的外部调用加超时、重试和熔断，熔断时返回明确的外部集成错误码，不静默吞掉；106 处裸 ",{"type":23,"tag":99,"props":4329,"children":4331},{"className":4330},[],[4332],{"type":28,"value":3443},{"type":28,"value":4334}," 补上 ",{"type":23,"tag":99,"props":4336,"children":4338},{"className":4337},[],[4339],{"type":28,"value":4340},"rollbackFor",{"type":28,"value":4342},"，并用 ArchUnit 禁止新增；外部数据源连接池化；8 处 ",{"type":23,"tag":99,"props":4344,"children":4346},{"className":4345},[],[4347],{"type":28,"value":4348},"@Scheduled",{"type":28,"value":4350}," 加 ShedLock（多实例部署时保证同一个定时任务只有一台在跑）。",{"type":23,"tag":24,"props":4352,"children":4353},{},[4354],{"type":28,"value":4355},"Phase 2 是模块化（ADR-1）、血缘迁移（ADR-3）、Connector SPI（ADR-4）三条线并行，另外还有元数据的声明式缓存，以及项目级数据权限切面：没标注的端点先只告警，清零以后再转成强制。Phase 3 做 DS 升级（ADR-2）、质量承接，以及 ClickHouse \u002F StarRocks \u002F HBase Connector 和 transfer 模块的对接。",{"type":23,"tag":24,"props":4357,"children":4358},{},[4359],{"type":28,"value":4360},"Phase 4 按交付链、事件跨进程化、权限与治理、功能补齐、体验还债的优先级滚动做。Outbox 的设计是事务内写 outbox 表，独立的投递器推到 Kafka，消费侧用去重表保证幂等；10 个进程内事件分 3 批逐个迁，新旧共存并且有开关；验收要求 Kafka 停机时业务主链路不阻塞，只出积压告警。权限落成四角色矩阵（Owner \u002F Developer \u002F Reviewer \u002F Viewer），每一格都要有测试。K8s 只评估不迁移，前提是先解决虚拟化层的物理单点。最后是 12 个月节点的微服务拆分评估。",{"type":23,"tag":24,"props":4362,"children":4363},{},[4364],{"type":28,"value":4365},"阶段之间的依赖：Phase 0 是所有事的前提，尤其是脏树清理和备份；血缘迁移不依赖 God Class 拆分，可以并行；DS 升级依赖备份和测试环境；Outbox 要等 Phase 2 把边界固化下来。这份方案是架构线，和产品路线交织着做：Phase 0 的安全止血和 Phase 1 的 IdeLayout 拆包对产品线有一票否决权，其余时候产品线优先。",{"type":23,"tag":24,"props":4367,"children":4368},{},[4369],{"type":28,"value":4370},"执行上，方案文档由 Claude 起草，我审定批准。每个任务写明影响哪些文件、验证命令和提交信息，按能力分给不同的 AI 模型（Claude 和 Codex）；生产口令轮换、生产 SSH 操作和升级窗口只由我本人来。纪律对谁都一样：一个任务一次原子提交，改动超过 5 个文件先拆；每 3–4 个任务过一次 Review Gate，阶段边界做全量审查，工作区干净才能进下一阶段；要偏离文档的决策，先改文档，我确认了再继续。前面 onedata 依赖和首屏基线那两处事实被推翻以后，也都是先回写进方案的。",{"type":23,"tag":50,"props":4372,"children":4374},{"id":4373},"出了事怎么退",[4375],{"type":28,"value":4373},{"type":23,"tag":533,"props":4377,"children":4378},{},[4379,4405],{"type":23,"tag":537,"props":4380,"children":4381},{},[4382],{"type":23,"tag":541,"props":4383,"children":4384},{},[4385,4390,4395,4400],{"type":23,"tag":545,"props":4386,"children":4387},{},[4388],{"type":28,"value":4389},"风险",{"type":23,"tag":545,"props":4391,"children":4392},{},[4393],{"type":28,"value":4394},"等级",{"type":23,"tag":545,"props":4396,"children":4397},{},[4398],{"type":28,"value":4399},"缓解",{"type":23,"tag":545,"props":4401,"children":4402},{},[4403],{"type":28,"value":4404},"回滚",{"type":23,"tag":561,"props":4406,"children":4407},{},[4408,4431,4454,4476,4498,4520,4542],{"type":23,"tag":541,"props":4409,"children":4410},{},[4411,4416,4421,4426],{"type":23,"tag":568,"props":4412,"children":4413},{},[4414],{"type":28,"value":4415},"DS 升级 schema 迁移失败",{"type":23,"tag":568,"props":4417,"children":4418},{},[4419],{"type":28,"value":4420},"高",{"type":23,"tag":568,"props":4422,"children":4423},{},[4424],{"type":28,"value":4425},"元数据库快照 + 测试环境全回归",{"type":23,"tag":568,"props":4427,"children":4428},{},[4429],{"type":28,"value":4430},"恢复快照，回切 3.2.2 二进制",{"type":23,"tag":541,"props":4432,"children":4433},{},[4434,4439,4444,4449],{"type":23,"tag":568,"props":4435,"children":4436},{},[4437],{"type":28,"value":4438},"血缘迁移数据不一致",{"type":23,"tag":568,"props":4440,"children":4441},{},[4442],{"type":28,"value":4443},"中",{"type":23,"tag":568,"props":4445,"children":4446},{},[4447],{"type":28,"value":4448},"接口化 + 双写灰度比对",{"type":23,"tag":568,"props":4450,"children":4451},{},[4452],{"type":28,"value":4453},"配置切回 Atlas 实现，Atlas 保留只读",{"type":23,"tag":541,"props":4455,"children":4456},{},[4457,4462,4466,4471],{"type":23,"tag":568,"props":4458,"children":4459},{},[4460],{"type":28,"value":4461},"God Class 拆分回归",{"type":23,"tag":568,"props":4463,"children":4464},{},[4465],{"type":28,"value":4420},{"type":23,"tag":568,"props":4467,"children":4468},{},[4469],{"type":28,"value":4470},"特征测试先行；每次拆分不超过 5 个文件，原子提交",{"type":23,"tag":568,"props":4472,"children":4473},{},[4474],{"type":28,"value":4475},"revert 单个提交",{"type":23,"tag":541,"props":4477,"children":4478},{},[4479,4484,4488,4493],{"type":23,"tag":568,"props":4480,"children":4481},{},[4482],{"type":28,"value":4483},"前端分包破坏 IDE",{"type":23,"tag":568,"props":4485,"children":4486},{},[4487],{"type":28,"value":4443},{"type":23,"tag":568,"props":4489,"children":4490},{},[4491],{"type":28,"value":4492},"Playwright E2E 覆盖 IDE 主链路后再动",{"type":23,"tag":568,"props":4494,"children":4495},{},[4496],{"type":28,"value":4497},"revert",{"type":23,"tag":541,"props":4499,"children":4500},{},[4501,4506,4510,4515],{"type":23,"tag":568,"props":4502,"children":4503},{},[4504],{"type":28,"value":4505},"无 CI 期间发布事故",{"type":23,"tag":568,"props":4507,"children":4508},{},[4509],{"type":28,"value":4443},{"type":23,"tag":568,"props":4511,"children":4512},{},[4513],{"type":28,"value":4514},"Phase 0 先解锁镜像 tag 回滚",{"type":23,"tag":568,"props":4516,"children":4517},{},[4518],{"type":28,"value":4519},"按 tag 回滚镜像",{"type":23,"tag":541,"props":4521,"children":4522},{},[4523,4528,4532,4537],{"type":23,"tag":568,"props":4524,"children":4525},{},[4526],{"type":28,"value":4527},"MySQL 单点故障",{"type":23,"tag":568,"props":4529,"children":4530},{},[4531],{"type":28,"value":4420},{"type":23,"tag":568,"props":4533,"children":4534},{},[4535],{"type":28,"value":4536},"备份先行 + 恢复演练",{"type":23,"tag":568,"props":4538,"children":4539},{},[4540],{"type":28,"value":4541},"按备份恢复",{"type":23,"tag":541,"props":4543,"children":4544},{},[4545,4550,4554,4559],{"type":23,"tag":568,"props":4546,"children":4547},{},[4548],{"type":28,"value":4549},"口令轮换致服务中断",{"type":23,"tag":568,"props":4551,"children":4552},{},[4553],{"type":28,"value":4443},{"type":23,"tag":568,"props":4555,"children":4556},{},[4557],{"type":28,"value":4558},"Runbook 分服务逐个执行 + 健康检查",{"type":23,"tag":568,"props":4560,"children":4561},{},[4562],{"type":28,"value":4563},"旧口令保留至全部验证通过",{"type":23,"tag":24,"props":4565,"children":4566},{},[4567],{"type":28,"value":4568},"每一行都要求先有回滚路径再动手。手段翻来覆去就这几类：数据快照和备份、配置开关、单提交 revert、镜像 tag、保留旧口令。",{"type":23,"tag":50,"props":4570,"children":4572},{"id":4571},"到-10-月初落地了什么",[4573],{"type":28,"value":4574},"到 10 月初落地了什么",{"type":23,"tag":24,"props":4576,"children":4577},{},[4578],{"type":28,"value":4579},"能从方案的执行记录和 2026-10-07 的发布状态记录里确认落地的，有这几项：",{"type":23,"tag":399,"props":4581,"children":4582},{},[4583,4588,4593,4598,4603,4616],{"type":23,"tag":403,"props":4584,"children":4585},{},[4586],{"type":28,"value":4587},"Phase 1 前端的三项：编辑器组件异步化、Monaco 裁剪、分离 Vite 预加载助手（2026-08-21），首屏 JS 从 1462KB 降到 523KB（gzip）。截至那次回写，antd 按需引入还没做，300KB 的目标也还没达到。",{"type":23,"tag":403,"props":4589,"children":4590},{},[4591],{"type":28,"value":4592},"Flyway 已经在生产接管 schema。2026-10-07 的发布预检显示，以 V100 为 baseline，V101 到 V104 都执行成功了。",{"type":23,"tag":403,"props":4594,"children":4595},{},[4596],{"type":28,"value":4597},"平台库的每日逻辑备份 9 月 3 日上线：每天 03:30 跑，首次备份 1.2MB；在 devbox 上用当天的备份恢复出 68 张表，5 张关键表的行数和生产逐一对上，备份文件被截断时校验会非零退出。异地副本还没做。",{"type":23,"tag":403,"props":4599,"children":4600},{},[4601],{"type":28,"value":4602},"CI 的触发分支 8 月 23 日改成了实际开发用的 feat、fix、chore 分支，并把测试纳了进去。之前只配了 main，开发又全在 feat 分支上，4 月以来 250 多个提交一次 CI 都没跑过。",{"type":23,"tag":403,"props":4604,"children":4605},{},[4606,4608,4614],{"type":28,"value":4607},"9 个直接注入 Mapper 的 Controller 里，",{"type":23,"tag":99,"props":4609,"children":4611},{"className":4610},[],[4612],{"type":28,"value":4613},"TableCommandCenterController",{"type":28,"value":4615}," 在 2026-09-03 把逻辑下沉到了 Service，从 446 行降到 154 行，不再注入 Mapper。",{"type":23,"tag":403,"props":4617,"children":4618},{},[4619],{"type":28,"value":4620},"同一份记录里，本地一键 CI 脚本跑的是后端 1096 项测试（0 失败、3 跳过）、前端 418 项测试，以及类型检查、lint 和构建，都通过了。它不含 live E2E，也不是方案规划的那种带 PR 门禁的托管流水线。",{"type":23,"tag":24,"props":4622,"children":4623},{},[4624],{"type":28,"value":4625},"其余各项（OM 迁移、Connector SPI、DS 3.3.2 升级、Outbox、制品化等），文中写的是方案里的决定或计划，不代表执行状态。",{"type":23,"tag":24,"props":4627,"children":4628},{},[4629],{"type":28,"value":4630},"还有一处对不上，得我自己回头改。ADR-6 把制品化定成 P0，风险矩阵里\"无 CI 期间发布事故\"的缓解也写着\"Phase 0 先解锁镜像 tag 回滚\"，可 Phase 0 的任务表里没有这一项：镜像 tag 化部署和一键回滚排在 Phase 4 的交付链，而 Phase 4 的前置是 Phase 0–2 完成、DS 升级完成。决策和排期在这里脱节了，方案里这块还得重新对齐。",{"title":8,"searchDepth":924,"depth":924,"links":4632},[4633,4638,4646,4647,4648],{"id":3362,"depth":927,"text":3362,"children":4634},[4635,4636,4637],{"id":3372,"depth":924,"text":3372},{"id":3456,"depth":924,"text":3456},{"id":3548,"depth":924,"text":3548},{"id":3594,"depth":927,"text":3597,"children":4639},[4640,4641,4642,4643,4644,4645],{"id":3781,"depth":924,"text":3784},{"id":3850,"depth":924,"text":3853},{"id":3910,"depth":924,"text":3913},{"id":3982,"depth":924,"text":3985},{"id":4081,"depth":924,"text":4084},{"id":4240,"depth":924,"text":4243},{"id":4294,"depth":927,"text":4294},{"id":4373,"depth":927,"text":4373},{"id":4571,"depth":927,"text":4574},"content:blog:2026-10-08-genesis-architecture-adr.md","blog\u002F2026-10-08-genesis-architecture-adr.md","blog\u002F2026-10-08-genesis-architecture-adr",{"_path":4653,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":4654,"description":4655,"date":4656,"tags":4657,"body":4662,"_type":937,"_id":5708,"_source":939,"_file":5709,"_stem":5710,"_extension":942},"\u002Fblog\u002F2026-09-28-homelab-production-deployment","家里这套生产环境：几台机器各跑什么，和踩坑以后定下的几条规矩","PVE 四台宿主机、NAS 和两台 DGX Spark 各跑什么，七节点大数据集群怎么挤在一台机器上，HDFS 和 YARN 怎么配，以及几次出事以后定下的运维规矩。","2026-09-28",[4658,4659,4660,4661],"Homelab","部署","Hadoop","运维",{"type":20,"children":4663,"toc":5692},[4664,4669,4674,4679,4687,4840,4845,4855,4867,4873,5007,5012,5017,5025,5036,5041,5046,5052,5065,5106,5111,5119,5132,5140,5145,5365,5370,5375,5380,5409,5414,5420,5425,5430,5451,5471,5499,5511,5517,5553,5559,5601,5630,5635,5688],{"type":23,"tag":24,"props":4665,"children":4666},{},[4667],{"type":28,"value":4668},"Genesis 和它依赖的大数据集群都跑在我家里的几台机器上。机器、VM 和服务的分布平时记在一份集群规划文档里，这份文档越写越长，开头堆着一长串历次变更记录，真要回答\"现在到底长什么样\"反而得翻半天。这篇把 9 月 21 号那次恢复之后的现状整理一遍，后面单独列几条踩坑以后定下来的规矩。",{"type":23,"tag":24,"props":4670,"children":4671},{},[4672],{"type":28,"value":4673},"内容按集群规划文档 v4.5.7 整理，地址、端口和账号都去掉了。",{"type":23,"tag":50,"props":4675,"children":4677},{"id":4676},"有哪几台机器",[4678],{"type":28,"value":4676},{"type":23,"tag":24,"props":4680,"children":4681},{},[4682],{"type":23,"tag":65,"props":4683,"children":4686},{"alt":4684,"src":4685},"家里的机器分布。PVE 集群 homelab 里有四台宿主机：pve1 是 i7-8750H 笔记本，跑 Genesis 的 101 数据库、102 后端、103 前端和翻译服务三台 VM；pve3 规格当时没登记，跑 Forge LLMOps 四节点、量化平台和 devbox；pve2 是 Core Ultra 9 285HX、128GB，大数据集群 7 个 VM 全在这台；pve 是 i9-9900K、RTX 2080，8 月 21 号核对时连不上。集群外有 NAS（绿联 DXP4800 Plus，放 HDFS 冷数据目录、监控栈和共享存储）、两台 DGX Spark（本地大模型，不进 PVE 也不进 YARN）和 MacBook Pro（开发机，构建 Genesis 的 jar 和前端 dist）。pve2 的每台 DataNode 有一个 ARCHIVE 卷经 NFS 落到 NAS","\u002Fimages\u002Fblog\u002Fhomelab-deploy\u002Fmachines.svg",[],{"type":23,"tag":533,"props":4688,"children":4689},{},[4690,4711],{"type":23,"tag":537,"props":4691,"children":4692},{},[4693],{"type":23,"tag":541,"props":4694,"children":4695},{},[4696,4701,4706],{"type":23,"tag":545,"props":4697,"children":4698},{},[4699],{"type":28,"value":4700},"机器",{"type":23,"tag":545,"props":4702,"children":4703},{},[4704],{"type":28,"value":4705},"配置",{"type":23,"tag":545,"props":4707,"children":4708},{},[4709],{"type":28,"value":4710},"干什么",{"type":23,"tag":561,"props":4712,"children":4713},{},[4714,4732,4750,4768,4786,4804,4822],{"type":23,"tag":541,"props":4715,"children":4716},{},[4717,4722,4727],{"type":23,"tag":568,"props":4718,"children":4719},{},[4720],{"type":28,"value":4721},"pve2",{"type":23,"tag":568,"props":4723,"children":4724},{},[4725],{"type":28,"value":4726},"Core Ultra 9 285HX（8 个 P 核 + 16 个 E 核），128GB DDR5，2 块 2TB NVMe",{"type":23,"tag":568,"props":4728,"children":4729},{},[4730],{"type":28,"value":4731},"大数据集群的 7 个 VM 全在这台",{"type":23,"tag":541,"props":4733,"children":4734},{},[4735,4740,4745],{"type":23,"tag":568,"props":4736,"children":4737},{},[4738],{"type":28,"value":4739},"pve1",{"type":23,"tag":568,"props":4741,"children":4742},{},[4743],{"type":28,"value":4744},"i7-8750H 笔记本，32GB，2 块 500GB NVMe",{"type":23,"tag":568,"props":4746,"children":4747},{},[4748],{"type":28,"value":4749},"Genesis 的三个节点，外加翻译服务的三台 VM",{"type":23,"tag":541,"props":4751,"children":4752},{},[4753,4758,4763],{"type":23,"tag":568,"props":4754,"children":4755},{},[4756],{"type":28,"value":4757},"pve3",{"type":23,"tag":568,"props":4759,"children":4760},{},[4761],{"type":28,"value":4762},"规格没在文档里登记",{"type":23,"tag":568,"props":4764,"children":4765},{},[4766],{"type":28,"value":4767},"Forge LLMOps 四节点、量化平台、devbox 等",{"type":23,"tag":541,"props":4769,"children":4770},{},[4771,4776,4781],{"type":23,"tag":568,"props":4772,"children":4773},{},[4774],{"type":28,"value":4775},"pve",{"type":23,"tag":568,"props":4777,"children":4778},{},[4779],{"type":28,"value":4780},"i9-9900K，62GB，RTX 2080",{"type":23,"tag":568,"props":4782,"children":4783},{},[4784],{"type":28,"value":4785},"原本跑量化平台和闲时算力，8 月 21 号核对时这台连不上",{"type":23,"tag":541,"props":4787,"children":4788},{},[4789,4794,4799],{"type":23,"tag":568,"props":4790,"children":4791},{},[4792],{"type":28,"value":4793},"NAS",{"type":23,"tag":568,"props":4795,"children":4796},{},[4797],{"type":28,"value":4798},"绿联 DXP4800 Plus，Pentium Gold 8505，16GB，2.5GbE",{"type":23,"tag":568,"props":4800,"children":4801},{},[4802],{"type":28,"value":4803},"HDFS 的冷数据目录（NFS）、监控、共享存储",{"type":23,"tag":541,"props":4805,"children":4806},{},[4807,4812,4817],{"type":23,"tag":568,"props":4808,"children":4809},{},[4810],{"type":28,"value":4811},"DGX Spark ×2",{"type":23,"tag":568,"props":4813,"children":4814},{},[4815],{"type":28,"value":4816},"GB10，128GB 统一内存，20 核 ARM",{"type":23,"tag":568,"props":4818,"children":4819},{},[4820],{"type":28,"value":4821},"本地大模型推理和微调，不进 PVE，也不进 YARN",{"type":23,"tag":541,"props":4823,"children":4824},{},[4825,4830,4835],{"type":23,"tag":568,"props":4826,"children":4827},{},[4828],{"type":28,"value":4829},"MacBook Pro",{"type":23,"tag":568,"props":4831,"children":4832},{},[4833],{"type":28,"value":4834},"M1 Pro，16GB",{"type":23,"tag":568,"props":4836,"children":4837},{},[4838],{"type":28,"value":4839},"开发机，Genesis 的 jar 和前端 dist 都在这上面构建",{"type":23,"tag":24,"props":4841,"children":4842},{},[4843],{"type":28,"value":4844},"PVE 集群叫 homelab，pve、pve1、pve2 都是 PVE 9.1.1，Debian 13，6.17 内核。pve3 是后来加的第四台，文档最早只记了三台。8 月 21 号拿 deploy.sh 里的 IP 和文档交叉核对的时候，才把它和上面那批 VM 补录进去，量化平台的三台 VM 那时已经跑在 pve3 上。pve3 上那台 devbox 专门跑重一点的构建和测试。和 Genesis 无关的负载（量化平台、翻译服务、Forge）这里不展开。",{"type":23,"tag":24,"props":4846,"children":4847},{},[4848,4850,4854],{"type":28,"value":4849},"pve1 是一台笔记本，logind 里把合盖动作设成了忽略，合上盖子照常跑。上面 Genesis 的三台分工很简单：101 是数据库节点，MySQL 8.0.46 直接装在系统里，只放 genesis 一个库，Redis 7 跑在容器里；102 跑后端容器，Superset 4.1.1 也装在这台，因为 NAS 那边的镜像源拉不动它的镜像；103 是 nginx 加前端。应用内部怎么分层，写在",{"type":23,"tag":41,"props":4851,"children":4852},{"href":1531},[4853],{"type":28,"value":1534},{"type":28,"value":1720},{"type":23,"tag":24,"props":4856,"children":4857},{},[4858,4860,4865],{"type":28,"value":4859},"DGX Spark 那两台的模型和路由单独写过",{"type":23,"tag":41,"props":4861,"children":4863},{"href":4862},"\u002Fblog\u002F2026-08-30-local-ai-cluster-architecture\u002F",[4864],{"type":28,"value":1658},{"type":28,"value":4866},"，这里不重复。",{"type":23,"tag":50,"props":4868,"children":4870},{"id":4869},"大数据集群7-个-vm-挤在一台机器上",[4871],{"type":28,"value":4872},"大数据集群：7 个 VM 挤在一台机器上",{"type":23,"tag":533,"props":4874,"children":4875},{},[4876,4897],{"type":23,"tag":537,"props":4877,"children":4878},{},[4879],{"type":23,"tag":541,"props":4880,"children":4881},{},[4882,4887,4892],{"type":23,"tag":545,"props":4883,"children":4884},{},[4885],{"type":28,"value":4886},"节点",{"type":23,"tag":545,"props":4888,"children":4889},{},[4890],{"type":28,"value":4891},"规格",{"type":23,"tag":545,"props":4893,"children":4894},{},[4895],{"type":28,"value":4896},"跑什么",{"type":23,"tag":561,"props":4898,"children":4899},{},[4900,4918,4936,4954,4972,4989],{"type":23,"tag":541,"props":4901,"children":4902},{},[4903,4908,4913],{"type":23,"tag":568,"props":4904,"children":4905},{},[4906],{"type":28,"value":4907},"201 master",{"type":23,"tag":568,"props":4909,"children":4910},{},[4911],{"type":28,"value":4912},"6 vCPU（P 核），32GB",{"type":23,"tag":568,"props":4914,"children":4915},{},[4916],{"type":28,"value":4917},"NameNode（主）、ResourceManager、ZooKeeper、HBase Master（主）、Hive Metastore 和 HiveServer2、Spark 3.5.8 Thrift Server、DS 的 Master\u002FApi\u002FAlert\u002FWorker、存 Hive 和 DS 元数据的 MySQL",{"type":23,"tag":541,"props":4919,"children":4920},{},[4921,4926,4931],{"type":23,"tag":568,"props":4922,"children":4923},{},[4924],{"type":28,"value":4925},"202 node1",{"type":23,"tag":568,"props":4927,"children":4928},{},[4929],{"type":28,"value":4930},"4 vCPU（2P + 2E），22GB，1 块 400G 数据盘",{"type":23,"tag":568,"props":4932,"children":4933},{},[4934],{"type":28,"value":4935},"NameNode（备）、ResourceManager、ZooKeeper、HBase Master（备）、DataNode、NodeManager、RegionServer、DS Worker",{"type":23,"tag":541,"props":4937,"children":4938},{},[4939,4944,4949],{"type":23,"tag":568,"props":4940,"children":4941},{},[4942],{"type":28,"value":4943},"203 node2",{"type":23,"tag":568,"props":4945,"children":4946},{},[4947],{"type":28,"value":4948},"4 vCPU（E 核），22GB，2 块 400G 数据盘",{"type":23,"tag":568,"props":4950,"children":4951},{},[4952],{"type":28,"value":4953},"DataNode、NodeManager、ZooKeeper、Kafka、RegionServer、DS Worker",{"type":23,"tag":541,"props":4955,"children":4956},{},[4957,4962,4967],{"type":23,"tag":568,"props":4958,"children":4959},{},[4960],{"type":28,"value":4961},"204 node3",{"type":23,"tag":568,"props":4963,"children":4964},{},[4965],{"type":28,"value":4966},"同上",{"type":23,"tag":568,"props":4968,"children":4969},{},[4970],{"type":28,"value":4971},"DataNode、NodeManager、Kafka、RegionServer、DS Worker",{"type":23,"tag":541,"props":4973,"children":4974},{},[4975,4980,4984],{"type":23,"tag":568,"props":4976,"children":4977},{},[4978],{"type":28,"value":4979},"205 node4",{"type":23,"tag":568,"props":4981,"children":4982},{},[4983],{"type":28,"value":4966},{"type":23,"tag":568,"props":4985,"children":4986},{},[4987],{"type":28,"value":4988},"DataNode、NodeManager、Kafka、RegionServer、Atlas 2.3.0 + Solr 8.11、DS Worker",{"type":23,"tag":541,"props":4990,"children":4991},{},[4992,4997,5002],{"type":23,"tag":568,"props":4993,"children":4994},{},[4995],{"type":28,"value":4996},"206 \u002F 207",{"type":23,"tag":568,"props":4998,"children":4999},{},[5000],{"type":28,"value":5001},"4 vCPU（和数据节点共享 E 核），16GB，无数据盘",{"type":23,"tag":568,"props":5003,"children":5004},{},[5005],{"type":28,"value":5006},"只跑 NodeManager",{"type":23,"tag":24,"props":5008,"children":5009},{},[5010],{"type":28,"value":5011},"DS 是 DolphinScheduler 的简称，Genesis 发布出去的工作流都靠它调度。Spark 和 Flink 的 History Server 也在 201 上，DataX 七台都装了，Hive 客户端分发到了 202 到 205，所以 SQL、装载、导出这类任务落在哪台 Worker 上都能跑。",{"type":23,"tag":24,"props":5013,"children":5014},{},[5015],{"type":28,"value":5016},"pve2 的 CPU 是大小核混合架构，P 核是性能核，E 核是能效核，单线程性能差不少。VM 按角色绑核：201 独占 0–5 号 6 个 P 核，因为 NameNode、ResourceManager 这类组件吃单线程性能；202 拿 2 个 P 核加 2 个 E 核；203 到 205 各 4 个 E 核；206、207 是纯计算节点，和前面几台数据节点共享 E 核；剩下 2 个 E 核和 8GB 内存留给宿主机自己。",{"type":23,"tag":24,"props":5018,"children":5019},{},[5020],{"type":23,"tag":65,"props":5021,"children":5024},{"alt":5022,"src":5023},"pve2 的 CPU 分配。8 个 P 核里 0 到 5 号归 201 独占，6、7 号给 202。16 个 E 核里 202 两个，203、204、205 各四个，宿主机留两个；206、207 不独占，和数据节点共享 E 核。E 核具体编号文档里没列，图中按组排开只是示意。下方列出各 VM 规格：201 是 6 vCPU、32GB，202 是 4 vCPU、22GB，203 到 205 各 4 vCPU、22GB，206、207 各 4 vCPU、16GB，宿主机 2 个 E 核、8GB","\u002Fimages\u002Fblog\u002Fhomelab-deploy\u002Fpve2-cpu.svg",[],{"type":23,"tag":24,"props":5026,"children":5027},{},[5028,5030,5035],{"type":28,"value":5029},"数据盘的布局 9 月 21 号刚修正过：202 只有一块 400G 数据盘，203 到 205 各两块 400G，分别从 pve2 的两块 NVMe 上切出来，206 和 207 没有数据盘。修正之前有两台 DataNode 的一个数据目录落在系统盘上，怎么发现、怎么处理的写在",{"type":23,"tag":41,"props":5031,"children":5033},{"href":5032},"\u002Fblog\u002F2026-09-24-datanode-on-system-disk\u002F",[5034],{"type":28,"value":1837},{"type":28,"value":287},{"type":23,"tag":24,"props":5037,"children":5038},{},[5039],{"type":28,"value":5040},"高可用（HA）是这么做的：NameNode 在 201、202 上一主一备，ZKFC 负责自动切换，编辑日志走 JournalNode。ZKFC 是 HDFS 带的故障切换进程，借 ZooKeeper 盯着主 NameNode，主的挂了就把备的提上来；JournalNode 是主备两边共用的编辑日志存放处，备机靠它跟上主机的元数据变更。ResourceManager 也在这两台上做主备；HBase Master 一主一备；ZooKeeper 三节点；Kafka 三个 broker。Hive Metastore、HiveServer2、DS 的 Master 和那台 MySQL 都只有 201 一份。",{"type":23,"tag":24,"props":5042,"children":5043},{},[5044],{"type":28,"value":5045},"更根本的问题是 7 个 VM 都在 pve2 一台物理机上，物理机一停，这些主备一起停，9 月 20 号就真停了一次。",{"type":23,"tag":50,"props":5047,"children":5049},{"id":5048},"hdfs-和-yarn",[5050],{"type":28,"value":5051},"HDFS 和 YARN",{"type":23,"tag":24,"props":5053,"children":5054},{},[5055,5057,5063],{"type":28,"value":5056},"HDFS 副本数是 2，开了异构存储，也就是让 HDFS 区分不同介质的目录，按策略决定副本放哪种介质上。每台 DataNode 配两个本地 NVMe 目录（DISK）加一个挂在 NAS 上的 NFS 目录（ARCHIVE），按 Warm 策略放：热数据走本地盘，冷副本落到 NAS，这一份是跨了物理机的。Warm 是 HDFS 自带的存储策略之一，副本数为 2 时，一份放 DISK，一份放 ARCHIVE。",{"type":23,"tag":99,"props":5058,"children":5060},{"className":5059},[],[5061],{"type":28,"value":5062},"dfs.datanode.data.dir",{"type":28,"value":5064}," 的模板长这样，dnXXX 换成每台节点自己的子目录，202 因为只有一块数据盘，少一个 DISK 目录：",{"type":23,"tag":2152,"props":5066,"children":5070},{"className":5067,"code":5068,"language":5069,"meta":8,"style":8},"language-xml shiki shiki-themes github-light github-dark","\u003Cproperty>\n  \u003Cname>dfs.datanode.data.dir\u003C\u002Fname>\n  \u003Cvalue>[DISK]file:\u002F\u002F\u002Fdata\u002Fhdfs\u002Fdata,[DISK]file:\u002F\u002F\u002Fdata2\u002Fhdfs\u002Fdata,[ARCHIVE]file:\u002F\u002F\u002F\u003CNAS 挂载目录>\u002FdnXXX\u003C\u002Fvalue>\n\u003C\u002Fproperty>\n","xml",[5071],{"type":23,"tag":99,"props":5072,"children":5073},{"__ignoreMap":8},[5074,5082,5090,5098],{"type":23,"tag":2161,"props":5075,"children":5076},{"class":2163,"line":2164},[5077],{"type":23,"tag":2161,"props":5078,"children":5079},{},[5080],{"type":28,"value":5081},"\u003Cproperty>\n",{"type":23,"tag":2161,"props":5083,"children":5084},{"class":2163,"line":927},[5085],{"type":23,"tag":2161,"props":5086,"children":5087},{},[5088],{"type":28,"value":5089},"  \u003Cname>dfs.datanode.data.dir\u003C\u002Fname>\n",{"type":23,"tag":2161,"props":5091,"children":5092},{"class":2163,"line":924},[5093],{"type":23,"tag":2161,"props":5094,"children":5095},{},[5096],{"type":28,"value":5097},"  \u003Cvalue>[DISK]file:\u002F\u002F\u002Fdata\u002Fhdfs\u002Fdata,[DISK]file:\u002F\u002F\u002Fdata2\u002Fhdfs\u002Fdata,[ARCHIVE]file:\u002F\u002F\u002F\u003CNAS 挂载目录>\u002FdnXXX\u003C\u002Fvalue>\n",{"type":23,"tag":2161,"props":5099,"children":5100},{"class":2163,"line":2190},[5101],{"type":23,"tag":2161,"props":5102,"children":5103},{},[5104],{"type":28,"value":5105},"\u003C\u002Fproperty>\n",{"type":23,"tag":24,"props":5107,"children":5108},{},[5109],{"type":28,"value":5110},"算上 NAS 的 ARCHIVE 空间，集群的 Configured Capacity 大约 59.73TB。",{"type":23,"tag":24,"props":5112,"children":5113},{},[5114],{"type":23,"tag":65,"props":5115,"children":5118},{"alt":5116,"src":5117},"HDFS 异构存储。左边是 pve2 上的一台 DataNode（203 到 205），配三个目录：DISK file:\u002F\u002F\u002Fdata\u002Fhdfs\u002Fdata 在本地 NVMe 数据盘 1，DISK file:\u002F\u002F\u002Fdata2\u002Fhdfs\u002Fdata 在本地 NVMe 数据盘 2，ARCHIVE file:\u002F\u002F\u002F\u003CNAS 挂载目录>\u002FdnXXX 是 NFS 挂载、实际在 NAS 上；202 少一个 DISK 目录。右边是 NAS，每台 DataNode 一个子目录，冷副本落在这里、跨了物理机，Configured Capacity 约 59.73TB 含这部分。底部说明 Warm 策略在副本数为 2 时一份放 DISK、一份放 ARCHIVE","\u002Fimages\u002Fblog\u002Fhomelab-deploy\u002Fhdfs-storage.svg",[],{"type":23,"tag":24,"props":5120,"children":5121},{},[5122,5124,5130],{"type":28,"value":5123},"YARN 用 Capacity Scheduler，按队列切分集群资源，每个队列有保底容量，空闲时可以借别的队列的资源，借到上限为止。它开了 DominantResourceCalculator，分配份额时内存和 CPU 一起算，默认的计算器只看内存。队列分三层。real-time 占 40%，最多能用到 100%，优先级最高，留给实时任务；offline 占 50%，最多 80%，跑 Hive 和 Spark 的离线批；public 占 10%，最多 100%，优先级最低，放临时任务和测试，忙的时候第一个被让出来。6 个 NodeManager 在 202 到 207 上，206、207 各给 YARN 10GB 内存和 3 个 vCPU。Genesis 发布 SQL 时会把项目配的队列写进 ",{"type":23,"tag":99,"props":5125,"children":5127},{"className":5126},[],[5128],{"type":28,"value":5129},"mapreduce.job.queuename",{"type":28,"value":5131},"，Spark Thrift Server 本身跑在 offline 队列里。",{"type":23,"tag":24,"props":5133,"children":5134},{},[5135],{"type":23,"tag":65,"props":5136,"children":5139},{"alt":5137,"src":5138},"YARN 三个队列的保底容量和上限，按集群资源百分比画成横条。real-time 保底 40%、最多 100%，优先级最高，留给实时任务；offline 保底 50%、最多 80%，跑 Hive、Spark 离线批，Spark Thrift Server 也在这；public 保底 10%、最多 100%，优先级最低，临时任务和测试，忙时先让出来。底部注明开了 DominantResourceCalculator，以及 6 个 NodeManager 在 202 到 207 上，206、207 各给 YARN 10GB 内存和 3 个 vCPU","\u002Fimages\u002Fblog\u002Fhomelab-deploy\u002Fyarn-queues.svg",[],{"type":23,"tag":50,"props":5141,"children":5143},{"id":5142},"软件版本",[5144],{"type":28,"value":5142},{"type":23,"tag":533,"props":5146,"children":5147},{},[5148,5169],{"type":23,"tag":537,"props":5149,"children":5150},{},[5151],{"type":23,"tag":541,"props":5152,"children":5153},{},[5154,5159,5164],{"type":23,"tag":545,"props":5155,"children":5156},{},[5157],{"type":28,"value":5158},"组件",{"type":23,"tag":545,"props":5160,"children":5161},{},[5162],{"type":28,"value":5163},"版本",{"type":23,"tag":545,"props":5165,"children":5166},{},[5167],{"type":28,"value":5168},"备注",{"type":23,"tag":561,"props":5170,"children":5171},{},[5172,5190,5207,5225,5243,5260,5278,5296,5313,5330,5348],{"type":23,"tag":541,"props":5173,"children":5174},{},[5175,5180,5185],{"type":23,"tag":568,"props":5176,"children":5177},{},[5178],{"type":28,"value":5179},"VM 系统 \u002F JDK",{"type":23,"tag":568,"props":5181,"children":5182},{},[5183],{"type":28,"value":5184},"Ubuntu Server 24.04 \u002F OpenJDK 8",{"type":23,"tag":568,"props":5186,"children":5187},{},[5188],{"type":28,"value":5189},"部分场景用 JDK 11",{"type":23,"tag":541,"props":5191,"children":5192},{},[5193,5197,5202],{"type":23,"tag":568,"props":5194,"children":5195},{},[5196],{"type":28,"value":4660},{"type":23,"tag":568,"props":5198,"children":5199},{},[5200],{"type":28,"value":5201},"3.3.6",{"type":23,"tag":568,"props":5203,"children":5204},{},[5205],{"type":28,"value":5206},"HDFS HA + YARN",{"type":23,"tag":541,"props":5208,"children":5209},{},[5210,5215,5220],{"type":23,"tag":568,"props":5211,"children":5212},{},[5213],{"type":28,"value":5214},"ZooKeeper",{"type":23,"tag":568,"props":5216,"children":5217},{},[5218],{"type":28,"value":5219},"3.6.4",{"type":23,"tag":568,"props":5221,"children":5222},{},[5223],{"type":28,"value":5224},"三节点",{"type":23,"tag":541,"props":5226,"children":5227},{},[5228,5233,5238],{"type":23,"tag":568,"props":5229,"children":5230},{},[5231],{"type":28,"value":5232},"Hive",{"type":23,"tag":568,"props":5234,"children":5235},{},[5236],{"type":28,"value":5237},"3.1.3",{"type":23,"tag":568,"props":5239,"children":5240},{},[5241],{"type":28,"value":5242},"执行引擎是 Tez 0.10.4",{"type":23,"tag":541,"props":5244,"children":5245},{},[5246,5250,5255],{"type":23,"tag":568,"props":5247,"children":5248},{},[5249],{"type":28,"value":665},{"type":23,"tag":568,"props":5251,"children":5252},{},[5253],{"type":28,"value":5254},"3.5.8",{"type":23,"tag":568,"props":5256,"children":5257},{},[5258],{"type":28,"value":5259},"Thrift Server 跑在 YARN 上；机器上还装着 2.3.4，它的 Thrift 没起",{"type":23,"tag":541,"props":5261,"children":5262},{},[5263,5268,5273],{"type":23,"tag":568,"props":5264,"children":5265},{},[5266],{"type":28,"value":5267},"Iceberg \u002F Hudi",{"type":23,"tag":568,"props":5269,"children":5270},{},[5271],{"type":28,"value":5272},"1.5.2 \u002F 0.15.0",{"type":23,"tag":568,"props":5274,"children":5275},{},[5276],{"type":28,"value":5277},"升到 1.6.1 \u002F 1.2.0 的 canary 没过，Hudi 1.2.0 要 Java 11",{"type":23,"tag":541,"props":5279,"children":5280},{},[5281,5286,5291],{"type":23,"tag":568,"props":5282,"children":5283},{},[5284],{"type":28,"value":5285},"Kafka",{"type":23,"tag":568,"props":5287,"children":5288},{},[5289],{"type":28,"value":5290},"2.8.x",{"type":23,"tag":568,"props":5292,"children":5293},{},[5294],{"type":28,"value":5295},"三个 broker",{"type":23,"tag":541,"props":5297,"children":5298},{},[5299,5303,5308],{"type":23,"tag":568,"props":5300,"children":5301},{},[5302],{"type":28,"value":700},{"type":23,"tag":568,"props":5304,"children":5305},{},[5306],{"type":28,"value":5307},"2.5.8",{"type":23,"tag":568,"props":5309,"children":5310},{},[5311],{"type":28,"value":5312},"一主一备 Master，4 个 RegionServer",{"type":23,"tag":541,"props":5314,"children":5315},{},[5316,5320,5325],{"type":23,"tag":568,"props":5317,"children":5318},{},[5319],{"type":28,"value":1576},{"type":23,"tag":568,"props":5321,"children":5322},{},[5323],{"type":28,"value":5324},"3.2.2",{"type":23,"tag":568,"props":5326,"children":5327},{},[5328],{"type":28,"value":5329},"9 月 4 号起是集群模式，元数据在 MySQL",{"type":23,"tag":541,"props":5331,"children":5332},{},[5333,5338,5343],{"type":23,"tag":568,"props":5334,"children":5335},{},[5336],{"type":28,"value":5337},"Atlas \u002F Solr",{"type":23,"tag":568,"props":5339,"children":5340},{},[5341],{"type":28,"value":5342},"2.3.0 \u002F 8.11",{"type":23,"tag":568,"props":5344,"children":5345},{},[5346],{"type":28,"value":5347},"原生装在 205 上",{"type":23,"tag":541,"props":5349,"children":5350},{},[5351,5355,5360],{"type":23,"tag":568,"props":5352,"children":5353},{},[5354],{"type":28,"value":597},{"type":23,"tag":568,"props":5356,"children":5357},{},[5358],{"type":28,"value":5359},"1.14.6",{"type":23,"tag":568,"props":5361,"children":5362},{},[5363],{"type":28,"value":5364},"201 上起了 History Server",{"type":23,"tag":24,"props":5366,"children":5367},{},[5368],{"type":28,"value":5369},"有几个版本号文档里以前写错过。Iceberg 一度同时写着 1.7.1 和 1.5.2，实际 jar 是 1.5.2，而且 1.7 以后要 Java 11，跟集群的 JDK 8 本来就跑不到一起。Spark 3.5.8 Thrift Server 的端口文档里也写错过，9 月 4 号实查才改过来。",{"type":23,"tag":50,"props":5371,"children":5373},{"id":5372},"监控和备份",[5374],{"type":28,"value":5372},{"type":23,"tag":24,"props":5376,"children":5377},{},[5378],{"type":28,"value":5379},"监控栈放在 NAS 上，用 Docker Compose 起了 Prometheus（数据保留 30 天）、Grafana、Alertmanager、node-exporter、cAdvisor 和 blackbox-exporter。各台宿主机和 VM 都装了 node-exporter，两台 DGX 上跑着 dcgm-exporter 采 GPU 指标。告警规则分三组：主机（宕机、CPU 超 90%、内存超 90%、磁盘超 85%），容器（重启、CPU 超 80%、内存超 1GB），服务（HTTP 端点不可达、SSL 证书快过期），触发后推到飞书群。pve3 的 node-exporter 是 8 月 21 号补登记那次才加进抓取目标的，在那之前一直漏着。Genesis 应用自己的指标还没接进来。",{"type":23,"tag":24,"props":5381,"children":5382},{},[5383,5385,5391,5393,5399,5401,5407],{"type":28,"value":5384},"Genesis 的元数据库有每日备份。101 上每天 03:30 跑一次 MySQL 逻辑备份，保留 14 天。每个文件写完马上 ",{"type":23,"tag":99,"props":5386,"children":5388},{"className":5387},[],[5389],{"type":28,"value":5390},"gzip -t",{"type":28,"value":5392}," 检查压缩包是否完整，再检查有没有 ",{"type":23,"tag":99,"props":5394,"children":5396},{"className":5395},[],[5397],{"type":28,"value":5398},"-- Dump completed",{"type":28,"value":5400}," 结束标记，不对就删掉并以非零退出，免得留下一个看着正常、其实半截的备份。恢复步骤写成了固定流程：先校验文件，停掉 102 的后端，",{"type":23,"tag":99,"props":5402,"children":5404},{"className":5403},[],[5405],{"type":28,"value":5406},"zcat",{"type":28,"value":5408}," 灌回库，核对 dev_node、dev_node_publish、incident、sys_user、dq_rule 这几张关键表的行数，再启动后端。这个流程在 devbox 上演练过一次。还差一份异地副本，NAS 没挂到 101 上，计划在库长到 GB 级之前补上。",{"type":23,"tag":50,"props":5410,"children":5412},{"id":5411},"几条踩坑后定下的规矩",[5413],{"type":28,"value":5411},{"type":23,"tag":76,"props":5415,"children":5417},{"id":5416},"文档会漂移动手之前先实查",[5418],{"type":28,"value":5419},"文档会漂移，动手之前先实查",{"type":23,"tag":24,"props":5421,"children":5422},{},[5423],{"type":28,"value":5424},"9 月 4 号做电商数仓实调时才发现，文档里写的 DS 集群模式根本不存在：201 上跑的是 StandaloneServer 加 H2 内存库，其他节点上没有 WorkerServer，MySQL 里的 dolphinscheduler 库停在 4 月 22 号。H2 内存库的数据只在进程内存里，也就是说 DS 进程只要重启一次，Genesis 发布过的工作流定义、排期和实例历史就全没了。发现以后当天上午就迁成了集群模式加 MySQL。同一个月还对出来几处：Spark Thrift Server 的端口、Iceberg 的版本、Genesis 后端对外的端口，文档和实际都对不上。",{"type":23,"tag":76,"props":5426,"children":5428},{"id":5427},"部署脚本里的地址必须和集群文档对得上",[5429],{"type":28,"value":5427},{"type":23,"tag":24,"props":5431,"children":5432},{},[5433,5435,5441,5443,5449],{"type":28,"value":5434},"Genesis 仓库的 CLAUDE.md 里有一条规定：deploy.sh 里的 IP 必须和集群文档一致，发现不一致先改文档再操作。8 月往 deploy.sh 里加 Forge 的部署路由时，三个节点的 IP 整体错了一个号段，其中两个正好指向 201 和 202。按错的值部署一次，就会在 NameNode 主备、HBase Master 主备所在的两台机器上 ",{"type":23,"tag":99,"props":5436,"children":5438},{"className":5437},[],[5439],{"type":28,"value":5440},"docker compose up -d",{"type":28,"value":5442}," 起 PostgreSQL、Redis 和 Weaviate，跟 Genesis 依赖的 HiveServer2 和 NameNode 抢资源，严重的话直接端口冲突。这个错就是照那条规定交叉核对时抓出来的，又去 pve3 上 ",{"type":23,"tag":99,"props":5444,"children":5446},{"className":5445},[],[5447],{"type":28,"value":5448},"qm list",{"type":28,"value":5450},"、借 guest agent 加逐台 SSH 把真实地址查了一遍，错误的配置还没提交就改掉了。",{"type":23,"tag":76,"props":5452,"children":5454},{"id":5453},"迁移和换库之前先清-t_ds_command下线-t_ds_schedules",[5455,5457,5463,5465],{"type":28,"value":5456},"迁移和换库之前，先清 ",{"type":23,"tag":99,"props":5458,"children":5460},{"className":5459},[],[5461],{"type":28,"value":5462},"t_ds_command",{"type":28,"value":5464},"、下线 ",{"type":23,"tag":99,"props":5466,"children":5468},{"className":5467},[],[5469],{"type":28,"value":5470},"t_ds_schedules",{"type":23,"tag":24,"props":5472,"children":5473},{},[5474,5476,5481,5483,5489,5491,5497],{"type":28,"value":5475},"DS 的定时触发靠 Quartz。Quartz 发现某个触发时刻错过了（比如服务停着的那段时间），会按策略把它补发出来，这叫 misfire。DS 迁到集群模式后第一次启动，Quartz 对 4 月遗留的两条 ONLINE 排期做了 misfire 补发，",{"type":23,"tag":99,"props":5477,"children":5479},{"className":5478},[],[5480],{"type":28,"value":5462},{"type":28,"value":5482}," 一下子冒出 82 条，Master 并发跑起 ",{"type":23,"tag":99,"props":5484,"children":5486},{"className":5485},[],[5487],{"type":28,"value":5488},"gmall_datax.sh",{"type":28,"value":5490},"，拉起了 110 个 ",{"type":23,"tag":99,"props":5492,"children":5494},{"className":5493},[],[5495],{"type":28,"value":5496},"hdfs dfs",{"type":28,"value":5498}," 的 JVM。201 的内存被打爆，OOM killer（内核在内存耗尽时挑进程杀掉的机制）杀掉了 mysqld 和 java 进程，NameNode、ZooKeeper、ResourceManager、HiveServer2、Metastore 一起倒下。",{"type":23,"tag":24,"props":5500,"children":5501},{},[5502,5504,5509],{"type":28,"value":5503},"收拾的办法是清空 ",{"type":23,"tag":99,"props":5505,"children":5507},{"className":5506},[],[5508],{"type":28,"value":5462},{"type":28,"value":5510},"，残留实例置为 FAILURE，遗留排期下线，再用 cluster 脚本把 Hadoop 各组件恢复起来，HA 是正常的。201 本来就挤，DS 的 JVM 堆原来配的 4g×2 在这台上直接把内存打爆，后来改成 Master、Worker 512m 到 2g，Api 1g，Alert 512m。",{"type":23,"tag":76,"props":5512,"children":5514},{"id":5513},"ds-的-worker-一台一台串行起",[5515],{"type":28,"value":5516},"DS 的 Worker 一台一台串行起",{"type":23,"tag":24,"props":5518,"children":5519},{},[5520,5522,5528,5530,5536,5538,5544,5546,5552],{"type":28,"value":5521},"用后台子 shell 并行起的话，Worker 会随 ssh 退出被一起带走。新加 Worker 节点时还要同步 ",{"type":23,"tag":99,"props":5523,"children":5525},{"className":5524},[],[5526],{"type":28,"value":5527},"\u002Fetc\u002Fprofile.d\u002Fbigdata.sh",{"type":28,"value":5529},"：Worker 上任务的环境实际来自登录壳加载的这个文件，DS 自带的 ",{"type":23,"tag":99,"props":5531,"children":5533},{"className":5532},[],[5534],{"type":28,"value":5535},"dolphinscheduler_env.sh",{"type":28,"value":5537}," 因为 ",{"type":23,"tag":99,"props":5539,"children":5541},{"className":5540},[],[5542],{"type":28,"value":5543},"DOLPHINSCHEDULER_HOME",{"type":28,"value":5545}," 指向一个不存在的目录，从来没生效过。205 原本就缺这个文件，SQL 任务直接报 ",{"type":23,"tag":99,"props":5547,"children":5549},{"className":5548},[],[5550],{"type":28,"value":5551},"beeline: command not found",{"type":28,"value":287},{"type":23,"tag":76,"props":5554,"children":5556},{"id":5555},"改完和开机有关的东西一定真重启一次",[5557],{"type":28,"value":5558},"改完和开机有关的东西，一定真重启一次",{"type":23,"tag":24,"props":5560,"children":5561},{},[5562,5564,5570,5572,5578,5580,5586,5587,5592,5594,5600],{"type":28,"value":5563},"9 月 20 号傍晚 pve2 被按了一下电源键，系统优雅关机，重新上电后有三台节点开机即残废，原因全在 fstab 和 systemd 挂载单元上，另外 205 没设随宿主机自启。同一轮恢复里还发现两台 DataNode 写在系统盘上，以及经 ",{"type":23,"tag":99,"props":5565,"children":5567},{"className":5566},[],[5568],{"type":28,"value":5569},"ssh -tt",{"type":28,"value":5571}," 透传 ",{"type":23,"tag":99,"props":5573,"children":5575},{"className":5574},[],[5576],{"type":28,"value":5577},"cluster start all",{"type":28,"value":5579}," 之后，主节点本机起的几个守护进程没了。这三件事分别写在",{"type":23,"tag":41,"props":5581,"children":5583},{"href":5582},"\u002Fblog\u002F2026-09-22-pve2-power-key-boot-path\u002F",[5584],{"type":28,"value":5585},"开机路径那篇",{"type":28,"value":2541},{"type":23,"tag":41,"props":5588,"children":5589},{"href":5032},[5590],{"type":28,"value":5591},"DataNode 那篇",{"type":28,"value":5593},"和",{"type":23,"tag":41,"props":5595,"children":5597},{"href":5596},"\u002Fblog\u002F2026-09-26-ssh-tty-sighup-daemons\u002F",[5598],{"type":28,"value":5599},"ssh -tt 那篇",{"type":28,"value":1720},{"type":23,"tag":24,"props":5602,"children":5603},{},[5604,5606,5612,5614,5620,5622,5628],{"type":28,"value":5605},"修过的 203、204、205、206 都真重启验证过，其中 203、204、205 重启后根分区可写，数据盘开机 3 秒内自动挂好，",{"type":23,"tag":99,"props":5607,"children":5609},{"className":5608},[],[5610],{"type":28,"value":5611},"local-fs.target",{"type":28,"value":5613}," 正常，没有失败的单元。pve2 上的 VM 现在全部随宿主机自启，七个节点上不再有被 mask 的挂载单元。恢复完 ",{"type":23,"tag":99,"props":5615,"children":5617},{"className":5616},[],[5618],{"type":28,"value":5619},"cluster health",{"type":28,"value":5621}," 全绿，",{"type":23,"tag":99,"props":5623,"children":5625},{"className":5624},[],[5626],{"type":28,"value":5627},"cluster test",{"type":28,"value":5629}," 10 项全过，Genesis 从前端、nginx、后端到 MySQL、Redis、DS、Atlas 的整条链路，包括血缘图，都实测正常。",{"type":23,"tag":50,"props":5631,"children":5633},{"id":5632},"还挂着的两个问题",[5634],{"type":28,"value":5632},{"type":23,"tag":24,"props":5636,"children":5637},{},[5638,5640,5646,5648,5654,5656,5662,5664,5670,5672,5678,5680,5686],{"type":28,"value":5639},"还有两个环境问题，目前都靠数据源 jdbcUrl 上的参数绕过去。一个是 ",{"type":23,"tag":99,"props":5641,"children":5643},{"className":5642},[],[5644],{"type":28,"value":5645},"hive-env.sh",{"type":28,"value":5647}," 给 HiveServer2 的 ",{"type":23,"tag":99,"props":5649,"children":5651},{"className":5650},[],[5652],{"type":28,"value":5653},"HADOOP_CLIENT_OPTS",{"type":28,"value":5655}," 挂了 JMX javaagent，被 MapredLocalTask 的子 JVM 继承以后重复绑同一个端口，所有 map-join 都失败，现在用 ",{"type":23,"tag":99,"props":5657,"children":5659},{"className":5658},[],[5660],{"type":28,"value":5661},"hive.exec.submit.local.task.via.child=false",{"type":28,"value":5663}," 规避。另一个是 ",{"type":23,"tag":99,"props":5665,"children":5667},{"className":5666},[],[5668],{"type":28,"value":5669},"hive.exec.compress.output=true",{"type":28,"value":5671}," 会把 ADS 的文本表写成 ",{"type":23,"tag":99,"props":5673,"children":5675},{"className":5674},[],[5676],{"type":28,"value":5677},".deflate",{"type":28,"value":5679},"，DataX 的 hdfsreader 读不了，用 ",{"type":23,"tag":99,"props":5681,"children":5683},{"className":5682},[],[5684],{"type":28,"value":5685},"hive.exec.compress.output=false",{"type":28,"value":5687}," 规避。根上的配置还没改。",{"type":23,"tag":2730,"props":5689,"children":5690},{},[5691],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":5693},[5694,5695,5696,5697,5698,5699,5707],{"id":4676,"depth":927,"text":4676},{"id":4869,"depth":927,"text":4872},{"id":5048,"depth":927,"text":5051},{"id":5142,"depth":927,"text":5142},{"id":5372,"depth":927,"text":5372},{"id":5411,"depth":927,"text":5411,"children":5700},[5701,5702,5703,5705,5706],{"id":5416,"depth":924,"text":5419},{"id":5427,"depth":924,"text":5427},{"id":5453,"depth":924,"text":5704},"迁移和换库之前，先清 t_ds_command、下线 t_ds_schedules",{"id":5513,"depth":924,"text":5516},{"id":5555,"depth":924,"text":5558},{"id":5632,"depth":927,"text":5632},"content:blog:2026-09-28-homelab-production-deployment.md","blog\u002F2026-09-28-homelab-production-deployment.md","blog\u002F2026-09-28-homelab-production-deployment",{"_path":5712,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":5713,"description":5714,"date":5715,"tags":5716,"body":5720,"_type":937,"_id":6698,"_source":939,"_file":6699,"_stem":6700,"_extension":942},"\u002Fblog\u002F2026-09-26-ssh-tty-sighup-daemons","主节点上的守护进程没了，ssh -tt 嫌疑最大","从 mac 经 ssh -tt 透传 cluster start all 以后，主节点本机起的三个守护进程没了。改成 ssh -n 以后验证通过，但这个解释还有几处对不上。","2026-09-26",[5717,5718,4661,5719],"SSH","Linux","问题复盘",{"type":20,"children":5721,"toc":6691},[5722,5755,5760,5772,5777,5782,5793,5965,6007,6013,6033,6059,6067,6078,6083,6095,6411,6438,6465,6473,6478,6507,6512,6517,6536,6564,6626,6645,6658,6666,6687],{"type":23,"tag":24,"props":5723,"children":5724},{},[5725,5727,5731,5733,5738,5740,5746,5748,5753],{"type":28,"value":5726},"9 月 21 号恢复 pve2 的时候（经过在",{"type":23,"tag":41,"props":5728,"children":5729},{"href":5582},[5730],{"type":28,"value":1837},{"type":28,"value":5732},"），我在 mac 上跑了一次 ",{"type":23,"tag":99,"props":5734,"children":5736},{"className":5735},[],[5737],{"type":28,"value":5577},{"type":28,"value":5739},"。mac 上的 ",{"type":23,"tag":99,"props":5741,"children":5743},{"className":5742},[],[5744],{"type":28,"value":5745},"cluster",{"type":28,"value":5747}," 是个包装脚本，它把命令通过 ssh 透传给主节点（201）上的集群脚本，用法和在主节点上直接敲 ",{"type":23,"tag":99,"props":5749,"children":5751},{"className":5750},[],[5752],{"type":28,"value":5745},{"type":28,"value":5754}," 一样，输出也带颜色。start all 就是由主节点那边按 ZooKeeper、HDFS、YARN、Hive、Kafka、HBase 的顺序一路起下去。",{"type":23,"tag":24,"props":5756,"children":5757},{},[5758],{"type":28,"value":5759},"下面的经过是根据当时的提交记录和脚本整理的。",{"type":23,"tag":24,"props":5761,"children":5762},{},[5763,5765,5770],{"type":28,"value":5764},"start all 跑完 7 分钟后看 ",{"type":23,"tag":99,"props":5766,"children":5768},{"className":5767},[],[5769],{"type":28,"value":5619},{"type":28,"value":5771},"：YARN 异常；HBase 只剩 202 上的备用 HMaster 在顶着；Spark Thrift Server 的端口没了。同一时间，经 ssh 起到其他节点上的 DataNode、NodeManager、Kafka 全都活着。",{"type":23,"tag":50,"props":5773,"children":5775},{"id":5774},"死掉的几个有什么共同点",[5776],{"type":28,"value":5774},{"type":23,"tag":24,"props":5778,"children":5779},{},[5780],{"type":28,"value":5781},"ResourceManager、HMaster、Spark Thrift Server，按当时的记录，这三个都是集群脚本在主节点本机直接拉起来的；活下来的那些，是从主节点再 ssh 到别的节点起的。差别就在是不是主节点本机的进程。",{"type":23,"tag":24,"props":5783,"children":5784},{},[5785,5787,5792],{"type":28,"value":5786},"再看 mac 上的包装脚本，透传用的是 ",{"type":23,"tag":99,"props":5788,"children":5790},{"className":5789},[],[5791],{"type":28,"value":5569},{"type":28,"value":445},{"type":23,"tag":2152,"props":5794,"children":5798},{"className":5795,"code":5796,"language":5797,"meta":8,"style":8},"language-bash shiki shiki-themes github-light github-dark","# 透传执行：保留终端颜色（-t 分配伪终端）\n# beeline 等交互式命令需要完整 PTY；非交互命令用 -tt 也可正常运行\n_run() {\n  ssh -tt -o ConnectTimeout=5 -o BatchMode=yes \\\n      \"${MASTER_USER}@${MASTER_HOST}\" \\\n      \"${REMOTE_CMD} $(printf '%q ' \"$@\")\" 2>\u002Fdev\u002Fnull\n}\n","bash",[5799],{"type":23,"tag":99,"props":5800,"children":5801},{"__ignoreMap":8},[5802,5811,5819,5834,5877,5909,5957],{"type":23,"tag":2161,"props":5803,"children":5804},{"class":2163,"line":2164},[5805],{"type":23,"tag":2161,"props":5806,"children":5808},{"style":5807},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[5809],{"type":28,"value":5810},"# 透传执行：保留终端颜色（-t 分配伪终端）\n",{"type":23,"tag":2161,"props":5812,"children":5813},{"class":2163,"line":927},[5814],{"type":23,"tag":2161,"props":5815,"children":5816},{"style":5807},[5817],{"type":28,"value":5818},"# beeline 等交互式命令需要完整 PTY；非交互命令用 -tt 也可正常运行\n",{"type":23,"tag":2161,"props":5820,"children":5821},{"class":2163,"line":924},[5822,5828],{"type":23,"tag":2161,"props":5823,"children":5825},{"style":5824},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[5826],{"type":28,"value":5827},"_run",{"type":23,"tag":2161,"props":5829,"children":5831},{"style":5830},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[5832],{"type":28,"value":5833},"() {\n",{"type":23,"tag":2161,"props":5835,"children":5836},{"class":2163,"line":2190},[5837,5842,5848,5853,5859,5863,5867,5872],{"type":23,"tag":2161,"props":5838,"children":5839},{"style":5824},[5840],{"type":28,"value":5841},"  ssh",{"type":23,"tag":2161,"props":5843,"children":5845},{"style":5844},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[5846],{"type":28,"value":5847}," -tt",{"type":23,"tag":2161,"props":5849,"children":5850},{"style":5844},[5851],{"type":28,"value":5852}," -o",{"type":23,"tag":2161,"props":5854,"children":5856},{"style":5855},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[5857],{"type":28,"value":5858}," ConnectTimeout=",{"type":23,"tag":2161,"props":5860,"children":5861},{"style":5844},[5862],{"type":28,"value":3741},{"type":23,"tag":2161,"props":5864,"children":5865},{"style":5844},[5866],{"type":28,"value":5852},{"type":23,"tag":2161,"props":5868,"children":5869},{"style":5855},[5870],{"type":28,"value":5871}," BatchMode=yes",{"type":23,"tag":2161,"props":5873,"children":5874},{"style":5844},[5875],{"type":28,"value":5876}," \\\n",{"type":23,"tag":2161,"props":5878,"children":5879},{"class":2163,"line":2199},[5880,5885,5890,5895,5900,5905],{"type":23,"tag":2161,"props":5881,"children":5882},{"style":5855},[5883],{"type":28,"value":5884},"      \"${",{"type":23,"tag":2161,"props":5886,"children":5887},{"style":5830},[5888],{"type":28,"value":5889},"MASTER_USER",{"type":23,"tag":2161,"props":5891,"children":5892},{"style":5855},[5893],{"type":28,"value":5894},"}@${",{"type":23,"tag":2161,"props":5896,"children":5897},{"style":5830},[5898],{"type":28,"value":5899},"MASTER_HOST",{"type":23,"tag":2161,"props":5901,"children":5902},{"style":5855},[5903],{"type":28,"value":5904},"}\"",{"type":23,"tag":2161,"props":5906,"children":5907},{"style":5844},[5908],{"type":28,"value":5876},{"type":23,"tag":2161,"props":5910,"children":5911},{"class":2163,"line":2208},[5912,5916,5921,5926,5931,5936,5941,5946,5952],{"type":23,"tag":2161,"props":5913,"children":5914},{"style":5855},[5915],{"type":28,"value":5884},{"type":23,"tag":2161,"props":5917,"children":5918},{"style":5830},[5919],{"type":28,"value":5920},"REMOTE_CMD",{"type":23,"tag":2161,"props":5922,"children":5923},{"style":5855},[5924],{"type":28,"value":5925},"} $(",{"type":23,"tag":2161,"props":5927,"children":5928},{"style":5844},[5929],{"type":28,"value":5930},"printf",{"type":23,"tag":2161,"props":5932,"children":5933},{"style":5855},[5934],{"type":28,"value":5935}," '%q ' \"",{"type":23,"tag":2161,"props":5937,"children":5938},{"style":5844},[5939],{"type":28,"value":5940},"$@",{"type":23,"tag":2161,"props":5942,"children":5943},{"style":5855},[5944],{"type":28,"value":5945},"\")\"",{"type":23,"tag":2161,"props":5947,"children":5949},{"style":5948},"--shiki-default:#D73A49;--shiki-dark:#F97583",[5950],{"type":28,"value":5951}," 2>",{"type":23,"tag":2161,"props":5953,"children":5954},{"style":5855},[5955],{"type":28,"value":5956},"\u002Fdev\u002Fnull\n",{"type":23,"tag":2161,"props":5958,"children":5959},{"class":2163,"line":2217},[5960],{"type":23,"tag":2161,"props":5961,"children":5962},{"style":5830},[5963],{"type":28,"value":5964},"}\n",{"type":23,"tag":24,"props":5966,"children":5967},{},[5968,5970,5976,5978,5984,5986,5992,5994,5999,6001,6006],{"type":28,"value":5969},"当初加 ",{"type":23,"tag":99,"props":5971,"children":5973},{"className":5972},[],[5974],{"type":28,"value":5975},"-tt",{"type":28,"value":5977}," 是为了保留颜色，也为了让 beeline 这种交互命令能用。注释里还写着\"非交互命令用 -tt 也可正常运行\"，这次就栽在这句上。同一个脚本里检查 ssh 连通性的 ",{"type":23,"tag":99,"props":5979,"children":5981},{"className":5980},[],[5982],{"type":28,"value":5983},"_check_ssh",{"type":28,"value":5985}," 用的一直是 ",{"type":23,"tag":99,"props":5987,"children":5989},{"className":5988},[],[5990],{"type":28,"value":5991},"ssh -n",{"type":28,"value":5993},"，只有真正干活的 ",{"type":23,"tag":99,"props":5995,"children":5997},{"className":5996},[],[5998],{"type":28,"value":5827},{"type":28,"value":6000}," 用了 ",{"type":23,"tag":99,"props":6002,"children":6004},{"className":6003},[],[6005],{"type":28,"value":5975},{"type":28,"value":287},{"type":23,"tag":50,"props":6008,"children":6010},{"id":6009},"tt-为什么会把进程带走",[6011],{"type":28,"value":6012},"-tt 为什么会把进程带走",{"type":23,"tag":24,"props":6014,"children":6015},{},[6016,6018,6024,6025,6031],{"type":28,"value":6017},"先说几个词。伪终端（PTY）是内核模拟出来的终端设备，sshd 用它让远端的程序以为自己连着一个真的终端，",{"type":23,"tag":99,"props":6019,"children":6021},{"className":6020},[],[6022],{"type":28,"value":6023},"top",{"type":28,"value":2541},{"type":23,"tag":99,"props":6026,"children":6028},{"className":6027},[],[6029],{"type":28,"value":6030},"vim",{"type":28,"value":6032},"、beeline 这类交互程序离了它就没法正常用。一个终端会带着一个会话，会话里的进程又分成几个进程组，其中一个是前台进程组。SIGHUP 是\"挂断\"信号，名字来自当年终端连着的电话线挂断：终端没了，内核就用它通知还挂在这个终端上的进程，大多数程序收到以后默认直接退出。",{"type":23,"tag":24,"props":6034,"children":6035},{},[6036,6042,6044,6049,6051,6057],{"type":23,"tag":99,"props":6037,"children":6039},{"className":6038},[],[6040],{"type":28,"value":6041},"ssh -t",{"type":28,"value":6043}," 会在远端分配一个 PTY，",{"type":23,"tag":99,"props":6045,"children":6047},{"className":6046},[],[6048],{"type":28,"value":5975},{"type":28,"value":6050}," 是强制分配，哪怕本地没有终端也照样分配。远端命令就跑在以这个 PTY 为控制终端的会话里。会话结束、PTY 被销毁时，内核会给这个终端的前台进程组发 SIGHUP。非交互的 bash 不开作业控制，用 ",{"type":23,"tag":99,"props":6052,"children":6054},{"className":6053},[],[6055],{"type":28,"value":6056},"&",{"type":28,"value":6058}," 放到后台的进程还留在 shell 的进程组里，会一起收到。从主节点 ssh 到别的节点起的进程，属于另一台机器上的另一个会话，这个信号碰不到它们。当时的判断就是这样：主节点本机起的守护进程，跟着 ssh 会话的结束一起被带走了。",{"type":23,"tag":24,"props":6060,"children":6061},{},[6062],{"type":23,"tag":65,"props":6063,"children":6066},{"alt":6064,"src":6065},"ssh -tt 透传 cluster start all 时的进程关系。mac 上的包装脚本用 ssh -tt 连到主节点 201，远端分配的 PTY 是这个会话的控制终端，会话里是非交互 bash 和集群脚本，集群脚本在本机直接拉起的 ResourceManager、HBase HMaster、Spark Thrift Server 都标为没了。集群脚本再 ssh 到 202 到 207 去起的 DataNode、NodeManager、Kafka 全都活着，它们属于另一台机器的另一个会话。底部注明这是当时的判断，以及仓库里的脚本是从 201 再 ssh 回自己去起 Spark Thrift Server 的","\u002Fimages\u002Fblog\u002Fssh-sighup\u002Fprocess-session.svg",[],{"type":23,"tag":24,"props":6068,"children":6069},{},[6070,6072,6076],{"type":28,"value":6071},"这种事之前其实见过一回。9 月 4 号把 DolphinScheduler 迁到集群模式的时候（经过在",{"type":23,"tag":41,"props":6073,"children":6074},{"href":1715},[6075],{"type":28,"value":1718},{"type":28,"value":6077},"），Worker 用后台子 shell 并行启动，进程会随 ssh 退出被带走，当时只记了一条\"Worker 必须逐节点串行启动\"就绕过去了。两次都是进程的生命周期和 ssh 会话绑在了一起。",{"type":23,"tag":50,"props":6079,"children":6081},{"id":6080},"怎么改的",[6082],{"type":28,"value":6080},{"type":23,"tag":24,"props":6084,"children":6085},{},[6086,6088,6093],{"type":28,"value":6087},"默认改成 ",{"type":23,"tag":99,"props":6089,"children":6091},{"className":6090},[],[6092],{"type":28,"value":5991},{"type":28,"value":6094},"，只有交互式的 beeline 才分配 PTY：",{"type":23,"tag":2152,"props":6096,"children":6098},{"className":5795,"code":6097,"language":5797,"meta":8,"style":8},"_needs_pty() {\n  case \"$1\" in\n    beeline) [ $# -eq 1 ] ;;   # `beeline check` 是非交互的，不需要 PTY\n    *)       return 1 ;;\n  esac\n}\n\n_run() {\n  local ssh_tty=\"-n\"\n  _needs_pty \"$@\" && ssh_tty=\"-tt\"\n  ssh $ssh_tty -o ConnectTimeout=5 -o BatchMode=yes \\\n      \"${MASTER_USER}@${MASTER_HOST}\" \\\n      \"${REMOTE_CMD} $(printf '%q ' \"$@\")\" 2>\u002Fdev\u002Fnull\n}\n",[6099],{"type":23,"tag":99,"props":6100,"children":6101},{"__ignoreMap":8},[6102,6114,6142,6186,6208,6216,6223,6230,6241,6264,6298,6335,6363,6403],{"type":23,"tag":2161,"props":6103,"children":6104},{"class":2163,"line":2164},[6105,6110],{"type":23,"tag":2161,"props":6106,"children":6107},{"style":5824},[6108],{"type":28,"value":6109},"_needs_pty",{"type":23,"tag":2161,"props":6111,"children":6112},{"style":5830},[6113],{"type":28,"value":5833},{"type":23,"tag":2161,"props":6115,"children":6116},{"class":2163,"line":927},[6117,6122,6127,6132,6137],{"type":23,"tag":2161,"props":6118,"children":6119},{"style":5948},[6120],{"type":28,"value":6121},"  case",{"type":23,"tag":2161,"props":6123,"children":6124},{"style":5855},[6125],{"type":28,"value":6126}," \"",{"type":23,"tag":2161,"props":6128,"children":6129},{"style":5844},[6130],{"type":28,"value":6131},"$1",{"type":23,"tag":2161,"props":6133,"children":6134},{"style":5855},[6135],{"type":28,"value":6136},"\"",{"type":23,"tag":2161,"props":6138,"children":6139},{"style":5948},[6140],{"type":28,"value":6141}," in\n",{"type":23,"tag":2161,"props":6143,"children":6144},{"class":2163,"line":924},[6145,6151,6156,6161,6166,6171,6176,6181],{"type":23,"tag":2161,"props":6146,"children":6148},{"style":6147},"--shiki-default:#032F62;--shiki-dark:#DBEDFF",[6149],{"type":28,"value":6150},"    beeline",{"type":23,"tag":2161,"props":6152,"children":6153},{"style":5948},[6154],{"type":28,"value":6155},")",{"type":23,"tag":2161,"props":6157,"children":6158},{"style":5830},[6159],{"type":28,"value":6160}," [ ",{"type":23,"tag":2161,"props":6162,"children":6163},{"style":5844},[6164],{"type":28,"value":6165},"$#",{"type":23,"tag":2161,"props":6167,"children":6168},{"style":5948},[6169],{"type":28,"value":6170}," -eq",{"type":23,"tag":2161,"props":6172,"children":6173},{"style":5844},[6174],{"type":28,"value":6175}," 1",{"type":23,"tag":2161,"props":6177,"children":6178},{"style":5830},[6179],{"type":28,"value":6180}," ] ;;   ",{"type":23,"tag":2161,"props":6182,"children":6183},{"style":5807},[6184],{"type":28,"value":6185},"# `beeline check` 是非交互的，不需要 PTY\n",{"type":23,"tag":2161,"props":6187,"children":6188},{"class":2163,"line":2190},[6189,6194,6199,6203],{"type":23,"tag":2161,"props":6190,"children":6191},{"style":5948},[6192],{"type":28,"value":6193},"    *)",{"type":23,"tag":2161,"props":6195,"children":6196},{"style":5948},[6197],{"type":28,"value":6198},"       return",{"type":23,"tag":2161,"props":6200,"children":6201},{"style":5844},[6202],{"type":28,"value":6175},{"type":23,"tag":2161,"props":6204,"children":6205},{"style":5830},[6206],{"type":28,"value":6207}," ;;\n",{"type":23,"tag":2161,"props":6209,"children":6210},{"class":2163,"line":2199},[6211],{"type":23,"tag":2161,"props":6212,"children":6213},{"style":5948},[6214],{"type":28,"value":6215},"  esac\n",{"type":23,"tag":2161,"props":6217,"children":6218},{"class":2163,"line":2208},[6219],{"type":23,"tag":2161,"props":6220,"children":6221},{"style":5830},[6222],{"type":28,"value":5964},{"type":23,"tag":2161,"props":6224,"children":6225},{"class":2163,"line":2217},[6226],{"type":23,"tag":2161,"props":6227,"children":6228},{"emptyLinePlaceholder":2176},[6229],{"type":28,"value":2179},{"type":23,"tag":2161,"props":6231,"children":6232},{"class":2163,"line":2226},[6233,6237],{"type":23,"tag":2161,"props":6234,"children":6235},{"style":5824},[6236],{"type":28,"value":5827},{"type":23,"tag":2161,"props":6238,"children":6239},{"style":5830},[6240],{"type":28,"value":5833},{"type":23,"tag":2161,"props":6242,"children":6243},{"class":2163,"line":2235},[6244,6249,6254,6259],{"type":23,"tag":2161,"props":6245,"children":6246},{"style":5948},[6247],{"type":28,"value":6248},"  local",{"type":23,"tag":2161,"props":6250,"children":6251},{"style":5830},[6252],{"type":28,"value":6253}," ssh_tty",{"type":23,"tag":2161,"props":6255,"children":6256},{"style":5948},[6257],{"type":28,"value":6258},"=",{"type":23,"tag":2161,"props":6260,"children":6261},{"style":5855},[6262],{"type":28,"value":6263},"\"-n\"\n",{"type":23,"tag":2161,"props":6265,"children":6266},{"class":2163,"line":2244},[6267,6272,6276,6280,6284,6289,6293],{"type":23,"tag":2161,"props":6268,"children":6269},{"style":5824},[6270],{"type":28,"value":6271},"  _needs_pty",{"type":23,"tag":2161,"props":6273,"children":6274},{"style":5855},[6275],{"type":28,"value":6126},{"type":23,"tag":2161,"props":6277,"children":6278},{"style":5844},[6279],{"type":28,"value":5940},{"type":23,"tag":2161,"props":6281,"children":6282},{"style":5855},[6283],{"type":28,"value":6136},{"type":23,"tag":2161,"props":6285,"children":6286},{"style":5830},[6287],{"type":28,"value":6288}," && ssh_tty",{"type":23,"tag":2161,"props":6290,"children":6291},{"style":5948},[6292],{"type":28,"value":6258},{"type":23,"tag":2161,"props":6294,"children":6295},{"style":5855},[6296],{"type":28,"value":6297},"\"-tt\"\n",{"type":23,"tag":2161,"props":6299,"children":6300},{"class":2163,"line":2253},[6301,6305,6310,6315,6319,6323,6327,6331],{"type":23,"tag":2161,"props":6302,"children":6303},{"style":5824},[6304],{"type":28,"value":5841},{"type":23,"tag":2161,"props":6306,"children":6307},{"style":5830},[6308],{"type":28,"value":6309}," $ssh_tty ",{"type":23,"tag":2161,"props":6311,"children":6312},{"style":5844},[6313],{"type":28,"value":6314},"-o",{"type":23,"tag":2161,"props":6316,"children":6317},{"style":5855},[6318],{"type":28,"value":5858},{"type":23,"tag":2161,"props":6320,"children":6321},{"style":5844},[6322],{"type":28,"value":3741},{"type":23,"tag":2161,"props":6324,"children":6325},{"style":5844},[6326],{"type":28,"value":5852},{"type":23,"tag":2161,"props":6328,"children":6329},{"style":5855},[6330],{"type":28,"value":5871},{"type":23,"tag":2161,"props":6332,"children":6333},{"style":5844},[6334],{"type":28,"value":5876},{"type":23,"tag":2161,"props":6336,"children":6338},{"class":2163,"line":6337},12,[6339,6343,6347,6351,6355,6359],{"type":23,"tag":2161,"props":6340,"children":6341},{"style":5855},[6342],{"type":28,"value":5884},{"type":23,"tag":2161,"props":6344,"children":6345},{"style":5830},[6346],{"type":28,"value":5889},{"type":23,"tag":2161,"props":6348,"children":6349},{"style":5855},[6350],{"type":28,"value":5894},{"type":23,"tag":2161,"props":6352,"children":6353},{"style":5830},[6354],{"type":28,"value":5899},{"type":23,"tag":2161,"props":6356,"children":6357},{"style":5855},[6358],{"type":28,"value":5904},{"type":23,"tag":2161,"props":6360,"children":6361},{"style":5844},[6362],{"type":28,"value":5876},{"type":23,"tag":2161,"props":6364,"children":6366},{"class":2163,"line":6365},13,[6367,6371,6375,6379,6383,6387,6391,6395,6399],{"type":23,"tag":2161,"props":6368,"children":6369},{"style":5855},[6370],{"type":28,"value":5884},{"type":23,"tag":2161,"props":6372,"children":6373},{"style":5830},[6374],{"type":28,"value":5920},{"type":23,"tag":2161,"props":6376,"children":6377},{"style":5855},[6378],{"type":28,"value":5925},{"type":23,"tag":2161,"props":6380,"children":6381},{"style":5844},[6382],{"type":28,"value":5930},{"type":23,"tag":2161,"props":6384,"children":6385},{"style":5855},[6386],{"type":28,"value":5935},{"type":23,"tag":2161,"props":6388,"children":6389},{"style":5844},[6390],{"type":28,"value":5940},{"type":23,"tag":2161,"props":6392,"children":6393},{"style":5855},[6394],{"type":28,"value":5945},{"type":23,"tag":2161,"props":6396,"children":6397},{"style":5948},[6398],{"type":28,"value":5951},{"type":23,"tag":2161,"props":6400,"children":6401},{"style":5855},[6402],{"type":28,"value":5956},{"type":23,"tag":2161,"props":6404,"children":6406},{"class":2163,"line":6405},14,[6407],{"type":23,"tag":2161,"props":6408,"children":6409},{"style":5830},[6410],{"type":28,"value":5964},{"type":23,"tag":24,"props":6412,"children":6413},{},[6414,6420,6422,6428,6430,6436],{"type":23,"tag":99,"props":6415,"children":6417},{"className":6416},[],[6418],{"type":28,"value":6419},"-n",{"type":28,"value":6421}," 把 stdin 接到 \u002Fdev\u002Fnull。带了远端命令又没加 ",{"type":23,"tag":99,"props":6423,"children":6425},{"className":6424},[],[6426],{"type":28,"value":6427},"-t",{"type":28,"value":6429},"，ssh 就不会分配 PTY。",{"type":23,"tag":99,"props":6431,"children":6433},{"className":6432},[],[6434],{"type":28,"value":6435},"beeline check",{"type":28,"value":6437}," 这种带子命令的调用是非交互的，也不给 PTY。",{"type":23,"tag":24,"props":6439,"children":6440},{},[6441,6443,6448,6450,6456,6458,6463],{"type":28,"value":6442},"改之前确认了一下颜色会不会丢。不少命令行工具发现输出不是终端，就会自动关掉颜色，当初加 ",{"type":23,"tag":99,"props":6444,"children":6446},{"className":6445},[],[6447],{"type":28,"value":6427},{"type":28,"value":6449}," 也是怕这个。这个集群脚本不一样，颜色是写死的 ANSI 转义，",{"type":23,"tag":99,"props":6451,"children":6453},{"className":6452},[],[6454],{"type":28,"value":6455},"RED='\\033[0;31m'",{"type":28,"value":6457}," 这种变量，不检测输出是不是终端，所以 ",{"type":23,"tag":99,"props":6459,"children":6461},{"className":6460},[],[6462],{"type":28,"value":6419},{"type":28,"value":6464}," 下颜色照样在。",{"type":23,"tag":24,"props":6466,"children":6467},{},[6468],{"type":23,"tag":65,"props":6469,"children":6472},{"alt":6470,"src":6471},"ssh -tt 和 ssh -n 的对比表。远端终端：-tt 强制分配 PTY，本地没终端也分配；-n 不分配。stdin：-tt 接本地输入；-n 接到 \u002Fdev\u002Fnull。会话结束时：-tt 销毁 PTY，内核给前台进程组发 SIGHUP；-n 没有控制终端，也就没有这次挂断信号。颜色：两者都有，因为脚本里的 ANSI 转义是写死的。现在谁用：-tt 只给不带子命令的 beeline，-n 用于其余所有命令包括 beeline check。底部补充 nohup 起的进程会忽略 SIGHUP","\u002Fimages\u002Fblog\u002Fssh-sighup\u002Ftt-vs-n.svg",[],{"type":23,"tag":50,"props":6474,"children":6476},{"id":6475},"怎么验证的",[6477],{"type":28,"value":6475},{"type":23,"tag":24,"props":6479,"children":6480},{},[6481,6483,6489,6491,6497,6499,6505],{"type":28,"value":6482},"改完做了三项检查。",{"type":23,"tag":99,"props":6484,"children":6486},{"className":6485},[],[6487],{"type":28,"value":6488},"bash -n",{"type":28,"value":6490}," 语法检查通过。经包装脚本跑 ",{"type":23,"tag":99,"props":6492,"children":6494},{"className":6493},[],[6495],{"type":28,"value":6496},"cluster restart spk",{"type":28,"value":6498},"，包装脚本退出 15 秒后，Spark HistoryServer 的进程和端口都还在。",{"type":23,"tag":99,"props":6500,"children":6502},{"className":6501},[],[6503],{"type":28,"value":6504},"cluster status zk",{"type":28,"value":6506}," 的原始输出字节里，ANSI 转义序列都还在。",{"type":23,"tag":50,"props":6508,"children":6510},{"id":6509},"还没解释透的地方",[6511],{"type":28,"value":6509},{"type":23,"tag":24,"props":6513,"children":6514},{},[6515],{"type":28,"value":6516},"这个解释到现在也没完全坐实，有几处对不上。",{"type":23,"tag":24,"props":6518,"children":6519},{},[6520,6522,6527,6529,6534],{"type":28,"value":6521},"上面的验证只说明改成 ",{"type":23,"tag":99,"props":6523,"children":6525},{"className":6524},[],[6526],{"type":28,"value":6419},{"type":28,"value":6528}," 以后，服务在包装脚本退出后还活着。反过来用 ",{"type":23,"tag":99,"props":6530,"children":6532},{"className":6531},[],[6533],{"type":28,"value":5975},{"type":28,"value":6535}," 起一遍、看着进程被带走的对照实验，记录里没有。因果是从\"死的都是本机进程\"这个规律推出来的，没有复现过。",{"type":23,"tag":24,"props":6537,"children":6538},{},[6539,6541,6547,6548,6554,6556,6562],{"type":28,"value":6540},"再就是 nohup。Spark 的 ",{"type":23,"tag":99,"props":6542,"children":6544},{"className":6543},[],[6545],{"type":28,"value":6546},"start-history-server.sh",{"type":28,"value":1148},{"type":23,"tag":99,"props":6549,"children":6551},{"className":6550},[],[6552],{"type":28,"value":6553},"start-thriftserver.sh",{"type":28,"value":6555}," 都是转调 ",{"type":23,"tag":99,"props":6557,"children":6559},{"className":6558},[],[6560],{"type":28,"value":6561},"spark-daemon.sh",{"type":28,"value":6563},"，它是这样起进程的：",{"type":23,"tag":2152,"props":6565,"children":6567},{"className":5795,"code":6566,"language":5797,"meta":8,"style":8},"nohup -- \"$@\" >> $log 2>&1 \u003C \u002Fdev\u002Fnull &\n",[6568],{"type":23,"tag":99,"props":6569,"children":6570},{"__ignoreMap":8},[6571],{"type":23,"tag":2161,"props":6572,"children":6573},{"class":2163,"line":2164},[6574,6579,6584,6588,6592,6596,6601,6606,6611,6616,6621],{"type":23,"tag":2161,"props":6575,"children":6576},{"style":5824},[6577],{"type":28,"value":6578},"nohup",{"type":23,"tag":2161,"props":6580,"children":6581},{"style":5844},[6582],{"type":28,"value":6583}," --",{"type":23,"tag":2161,"props":6585,"children":6586},{"style":5855},[6587],{"type":28,"value":6126},{"type":23,"tag":2161,"props":6589,"children":6590},{"style":5844},[6591],{"type":28,"value":5940},{"type":23,"tag":2161,"props":6593,"children":6594},{"style":5855},[6595],{"type":28,"value":6136},{"type":23,"tag":2161,"props":6597,"children":6598},{"style":5948},[6599],{"type":28,"value":6600}," >>",{"type":23,"tag":2161,"props":6602,"children":6603},{"style":5830},[6604],{"type":28,"value":6605}," $log ",{"type":23,"tag":2161,"props":6607,"children":6608},{"style":5948},[6609],{"type":28,"value":6610},"2>&1",{"type":23,"tag":2161,"props":6612,"children":6613},{"style":5948},[6614],{"type":28,"value":6615}," \u003C",{"type":23,"tag":2161,"props":6617,"children":6618},{"style":5855},[6619],{"type":28,"value":6620}," \u002Fdev\u002Fnull",{"type":23,"tag":2161,"props":6622,"children":6623},{"style":5830},[6624],{"type":28,"value":6625}," &\n",{"type":23,"tag":24,"props":6627,"children":6628},{},[6629,6631,6636,6638,6643],{"type":28,"value":6630},"nohup 的作用就是让进程忽略 SIGHUP。这样一来，拿来验证的 Spark HistoryServer 本身就带着 nohup，就算还用 ",{"type":23,"tag":99,"props":6632,"children":6634},{"className":6633},[],[6635],{"type":28,"value":5975},{"type":28,"value":6637},"，它多半也能活下来，所以那次验证证明不了 ",{"type":23,"tag":99,"props":6639,"children":6641},{"className":6640},[],[6642],{"type":28,"value":5975},{"type":28,"value":6644}," 就是元凶。",{"type":23,"tag":24,"props":6646,"children":6647},{},[6648,6650,6656],{"type":28,"value":6649},"而且仓库里留的那份集群脚本里，Spark Thrift Server 是从主节点再 ssh 回它自己去起的，本来就不在那个 PTY 会话里（主节点上实际跑的版本要是和仓库里一样的话）。照这么看，SIGHUP 解释不了 Spark Thrift Server 为什么没了。它是以 YARN client 模式跑的，一种可能是 ResourceManager 先倒了，它跟着退出，但这也只是推测。HMaster 是集群脚本在主节点上调 ",{"type":23,"tag":99,"props":6651,"children":6653},{"className":6652},[],[6654],{"type":28,"value":6655},"start-hbase.sh",{"type":28,"value":6657}," 起的，符合本机进程这个特征，可它退出的直接原因同样没看到。",{"type":23,"tag":24,"props":6659,"children":6660},{},[6661],{"type":23,"tag":65,"props":6662,"children":6665},{"alt":6663,"src":6664},"ssh -tt 这个解释的证据。撑得住的四条：死掉的三个都是主节点本机拉起的、活着的都是 ssh 到别的节点起的；改成 -n 后跑 cluster restart spk，包装脚本退出 15 秒后 HistoryServer 进程和端口都在；cluster status zk 的原始输出里 ANSI 转义都在；9 月 4 号 DS Worker 用后台子 shell 并行起也被带走过。对不上或欠着的四条：没做过用 -tt 的反向对照；HistoryServer 本身由 nohup 起；仓库脚本里 Spark Thrift Server 是 ssh 回 201 起的；HMaster 退出的直接原因没看到。底部是还差的两步：翻退出前的日志，以及下次起集群时跑 ps -o pid,pgid,sid,tty,cmd -C java","\u002Fimages\u002Fblog\u002Fssh-sighup\u002Fevidence.svg",[],{"type":23,"tag":24,"props":6667,"children":6668},{},[6669,6671,6677,6679,6685],{"type":28,"value":6670},"要坐实，得把那次 ResourceManager、HMaster、Spark Thrift Server 退出前的日志翻出来，看它们到底是收到 SIGHUP 退的，还是别的原因。下次起集群，也可以先用 ",{"type":23,"tag":99,"props":6672,"children":6674},{"className":6673},[],[6675],{"type":28,"value":6676},"ps -o pid,pgid,sid,tty,cmd -C java",{"type":28,"value":6678}," 看一眼这几个 Java 进程挂在哪个会话上，TTY 那一栏要是 ",{"type":23,"tag":99,"props":6680,"children":6682},{"className":6681},[],[6683],{"type":28,"value":6684},"pts\u002FN",{"type":28,"value":6686},"，说明它还挂在某个终端上。这两步记录里都没有，算是欠着的。",{"type":23,"tag":2730,"props":6688,"children":6689},{},[6690],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":6692},[6693,6694,6695,6696,6697],{"id":5774,"depth":927,"text":5774},{"id":6009,"depth":927,"text":6012},{"id":6080,"depth":927,"text":6080},{"id":6475,"depth":927,"text":6475},{"id":6509,"depth":927,"text":6509},"content:blog:2026-09-26-ssh-tty-sighup-daemons.md","blog\u002F2026-09-26-ssh-tty-sighup-daemons.md","blog\u002F2026-09-26-ssh-tty-sighup-daemons",{"_path":6702,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":1285,"description":6703,"date":6704,"tags":6705,"body":6708,"_type":937,"_id":6946,"_source":939,"_file":6947,"_stem":6948,"_extension":942},"\u002Fblog\u002F2026-09-24-argus-cost-eats-returns","一个两天换一次仓的选股模型，今年纸面毛收益 +27.2%。扣掉佣金、印花税和滑点，再算上跌停卖不出，变成 -20.3%。换手越快，成本吃得越狠。","2026-09-24",[949,950,6706,6707],"交易成本","研究方法",{"type":20,"children":6709,"toc":6939},[6710,6729,6735,6740,6745,6753,6758,6763,6776,6781,6789,6794,6799,6805,6810,6815,6823,6828,6833,6838,6843,6848,6853,6861,6866,6871,6876,6881,6886,6891,6896,6924,6929,6934],{"type":23,"tag":24,"props":6711,"children":6712},{},[6713,6715,6720,6722,6727],{"type":28,"value":6714},"前两篇写的是回测怎么骗人：",{"type":23,"tag":41,"props":6716,"children":6717},{"href":1259},[6718],{"type":28,"value":6719},"用了下单时还不存在的数据",{"type":28,"value":6721},"，或者",{"type":23,"tag":41,"props":6723,"children":6724},{"href":1271},[6725],{"type":28,"value":6726},"同一段数据看了太多次",{"type":28,"value":6728},"。这篇说最朴素的一种：没算成本。",{"type":23,"tag":50,"props":6730,"children":6732},{"id":6731},"同一批信号四种算法",[6733],{"type":28,"value":6734},"同一批信号，四种算法",{"type":23,"tag":24,"props":6736,"children":6737},{},[6738],{"type":28,"value":6739},"系统里有个对账页，每天收盘后按每个模型的信号模拟买卖，记一本纸面账。今年数字最好看的是一个两天换一次仓的模型，对账页上累计 +30.8%。",{"type":23,"tag":24,"props":6741,"children":6742},{},[6743],{"type":28,"value":6744},"我拿它今年 1 月 5 号到 9 月 23 号的信号自己重新算了一遍。这些信号大部分是模型上线以后往回补算的，本来就不能当战绩看，这里只拿它们比较几种算法：",{"type":23,"tag":24,"props":6746,"children":6747},{},[6748],{"type":23,"tag":65,"props":6749,"children":6752},{"alt":6750,"src":6751},"横向条形图：同一批信号四种口径，看板口径（毛收益，收盘一定卖得掉）+30.8%，独立复算（同样不扣成本）+27.2%，扣佣金、印花税和每边 15bp 滑点 −6.9%，再算封跌停卖不出只能顺延 −20.3%","\u002Fimages\u002Fblog\u002Fargus-cost\u002Fcalibers.svg",[],{"type":23,"tag":24,"props":6754,"children":6755},{},[6756],{"type":28,"value":6757},"同一批信号，不扣成本是 +27.2%；扣掉佣金、印花税和滑点是 -6.9%；再算上跌停卖不出，是 -20.3%。",{"type":23,"tag":24,"props":6759,"children":6760},{},[6761],{"type":28,"value":6762},"对账页的 +30.8% 和我复算的 +27.2% 差在分仓方式，对账页按打分高低分配仓位。从 +27.2% 往下的每一步，都跟模型选没选对票无关，算的全是这笔交易真做出来值多少：",{"type":23,"tag":399,"props":6764,"children":6765},{},[6766,6771],{"type":23,"tag":403,"props":6767,"children":6768},{},[6769],{"type":28,"value":6770},"扣掉佣金、印花税和滑点，变成 -6.9%。滑点就是想按某个价成交，实际成交价比它差的那一点。",{"type":23,"tag":403,"props":6772,"children":6773},{},[6774],{"type":28,"value":6775},"再算上卖不出去的单子，变成 -20.3%。对账页默认到了该卖那天，收盘一定能卖掉。可今年有 4.7% 的单子，该卖那天收盘封在跌停，根本卖不出，只能等下一个能卖的收盘，这些单子平均又多亏 3.1 个百分点。",{"type":23,"tag":50,"props":6777,"children":6779},{"id":6778},"买卖一次要花多少",[6780],{"type":28,"value":6778},{"type":23,"tag":24,"props":6782,"children":6783},{},[6784],{"type":23,"tag":65,"props":6785,"children":6788},{"alt":6786,"src":6787},"一根横条拆成两段：佣金加印花税 6.7bp 占 18%，滑点 30bp 占 82%；买卖一次合计 36.7bp，约 0.367%；滑点按买、卖各 15bp 计，这个取值偏保守，准不准还没坐实","\u002Fimages\u002Fblog\u002Fargus-cost\u002Fround-trip.svg",[],{"type":23,"tag":24,"props":6790,"children":6791},{},[6792],{"type":28,"value":6793},"1bp 是万分之一。买进再卖出一次，合计 36.7bp，约 0.367%。其中佣金和印花税一共 6.7bp；滑点买、卖各按 15bp 算，合计 30bp，占了八成多。",{"type":23,"tag":24,"props":6795,"children":6796},{},[6797],{"type":28,"value":6798},"15bp 这个数我用分钟线估过一次：分钟线上能看出来的价差加冲击，中位每边大约 8bp。冲击指的是自己的单子把价格推开的那部分。但分钟线看不见追价的那部分，所以事先定好了规则，估出来低于 10bp 也不往下调。15bp 偏保守，准不准还没坐实。",{"type":23,"tag":50,"props":6800,"children":6802},{"id":6801},"换手越快成本越重",[6803],{"type":28,"value":6804},"换手越快，成本越重",{"type":23,"tag":24,"props":6806,"children":6807},{},[6808],{"type":28,"value":6809},"每天摊到的成本，等于一次往返的成本乘上每天换掉的仓位比例。持有 20 天的模型，每天大约换掉 5% 的仓位；持有 2 天的，每天换掉一半。",{"type":23,"tag":24,"props":6811,"children":6812},{},[6813],{"type":28,"value":6814},"9 月 21 号，我把对账页上三个模型都换算成了扣成本以后的数：",{"type":23,"tag":24,"props":6816,"children":6817},{},[6818],{"type":23,"tag":65,"props":6819,"children":6822},{"alt":6820,"src":6821},"分组柱状图：每天平均收益（%），持有 20 天日换手 5%，毛 0.109、扣成本后 0.091，净年化 +22.9%；持有 5 天日换手 20%，毛 0.099、扣后 0.025，净年化 +6.4%；持有 2 天日换手 50%，毛 0.201、扣后 0.017，净年化 +4.4%","\u002Fimages\u002Fblog\u002Fargus-cost\u002Franking-flip.svg",[],{"type":23,"tag":24,"props":6824,"children":6825},{},[6826],{"type":28,"value":6827},"不扣成本，持有 2 天的模型每天平均收益最高；扣完成本，它排到最后。",{"type":23,"tag":24,"props":6829,"children":6830},{},[6831],{"type":28,"value":6832},"只看毛收益，持有 2 天的那个最好，几乎是另外两个的两倍。扣完成本，它年化只剩 +4.4%，排最后；持有 20 天的那个扣完还有 +22.9%，排第一。",{"type":23,"tag":24,"props":6834,"children":6835},{},[6836],{"type":28,"value":6837},"不过三个模型的 t 值都不到 2，统计上一个都站不住。t 值衡量的是平均收益离 0 有多远、相对它自己的波动有多大，一般要到 2 左右才算站得住。排第一，也只是说它在已有的记录里暂时最好。",{"type":23,"tag":50,"props":6839,"children":6841},{"id":6840},"换持有期也躲不开",[6842],{"type":28,"value":6840},{"type":23,"tag":24,"props":6844,"children":6845},{},[6846],{"type":28,"value":6847},"成本这么重，拉长持有期行不行？9 月 19 号做的一次因子合成研究正好能回答。因子是从行情、财务里算出来、用来给股票排序的指标。做法是把 154 个因子的方向调正，每天在全市场排名，等权合成一个分数，每次买 15 只。用的是 2010 到 2018 年的开发集，也就是专门拿来做研究的那段历史。",{"type":23,"tag":24,"props":6849,"children":6850},{},[6851],{"type":28,"value":6852},"先说一个意外：排名最靠前的 15 只是亏钱的。它们是 154 个因子一致判断「最超卖」的票，很多正在往下掉。把起点往后挪就好了，持有 1 天从第 200 名开始取，持有 20 天从第 400 名开始取，结果都转正了。拿这两组和成本比：",{"type":23,"tag":24,"props":6854,"children":6855},{},[6856],{"type":23,"tag":65,"props":6857,"children":6860},{"alt":6858,"src":6859},"分组柱状图：持有 1 天每笔平均超额 0.044%，一次往返成本 0.367%，差 8.4 倍，超额 t = 3.00 显著；持有 20 天每笔平均超额 0.192%，成本 0.367%，差 1.9 倍，超额 t = 0.71 和 0 分不开","\u002Fimages\u002Fblog\u002Fargus-cost\u002Fedge-vs-cost.svg",[],{"type":23,"tag":24,"props":6862,"children":6863},{},[6864],{"type":28,"value":6865},"持有 1 天，每笔平均超额 0.044%，离一次往返成本差 8.4 倍；持有 20 天，每笔平均超额 0.192%，差 1.9 倍，但统计上和 0 分不开。",{"type":23,"tag":24,"props":6867,"children":6868},{},[6869],{"type":28,"value":6870},"超额是相对基准多赚的那部分。把收益写成「每一笔」，就能和每一笔的成本直接比。持有 1 天那组，每笔平均超额 0.044%，t 值 3.00，统计上站得住，可离 0.367% 的成本差 8.4 倍。持有 20 天那组，每笔 0.192%，只差 1.9 倍，可 t 值只有 0.71，和 0 分不开。",{"type":23,"tag":24,"props":6872,"children":6873},{},[6874],{"type":28,"value":6875},"短的站得住，付不起成本；长的付得起，又站不住。换持有期解决不了，因为每笔超额和每笔成本之比，本身跟持有多久没关系。",{"type":23,"tag":24,"props":6877,"children":6878},{},[6879],{"type":28,"value":6880},"差距最小的那组，成本里八成多是滑点。滑点要是只有每边 5bp，往返就是 16.7bp，那一组扣完成本刚好转正，年化 +0.32%。所以眼下最该回答的是 15bp 到底准不准，多找几个因子解决不了这件事。",{"type":23,"tag":50,"props":6882,"children":6884},{"id":6883},"训练的时候就得扣",[6885],{"type":28,"value":6883},{"type":23,"tag":24,"props":6887,"children":6888},{},[6889],{"type":28,"value":6890},"回头查训练代码，还有一个更隐蔽的问题。好几个训练目标名字里带着 net，扣的却是一个常数。模型学的是名次，每只票都减同一个数，名次一点不变，学到的东西和不扣成本完全一样。按阈值定义的目标也是这样：净收益阈值等于毛收益阈值减成本，代进去一约，还是「毛收益超过多少」。",{"type":23,"tag":24,"props":6892,"children":6893},{},[6894],{"type":28,"value":6895},"能改变模型学什么的，是随票、随时间变的那部分成本：",{"type":23,"tag":399,"props":6897,"children":6898},{},[6899,6904,6909,6914,6919],{"type":23,"tag":403,"props":6900,"children":6901},{},[6902],{"type":28,"value":6903},"买不进：停牌、开盘涨停；",{"type":23,"tag":403,"props":6905,"children":6906},{},[6907],{"type":28,"value":6908},"卖不出：停牌、封跌停；",{"type":23,"tag":403,"props":6910,"children":6911},{},[6912],{"type":28,"value":6913},"印花税会变，2023 年 8 月 28 日起减半；",{"type":23,"tag":403,"props":6915,"children":6916},{},[6917],{"type":28,"value":6918},"滑点随股价和流动性变；",{"type":23,"tag":403,"props":6920,"children":6921},{},[6922],{"type":28,"value":6923},"持有期不同，换手次数也不同。",{"type":23,"tag":24,"props":6925,"children":6926},{},[6927],{"type":28,"value":6928},"所以 9 月 24 号我定了一条规矩：收益一律按「可成交的净收益」算，从训练标签开始。回测、选模型、对账页的主曲线和主数字都换成净的，毛的只能并排放，还必须标明是毛的。训练侧和对账页的改动另外排期做。",{"type":23,"tag":24,"props":6930,"children":6931},{},[6932],{"type":28,"value":6933},"现在看到一条曲线累计 +30%，我先问的是：它多久换一次仓。",{"type":23,"tag":24,"props":6935,"children":6936},{},[6937],{"type":28,"value":6938},"这篇整理自 argus-quant 9 月 19 日到 24 日的几次研究记录。文中数字来自回测和纸面模拟，不涉及真实资金，只讨论研究方法，不构成任何投资建议。",{"title":8,"searchDepth":924,"depth":924,"links":6940},[6941,6942,6943,6944,6945],{"id":6731,"depth":927,"text":6734},{"id":6778,"depth":927,"text":6778},{"id":6801,"depth":927,"text":6804},{"id":6840,"depth":927,"text":6840},{"id":6883,"depth":927,"text":6883},"content:blog:2026-09-24-argus-cost-eats-returns.md","blog\u002F2026-09-24-argus-cost-eats-returns.md","blog\u002F2026-09-24-argus-cost-eats-returns",{"_path":6950,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":6951,"description":6952,"date":6704,"tags":6953,"body":6955,"_type":937,"_id":7441,"_source":939,"_file":7442,"_stem":7443,"_extension":942},"\u002Fblog\u002F2026-09-24-datanode-on-system-disk","两台 DataNode 一直在往系统盘写","一份 hdfs-site.xml 模板配了四台磁盘不一样的机器，202 和 205 的数据目录落进了 60G 系统盘。两台成因不同：205 掉了一块盘没人知道，202 是模板多带了一个卷。",[4660,6954,4661,5719],"HDFS",{"type":20,"children":6956,"toc":7432},[6957,6977,6982,6988,6998,7006,7019,7150,7158,7170,7175,7180,7185,7191,7203,7211,7231,7239,7244,7257,7263,7289,7301,7307,7325,7330,7338,7351,7359,7364,7369,7389,7394,7399,7404],{"type":23,"tag":24,"props":6958,"children":6959},{},[6960,6962,6967,6969,6975],{"type":28,"value":6961},"9 月 21 号恢复 pve2 的时候（经过见",{"type":23,"tag":41,"props":6963,"children":6964},{"href":5582},[6965],{"type":28,"value":6966},"上一篇",{"type":28,"value":6968},"），我发现 202 和 205 的 ",{"type":23,"tag":99,"props":6970,"children":6972},{"className":6971},[],[6973],{"type":28,"value":6974},"\u002Fdata\u002Fhdfs\u002Fdata",{"type":28,"value":6976}," 落在 60G 的系统盘上，而 203、204 的同一个目录在单独的 400G 数据盘上。四台都是 DataNode，配置一模一样，数据却写到了不同的地方。",{"type":23,"tag":24,"props":6978,"children":6979},{},[6980],{"type":28,"value":6981},"下面是那天修复记录的整理，盘的 UUID 和 NAS 上的路径都没写出来。",{"type":23,"tag":50,"props":6983,"children":6985},{"id":6984},"同一份配置四台不一样的盘",[6986],{"type":28,"value":6987},"同一份配置，四台不一样的盘",{"type":23,"tag":24,"props":6989,"children":6990},{},[6991,6996],{"type":23,"tag":99,"props":6992,"children":6994},{"className":6993},[],[6995],{"type":28,"value":5062},{"type":28,"value":6997}," 是 hdfs-site.xml 里告诉 DataNode 把块存在哪些目录的配置项，可以写好几个目录，用逗号隔开，每个目录算一个卷（volume）。四台的这一项出自同一份模板，写的都是：",{"type":23,"tag":2152,"props":6999,"children":7001},{"code":7000},"\u002Fdata\u002Fhdfs\u002Fdata,\u002Fdata2\u002Fhdfs\u002Fdata,[ARCHIVE]...\n",[7002],{"type":23,"tag":99,"props":7003,"children":7004},{"__ignoreMap":8},[7005],{"type":28,"value":7000},{"type":23,"tag":24,"props":7007,"children":7008},{},[7009,7011,7017],{"type":28,"value":7010},"前两个是本地数据卷，第三个是指向 NAS 归档目录的 ARCHIVE 卷。这是 4 月 6 号定下来的布局：那天给四台 DataNode 各加了一块 400G 数据盘挂到 ",{"type":23,"tag":99,"props":7012,"children":7014},{"className":7013},[],[7015],{"type":28,"value":7016},"\u002Fdata2\u002Fhdfs\u002Fdata",{"type":28,"value":7018},"，数据目录从此统一成两个 DISK 加一个 ARCHIVE。问题是四台机器的磁盘并不一样：",{"type":23,"tag":533,"props":7020,"children":7021},{},[7022,7047],{"type":23,"tag":537,"props":7023,"children":7024},{},[7025],{"type":23,"tag":541,"props":7026,"children":7027},{},[7028,7032,7037],{"type":23,"tag":545,"props":7029,"children":7030},{},[7031],{"type":28,"value":4886},{"type":23,"tag":545,"props":7033,"children":7034},{},[7035],{"type":28,"value":7036},"数据盘",{"type":23,"tag":545,"props":7038,"children":7039},{},[7040,7045],{"type":23,"tag":99,"props":7041,"children":7043},{"className":7042},[],[7044],{"type":28,"value":6974},{"type":28,"value":7046}," 实际落在",{"type":23,"tag":561,"props":7048,"children":7049},{},[7050,7073,7103,7120],{"type":23,"tag":541,"props":7051,"children":7052},{},[7053,7058,7068],{"type":23,"tag":568,"props":7054,"children":7055},{},[7056],{"type":28,"value":7057},"202",{"type":23,"tag":568,"props":7059,"children":7060},{},[7061,7063],{"type":28,"value":7062},"1 块 400G：sdb → ",{"type":23,"tag":99,"props":7064,"children":7066},{"className":7065},[],[7067],{"type":28,"value":7016},{"type":23,"tag":568,"props":7069,"children":7070},{},[7071],{"type":28,"value":7072},"60G 系统盘",{"type":23,"tag":541,"props":7074,"children":7075},{},[7076,7081,7098],{"type":23,"tag":568,"props":7077,"children":7078},{},[7079],{"type":28,"value":7080},"203",{"type":23,"tag":568,"props":7082,"children":7083},{},[7084,7086,7091,7093],{"type":28,"value":7085},"2 块 400G：sdc → ",{"type":23,"tag":99,"props":7087,"children":7089},{"className":7088},[],[7090],{"type":28,"value":6974},{"type":28,"value":7092},"，sdb → ",{"type":23,"tag":99,"props":7094,"children":7096},{"className":7095},[],[7097],{"type":28,"value":7016},{"type":23,"tag":568,"props":7099,"children":7100},{},[7101],{"type":28,"value":7102},"400G 数据盘",{"type":23,"tag":541,"props":7104,"children":7105},{},[7106,7111,7116],{"type":23,"tag":568,"props":7107,"children":7108},{},[7109],{"type":28,"value":7110},"204",{"type":23,"tag":568,"props":7112,"children":7113},{},[7114],{"type":28,"value":7115},"同 203",{"type":23,"tag":568,"props":7117,"children":7118},{},[7119],{"type":28,"value":7102},{"type":23,"tag":541,"props":7121,"children":7122},{},[7123,7128,7145],{"type":23,"tag":568,"props":7124,"children":7125},{},[7126],{"type":28,"value":7127},"205",{"type":23,"tag":568,"props":7129,"children":7130},{},[7131,7133,7138,7140],{"type":28,"value":7132},"2 块 400G：sdb → ",{"type":23,"tag":99,"props":7134,"children":7136},{"className":7135},[],[7137],{"type":28,"value":6974},{"type":28,"value":7139},"，sdc → ",{"type":23,"tag":99,"props":7141,"children":7143},{"className":7142},[],[7144],{"type":28,"value":7016},{"type":23,"tag":568,"props":7146,"children":7147},{},[7148],{"type":28,"value":7149},"60G 系统盘（sdb 没挂上）",{"type":23,"tag":24,"props":7151,"children":7152},{},[7153],{"type":23,"tag":65,"props":7154,"children":7157},{"alt":7155,"src":7156},"四台 DataNode 的磁盘布局。顶部是四台共用的 dfs.datanode.data.dir 模板。202：60G 系统盘上是 \u002Fdata\u002Fhdfs\u002Fdata（标红，模板多出的卷进了系统盘），sdb 400G 挂 \u002Fdata2\u002Fhdfs\u002Fdata。203 和 204：系统盘只有根分区，sdc 400G 挂 \u002Fdata\u002Fhdfs\u002Fdata，sdb 400G 挂 \u002Fdata2\u002Fhdfs\u002Fdata。205：60G 系统盘上是 \u002Fdata\u002Fhdfs\u002Fdata（标红），sdb 400G 没挂上、从没进过 fstab，sdc 400G 挂 \u002Fdata2\u002Fhdfs\u002Fdata","\u002Fimages\u002Fblog\u002Fdatanode-disk\u002Fdisk-layout.svg",[],{"type":23,"tag":24,"props":7159,"children":7160},{},[7161,7163,7168],{"type":28,"value":7162},"连盘符都对不齐，205 的 ",{"type":23,"tag":99,"props":7164,"children":7166},{"className":7165},[],[7167],{"type":28,"value":6974},{"type":28,"value":7169}," 在 sdb 上，203、204 的在 sdc 上。",{"type":23,"tag":24,"props":7171,"children":7172},{},[7173],{"type":28,"value":7174},"DataNode 不管配置里的目录是不是一块独立的盘，目录在、能写，它就往里写。Linux 里把一块盘\"挂\"到某个目录上以后，访问这个目录就是在访问那块盘，这个目录叫挂载点。可挂载点本身只是根分区上的一个普通目录，盘没挂上的时候，往里写的东西就直接落在根分区上。模板里多出来的卷也好，没挂上的盘也好，DataNode 都不会报错，数据就这么进了系统盘。系统盘只有 60G，真要被写满，整台机器都会跟着出问题。",{"type":23,"tag":50,"props":7176,"children":7178},{"id":7177},"本来打算单开一个变更窗口",[7179],{"type":28,"value":7177},{"type":23,"tag":24,"props":7181,"children":7182},{},[7183],{"type":28,"value":7184},"刚发现的时候，我把它记成了一个已知缺陷：202 已经往系统盘写了 500M 左右，搬迁要停 DataNode、迁块、改 hdfs-site.xml，打算单开一个变更窗口来做。再往下看，两台的成因各不相同，各自都有更简单的修法，结果当天就修完了。",{"type":23,"tag":50,"props":7186,"children":7188},{"id":7187},"_205一块盘掉了没人知道",[7189],{"type":28,"value":7190},"205：一块盘掉了，没人知道",{"type":23,"tag":24,"props":7192,"children":7193},{},[7194,7196,7201],{"type":28,"value":7195},"205 有两块 400G 数据盘。其中 sdb 关机前一直是手工挂在 ",{"type":23,"tag":99,"props":7197,"children":7199},{"className":7198},[],[7200],{"type":28,"value":6974},{"type":28,"value":7202}," 上的，从来没写进 fstab。fstab 里反倒留着一行注释：",{"type":23,"tag":2152,"props":7204,"children":7206},{"code":7205},"# REMOVED: \u002Fdev\u002Fsdb not present\n",[7207],{"type":23,"tag":99,"props":7208,"children":7209},{"__ignoreMap":8},[7210],{"type":28,"value":7205},{"type":23,"tag":24,"props":7212,"children":7213},{},[7214,7216,7222,7224,7229],{"type":28,"value":7215},"这行注释是错的，盘一直都在。手工 ",{"type":23,"tag":99,"props":7217,"children":7219},{"className":7218},[],[7220],{"type":28,"value":7221},"mount",{"type":28,"value":7223}," 上去的盘，重启以后不会自己回来，开机时 systemd 只认 fstab。17:43 那次关机以后，没人再把 sdb 挂回去，DataNode 重启时看到的 ",{"type":23,"tag":99,"props":7225,"children":7227},{"className":7226},[],[7228],{"type":28,"value":6974},{"type":28,"value":7230},"，就成了根盘上挂载点下面的那个目录。里面是 4 月 6 号留下的陈旧数据，它就接着用了。4 月 6 号正好是上面说的调整数据目录布局的那天。",{"type":23,"tag":24,"props":7232,"children":7233},{},[7234],{"type":23,"tag":65,"props":7235,"children":7238},{"alt":7236,"src":7237},"挂载点只是根分区上的一个目录。左边是盘挂着的时候：根分区上的 \u002Fdata\u002Fhdfs\u002Fdata 是空的挂载点，sdb 400G 盖在上面，DataNode 写进数据盘。右边是 9 月 20 日关机以后 sdb 没再挂回去：根分区上的 \u002Fdata\u002Fhdfs\u002Fdata 里是 4 月 6 号的陈旧数据，DataNode 接着往里写、不报错，数据进了系统盘；没挂上的 sdb 里有 461M、562 个块，最后写入 9\u002F20 17:40:57。底部是检查办法：对每个本地数据目录跑 findmnt -T，落在 \u002F 上的就有问题","\u002Fimages\u002Fblog\u002Fdatanode-disk\u002Fmount-point.svg",[],{"type":23,"tag":24,"props":7240,"children":7241},{},[7242],{"type":28,"value":7243},"那块没挂上的盘里有 461M、562 个块，最近一次写入是 2026-09-20 17:40:57，离电源键被按下不到三分钟。",{"type":23,"tag":24,"props":7245,"children":7246},{},[7247,7249,7255],{"type":28,"value":7248},"修法是按 UUID 把它写进 fstab 挂回去，那行错误的注释也一起改掉。用 UUID 不用 ",{"type":23,"tag":99,"props":7250,"children":7252},{"className":7251},[],[7253],{"type":28,"value":7254},"\u002Fdev\u002Fsdb",{"type":28,"value":7256},"，是因为盘符跟着内核探测顺序走，不保证每次开机都一样。",{"type":23,"tag":50,"props":7258,"children":7260},{"id":7259},"_205-上还有一个同样的-mask",[7261],{"type":28,"value":7262},"205 上还有一个同样的 mask",{"type":23,"tag":24,"props":7264,"children":7265},{},[7266,7268,7274,7276,7280,7282,7287],{"type":28,"value":7267},"205 上也有一个 ",{"type":23,"tag":99,"props":7269,"children":7271},{"className":7270},[],[7272],{"type":28,"value":7273},"data-hdfs-data.mount",{"type":28,"value":7275}," 的 mask 残留，跟 203、204 那次一样（mask 是怎么回事，",{"type":23,"tag":41,"props":7277,"children":7278},{"href":5582},[7279],{"type":28,"value":6966},{"type":28,"value":7281},"里讲了）。新加的那行 fstab 开机时会被它拦掉，下次重启必然重演 203、204 的事：",{"type":23,"tag":99,"props":7283,"children":7285},{"className":7284},[],[7286],{"type":28,"value":5611},{"type":28,"value":7288}," 起不来，根分区只读。所以这次顺带把 205 和 202 上剩下的两个 mask 也清掉了，现在七个节点都没有被 mask 的挂载单元。",{"type":23,"tag":24,"props":7290,"children":7291},{},[7292,7294,7299],{"type":28,"value":7293},"12:38 重启 205 实测：两块数据盘在开机 3 秒内由 systemd 自动挂好，根分区 rw，",{"type":23,"tag":99,"props":7295,"children":7297},{"className":7296},[],[7298],{"type":28,"value":5611},{"type":28,"value":7300}," active，没有失败的单元，也没进 emergency。",{"type":23,"tag":50,"props":7302,"children":7304},{"id":7303},"_202这个卷本来就不该有",[7305],{"type":28,"value":7306},"202：这个卷本来就不该有",{"type":23,"tag":24,"props":7308,"children":7309},{},[7310,7312,7317,7318,7323],{"type":28,"value":7311},"202 设计上只有一块 400G 数据盘，挂在 ",{"type":23,"tag":99,"props":7313,"children":7315},{"className":7314},[],[7316],{"type":28,"value":7016},{"type":28,"value":287},{"type":23,"tag":99,"props":7319,"children":7321},{"className":7320},[],[7322],{"type":28,"value":6974},{"type":28,"value":7324}," 这个卷是模板带过来的，在 202 上从一开始就不该存在，它对应的目录就在系统盘上。",{"type":23,"tag":24,"props":7326,"children":7327},{},[7328],{"type":28,"value":7329},"修法是把它从 202 的 hdfs-site.xml 里摘掉，只留：",{"type":23,"tag":2152,"props":7331,"children":7333},{"code":7332},"\u002Fdata2\u002Fhdfs\u002Fdata,[ARCHIVE]\u003CNAS 上的归档目录>\n",[7334],{"type":23,"tag":99,"props":7335,"children":7336},{"__ignoreMap":8},[7337],{"type":28,"value":7332},{"type":23,"tag":24,"props":7339,"children":7340},{},[7341,7343,7349],{"type":28,"value":7342},"原文件备份成 ",{"type":23,"tag":99,"props":7344,"children":7346},{"className":7345},[],[7347],{"type":28,"value":7348},"hdfs-site.xml.bak-20260921",{"type":28,"value":7350},"。摘掉以后，这个卷上的副本不再上报，NameNode 统计出 862 个块欠副本。欠副本的意思是某个块现存的副本数少于设定值，NameNode 发现以后会自己安排别的 DataNode 从现有副本复制补齐。这次大约 9 分钟补完，全程 Missing 0、Corrupt 0。",{"type":23,"tag":24,"props":7352,"children":7353},{},[7354],{"type":23,"tag":65,"props":7355,"children":7358},{"alt":7356,"src":7357},"202 的修法对比。上面是原计划：停 DataNode、迁块、改 hdfs-site.xml、开变更窗口做，标为没用上。下面是 9 月 21 号当天的实际做法：从 202 配置里摘掉 \u002Fdata\u002Fhdfs\u002Fdata，这个卷上的副本不再上报，NameNode 统计出 862 个块欠副本，从别的节点复制约 9 分钟补齐，全程 Missing 0、Corrupt 0。底部说明敢直接摘的原因是副本数为 2，以及备份文件名和改完的配置","\u002Fimages\u002Fblog\u002Fdatanode-disk\u002Fdrop-volume.svg",[],{"type":23,"tag":24,"props":7360,"children":7361},{},[7362],{"type":28,"value":7363},"集群的副本数是 2，摘掉的这些副本在别的节点上都还有一份，所以只会欠副本，不会丢块。直接摘卷比停机迁块省事得多，前提就是副本数够、别的副本都健康。",{"type":23,"tag":50,"props":7365,"children":7367},{"id":7366},"修完以后",[7368],{"type":28,"value":7366},{"type":23,"tag":24,"props":7370,"children":7371},{},[7372,7374,7380,7382,7387],{"type":28,"value":7373},"现在四台 DataNode 的每个卷都在独立的数据盘上，没有谁再写系统盘。两台根盘上的旧卷没有直接删，改名成 ",{"type":23,"tag":99,"props":7375,"children":7377},{"className":7376},[],[7378],{"type":28,"value":7379},"\u002Fdata\u002Fhdfs\u002Fdata.orphan-20260921",{"type":28,"value":7381}," 先留着，202 上是 501M，205 上是 80M 的陈旧副本。修完跑了一遍 fsck（HDFS 自带的块健康检查），结果 HEALTHY，欠副本 0、缺失 0、损坏 0，",{"type":23,"tag":99,"props":7383,"children":7385},{"className":7384},[],[7386],{"type":28,"value":5627},{"type":28,"value":7388}," 10 个用例全过。",{"type":23,"tag":24,"props":7390,"children":7391},{},[7392],{"type":28,"value":7393},"文档其实也错了。集群文档里写 204、205 的两块数据盘是 300G 加 400G，实际是两块 400G，而且第一块放在宿主机的 local 存储上，不在 pve2-nvme 这个池里。这次顺手把每台的盘符和挂载点对应关系都补了进去。",{"type":23,"tag":50,"props":7395,"children":7397},{"id":7396},"以后怎么防",[7398],{"type":28,"value":7396},{"type":23,"tag":24,"props":7400,"children":7401},{},[7402],{"type":28,"value":7403},"这次的根子是一份模板配了四台磁盘不一样的机器，中间还夹着一块手工挂上、从没进过 fstab 的盘。DataNode 自己不会替你检查这些。",{"type":23,"tag":24,"props":7405,"children":7406},{},[7407,7409,7414,7416,7422,7424,7430],{"type":28,"value":7408},"其实一条命令就能看出来：对 ",{"type":23,"tag":99,"props":7410,"children":7412},{"className":7411},[],[7413],{"type":28,"value":5062},{"type":28,"value":7415}," 里每个本地目录跑一下 ",{"type":23,"tag":99,"props":7417,"children":7419},{"className":7418},[],[7420],{"type":28,"value":7421},"findmnt -T \u003C目录>",{"type":28,"value":7423},"，它会告诉你这个目录实际落在哪个挂载点上，落在 ",{"type":23,"tag":99,"props":7425,"children":7427},{"className":7426},[],[7428],{"type":28,"value":7429},"\u002F",{"type":28,"value":7431}," 上的就有问题。模板可以用，但得拿它和每台机器的实际磁盘对一遍账。",{"title":8,"searchDepth":924,"depth":924,"links":7433},[7434,7435,7436,7437,7438,7439,7440],{"id":6984,"depth":927,"text":6987},{"id":7177,"depth":927,"text":7177},{"id":7187,"depth":927,"text":7190},{"id":7259,"depth":927,"text":7262},{"id":7303,"depth":927,"text":7306},{"id":7366,"depth":927,"text":7366},{"id":7396,"depth":927,"text":7396},"content:blog:2026-09-24-datanode-on-system-disk.md","blog\u002F2026-09-24-datanode-on-system-disk.md","blog\u002F2026-09-24-datanode-on-system-disk",{"_path":7445,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":7446,"description":7447,"date":7448,"tags":7449,"body":7451,"_type":937,"_id":7666,"_source":939,"_file":7667,"_stem":7668,"_extension":942},"\u002Fblog\u002F2026-09-22-argus-backtest-budget","样本外数据要省着看：给回测加上访问预算","同一段数据看得越多，回测越会骗人。数据切成三段，样本外每个策略族最多看 20 次，留出集只能看 1 次。第一次看留出集，年化超额从 +25.6% 掉到 +3.8%。","2026-09-22",[949,950,7450,6707],"过拟合",{"type":20,"children":7452,"toc":7658},[7453,7462,7467,7472,7477,7485,7503,7508,7514,7519,7527,7532,7537,7542,7550,7573,7578,7584,7589,7594,7600,7605,7613,7618,7623,7628,7633,7638,7643,7648,7653],{"type":23,"tag":24,"props":7454,"children":7455},{},[7456,7460],{"type":23,"tag":41,"props":7457,"children":7458},{"href":1259},[7459],{"type":28,"value":6966},{"type":28,"value":7461},"写的未来函数，是用错了时间的数据。这篇说另一种骗法：数据都对，只是同一段数据看了太多次。",{"type":23,"tag":24,"props":7463,"children":7464},{},[7465],{"type":28,"value":7466},"拿同一段历史试一百个想法，总有几个碰巧好看，挑出来的那个多半是运气。样本外数据也一样。所谓样本外，就是训练模型时没用过、专门留着检验的那段数据。可每看一次结果、按结果改一次模型，这段数据就有一部分变成了训练数据。看得越多，样本外的成绩越不可信，而且这件事不会有任何报错。",{"type":23,"tag":50,"props":7468,"children":7470},{"id":7469},"数据切成三段",[7471],{"type":28,"value":7469},{"type":23,"tag":24,"props":7473,"children":7474},{},[7475],{"type":28,"value":7476},"argus-quant 把历史数据按时间切成三段，每段能看几次不一样：",{"type":23,"tag":24,"props":7478,"children":7479},{},[7480],{"type":23,"tag":65,"props":7481,"children":7484},{"alt":7482,"src":7483},"时间轴分三段：样本内 2010–2018 随便用，用来研究因子、训练、调参；样本外 2019–2022 最多看 20 次，超了就报错；留出集 2023 至今只能看 1 次，要一次性口令","\u002Fimages\u002Fblog\u002Fargus-backtest-budget\u002Fsplit.svg",[],{"type":23,"tag":399,"props":7486,"children":7487},{},[7488,7493,7498],{"type":23,"tag":403,"props":7489,"children":7490},{},[7491],{"type":28,"value":7492},"样本内（2010–2018）：研究因子、训练模型、调参数都在这一段，不限次数。",{"type":23,"tag":403,"props":7494,"children":7495},{},[7496],{"type":28,"value":7497},"样本外（2019–2022）：验证候选策略，每个策略族最多 20 次，超了直接抛异常。",{"type":23,"tag":403,"props":7499,"children":7500},{},[7501],{"type":28,"value":7502},"留出集（2023 至今）：锁起来、最后确认时才看的一段。每个策略族只有 1 次，要一次性口令，全程留审计。",{"type":23,"tag":24,"props":7504,"children":7505},{},[7506],{"type":28,"value":7507},"样本外超预算为什么抛异常、不发告警？设计文档早先的版本写的就是告警，后来改掉了，理由很直白：告警第三周就会被静音。抛异常，研究脚本就跑不下去。",{"type":23,"tag":50,"props":7509,"children":7511},{"id":7510},"预算按族记",[7512],{"type":28,"value":7513},"预算按「族」记",{"type":23,"tag":24,"props":7515,"children":7516},{},[7517],{"type":28,"value":7518},"预算要是按策略名记，换个名字就清零了。所以预算按策略族记：每次回测都记下它是从哪一次回测改出来的，一路往上追到最早那一次，那一次的编号就是这一族的编号。",{"type":23,"tag":24,"props":7520,"children":7521},{},[7522],{"type":23,"tag":65,"props":7523,"children":7526},{"alt":7524,"src":7525},"四张卡片从左到右：最早那次回测、改参数、换个名字、再改特征，箭头都指向「改自哪一次」，最早那次的编号就是族编号；下方 20 个格子代表这一族看样本外的次数，每看一次加 1，第 21 次抛异常；想开全新的族要走和留出集一样的口令流程","\u002Fimages\u002Fblog\u002Fargus-backtest-budget\u002Ffamily.svg",[],{"type":23,"tag":24,"props":7528,"children":7529},{},[7530],{"type":28,"value":7531},"族编号由程序推出来，写进去就不能改，人也不能手工指定。想开一个全新的族，要走和看留出集一样的口令流程。",{"type":23,"tag":24,"props":7533,"children":7534},{},[7535],{"type":28,"value":7536},"每看一次样本外，试验次数加一，不管结果好坏。最后判一个策略行不行，看的是 Deflated Sharpe Ratio（DSR）。先说夏普比率：收益除以波动，表示每承担一份波动能换来多少收益；超额夏普是拿相对基准多出来的那部分收益来算。DSR 可以理解成：把试过的次数和收益分布的形状都算进去以后，这个策略在样本外的超额夏普真的大于 0 的概率。门槛是 0.95，试的次数越多，越难过。筛因子也算试验，从 20 个候选里留下 5 个，试验次数按 20 记。",{"type":23,"tag":50,"props":7538,"children":7540},{"id":7539},"看一次留出集要走四步",[7541],{"type":28,"value":7539},{"type":23,"tag":24,"props":7543,"children":7544},{},[7545],{"type":23,"tag":65,"props":7546,"children":7549},{"alt":7547,"src":7548},"四个编号步骤：1 我签发一次性授权，库里只存口令的哈希，72 小时内有效；2 研究脚本拿口令来预约，口令只走环境变量，不进命令行，不落日志；3 平台原子消费并写审计，每个策略族一辈子只有 1 次，第二次直接报错；4 拿到预约号守卫才放行，预约失败 2023 年以后的数据一行都不读","\u002Fimages\u002Fblog\u002Fargus-backtest-budget\u002Fceremony.svg",[],{"type":23,"tag":890,"props":7551,"children":7552},{},[7553,7558,7563,7568],{"type":23,"tag":403,"props":7554,"children":7555},{},[7556],{"type":28,"value":7557},"我签发一次性授权，具体就是我自己往生产库里插一行授权记录。库里只存口令的哈希，72 小时过期。",{"type":23,"tag":403,"props":7559,"children":7560},{},[7561],{"type":28,"value":7562},"研究脚本拿口令去预约。口令只通过环境变量传进去，不进命令行参数，也不写进日志。",{"type":23,"tag":403,"props":7564,"children":7565},{},[7566],{"type":28,"value":7567},"平台把「用掉这次授权」和「写一条审计记录」放在同一个事务里做，要么都成功，要么都不算。每个策略族一辈子只有 1 次，第二次直接报错。",{"type":23,"tag":403,"props":7569,"children":7570},{},[7571],{"type":28,"value":7572},"拿到预约号，守卫才放行。预约失败，2023 年以后的数据一行都不读。",{"type":23,"tag":24,"props":7574,"children":7575},{},[7576],{"type":28,"value":7577},"网页上的模型实验室也没有选 2023 年以后日期的选项，留出集只能走这一条路。",{"type":23,"tag":50,"props":7579,"children":7581},{"id":7580},"先写好怎么判再去看",[7582],{"type":28,"value":7583},"先写好怎么判，再去看",{"type":23,"tag":24,"props":7585,"children":7586},{},[7587],{"type":28,"value":7588},"看之前，我先把判读规则写进了决策记录：2023 到 2026 年的分年超额取中位数，如果小于 0，或者和「每次随机挑同样多只票」相比，逐月的 t 值小于 0，就算这个排序在留出集上失效，由我决定要不要停掉这条线；否则维持原来的判断，读数只用来看衰减了多少。这里的 t 值衡量的是：逐月的差值平均下来离 0 有多远，相对它自己的波动有多大。",{"type":23,"tag":24,"props":7590,"children":7591},{},[7592],{"type":28,"value":7593},"先写后跑，是为了防止看完数字再去找理由。",{"type":23,"tag":50,"props":7595,"children":7597},{"id":7596},"_9-月-22-号唯一的一次",[7598],{"type":28,"value":7599},"9 月 22 号，唯一的一次",{"type":23,"tag":24,"props":7601,"children":7602},{},[7603],{"type":28,"value":7604},"这次花掉预算的，是一个按 20 天持有期训练的排序模型：收盘后给全市场打分，第二天开盘买排名最前的 5 只，拿 20 个交易日，分批滚动建仓。基准是同一天全部可交易股票等权买入。到这时为止，它是唯一在开发集、样本外和随机对照三关都过了的模型。",{"type":23,"tag":24,"props":7606,"children":7607},{},[7608],{"type":23,"tag":65,"props":7609,"children":7612},{"alt":7610,"src":7611},"柱状图：同一个组合每年相对基准的超额收益，样本外 2019 到 2022 年分别是 +40、+41、+10、+7，年化 +25.6%；留出集 2023 到 2026 年分别是 −1.5、+23.2、−12.4、+6.7，年化 +3.8%，2026 年只算到 8 月","\u002Fimages\u002Fblog\u002Fargus-backtest-budget\u002Fyearly.svg",[],{"type":23,"tag":24,"props":7614,"children":7615},{},[7616],{"type":28,"value":7617},"上图是同一个组合每年的超额收益。2019 到 2022 年是样本外，年化 +25.6%；2023 年到 2026 年 8 月是留出集，年化 +3.8%。2026 年只算到 8 月底。",{"type":23,"tag":24,"props":7619,"children":7620},{},[7621],{"type":28,"value":7622},"样本外四年分别是 +40%、+41%、+10%、+7%。到了留出集，变成 -1.5%、+23.2%、-12.4%、+6.7%，年化 +3.8%，不到样本外的六分之一。",{"type":23,"tag":24,"props":7624,"children":7625},{},[7626],{"type":28,"value":7627},"排序能力还在，只是弱了。衡量「打分高的票后来是不是涨得多」的指标叫 RankIC，就是每天的打分名次和之后实际收益名次的相关系数。它在开发集是 0.153，样本外 0.137，留出集 0.106。",{"type":23,"tag":24,"props":7629,"children":7630},{},[7631],{"type":28,"value":7632},"事先写好的规则没有触发：分年超额的中位数是 +2.61%，和随机挑票相比的 t 值是 0.57，都大于 0，所以维持原来的判断。",{"type":23,"tag":24,"props":7634,"children":7635},{},[7636],{"type":28,"value":7637},"可当初给这条线定的成功标准有三条：超额为正的月份占七成以上，超额回撤不超过 20%，年化超额不低于 15%。留出集上四种建仓方式各对三条标准，12 格一格都没过。原先预期每月大约 2% 的超额，在留出集上只剩 0.3% 左右。",{"type":23,"tag":50,"props":7639,"children":7641},{"id":7640},"看完以后",[7642],{"type":28,"value":7640},{"type":23,"tag":24,"props":7644,"children":7645},{},[7646],{"type":28,"value":7647},"这一族的留出集从此不再是盲的。以后这一族的任何变体，想知道 2023 年以后灵不灵，只能靠向前的纸面跟踪一天天攒。",{"type":23,"tag":24,"props":7649,"children":7650},{},[7651],{"type":28,"value":7652},"样本外那 +25.6% 是 2019 到 2022 年行情里的数。没有这次留出集，我会一直拿它当以后的预期。",{"type":23,"tag":24,"props":7654,"children":7655},{},[7656],{"type":28,"value":7657},"这篇整理自 argus-quant 的设计文档和 9 月 22 日那次留出集读数。文中数字都来自回测，只讨论研究方法，不构成任何投资建议。",{"title":8,"searchDepth":924,"depth":924,"links":7659},[7660,7661,7662,7663,7664,7665],{"id":7469,"depth":927,"text":7469},{"id":7510,"depth":927,"text":7513},{"id":7539,"depth":927,"text":7539},{"id":7580,"depth":927,"text":7583},{"id":7596,"depth":927,"text":7599},{"id":7640,"depth":927,"text":7640},"content:blog:2026-09-22-argus-backtest-budget.md","blog\u002F2026-09-22-argus-backtest-budget.md","blog\u002F2026-09-22-argus-backtest-budget",{"_path":7670,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":7671,"description":7672,"date":7448,"tags":7673,"body":7675,"_type":937,"_id":8047,"_source":939,"_file":8048,"_stem":8049,"_extension":942},"\u002Fblog\u002F2026-09-22-pve2-power-key-boot-path","pve2 被按了一下电源键，重启后三台节点起不来","pve2 的电源键被短按了一下，宿主机正常关了机。重新上电后 203、204 根分区只读，206 卡在应急模式，205 干脆没起来。前三台的毛病都出在 fstab 和 systemd 挂载单元上。",[4658,7674,4661,5719],"systemd",{"type":20,"children":7676,"toc":8040},[7677,7682,7687,7695,7700,7713,7721,7726,7739,7744,7750,7770,7778,7783,7825,7833,7860,7887,7892,7912,7917,7923,7928,7940,7945,7951,7972,7977,7985,7990,8013,8035],{"type":23,"tag":24,"props":7678,"children":7679},{},[7680],{"type":28,"value":7681},"9 月 20 号傍晚，pve2 这台宿主机自己关机了。我那套大数据集群的 7 台 VM（201–207）全跑在它上面，它一停，HDFS、YARN、Hive、Kafka、HBase 一起停。当天 23:51 重新上电，7 台里有 3 台起来就是残的。第二天凌晨两点多我开始恢复，到早上九点集群才算回来。",{"type":23,"tag":24,"props":7683,"children":7684},{},[7685],{"type":28,"value":7686},"下面按当时的恢复记录来写，IP 和主机名都换成了 VM 编号。",{"type":23,"tag":24,"props":7688,"children":7689},{},[7690],{"type":23,"tag":65,"props":7691,"children":7694},{"alt":7692,"src":7693},"pve2 关机到恢复的时间线：9 月 20 日 17:43:29 systemd-logind 记下电源键短按，pve-guests 依次关掉 201 到 207，17:45:16 断电，23:51:51 重新上电，停机 6 小时 06 分，203、204、206 起来就是残的，205 没起；9 月 21 日凌晨两点多开始恢复，早上九点集群回来，之后 206、203、204 逐台修完重启验证。下方列出排除 UPS、整片断电、误报、崩溃四种可能的依据","\u002Fimages\u002Fblog\u002Fpve2-boot\u002Fshutdown-timeline.svg",[],{"type":23,"tag":50,"props":7696,"children":7698},{"id":7697},"先弄清楚它是怎么关的机",[7699],{"type":28,"value":7697},{"type":23,"tag":24,"props":7701,"children":7702},{},[7703,7705,7711],{"type":28,"value":7704},"机器自己关机，先得排除崩溃和断电。我翻了 pve2 的 journal，也就是 systemd 记的系统日志，17:43:29 有一条 ",{"type":23,"tag":99,"props":7706,"children":7708},{"className":7707},[],[7709],{"type":28,"value":7710},"systemd-logind",{"type":28,"value":7712}," 的记录。systemd-logind 是管登录会话的服务，电源键、合盖这类事件也归它处理：",{"type":23,"tag":2152,"props":7714,"children":7716},{"code":7715},"Power key pressed short.\n",[7717],{"type":23,"tag":99,"props":7718,"children":7719},{"__ignoreMap":8},[7720],{"type":28,"value":7715},{"type":23,"tag":24,"props":7722,"children":7723},{},[7724],{"type":28,"value":7725},"后面跟着的是一次正常的关机流程：pve-guests 按顺序给 201 到 207 发 qmshutdown，虚拟机都关完以后，17:45:16 断电。23:51:51 重新上电，中间停了 6 小时 06 分。",{"type":23,"tag":24,"props":7727,"children":7728},{},[7729,7731,7737],{"type":28,"value":7730},"光凭一条日志还不够，我又对了几样东西。整个 journal 保留期里，这条 Power key 的记录只出现过这一次。机器上没有 UPS：没装 NUT，也没装 apcupsd，",{"type":23,"tag":99,"props":7732,"children":7734},{"className":7733},[],[7735],{"type":28,"value":7736},"lsusb",{"type":28,"value":7738}," 里也看不到 UPS 设备，UPS 低电量触发关机这条路可以排除。同一时间 pve1 和 pve3 都好好的，pve1 从 3 月 31 号开机就没断过，pve3 是 8 月 14 号开的机。崩溃、断电、过热都对不上，剩下的解释就是物理电源键被短按了一下，systemd-logind 收到以后走了正常关机。",{"type":23,"tag":24,"props":7740,"children":7741},{},[7742],{"type":28,"value":7743},"关机这一步没出事，虚拟机都是正常关掉的。麻烦是开机时冒出来的。",{"type":23,"tag":50,"props":7745,"children":7747},{"id":7746},"_203-和-204根分区一直是只读的",[7748],{"type":28,"value":7749},"203 和 204：根分区一直是只读的",{"type":23,"tag":24,"props":7751,"children":7752},{},[7753,7755,7761,7762,7768],{"type":28,"value":7754},"这两台起来以后，",{"type":23,"tag":99,"props":7756,"children":7758},{"className":7757},[],[7759],{"type":28,"value":7760},"start-dfs.sh",{"type":28,"value":1148},{"type":23,"tag":99,"props":7763,"children":7765},{"className":7764},[],[7766],{"type":28,"value":7767},"start-yarn.sh",{"type":28,"value":7769}," 一跑就退出：",{"type":23,"tag":2152,"props":7771,"children":7773},{"code":7772},"ERROR: Unable to write in \u002Ftmp. Aborting.\n",[7774],{"type":23,"tag":99,"props":7775,"children":7776},{"__ignoreMap":8},[7777],{"type":28,"value":7772},{"type":23,"tag":24,"props":7779,"children":7780},{},[7781],{"type":28,"value":7782},"\u002Ftmp 写不进去，是因为根分区一直停在只读。两台上的 DataNode、NodeManager、JournalNode、ZooKeeper、Kafka、RegionServer 全都没起来。HDFS 缺了 252 个块，一直卡在安全模式出不来。安全模式下 HDFS 只能读不能改，NameNode 要等 DataNode 上报的块够数了才会自己退出，缺的块不回来，它就一直等着。HiveServer2 也起不来。",{"type":23,"tag":24,"props":7784,"children":7785},{},[7786,7788,7794,7796,7802,7804,7809,7811,7816,7818,7824],{"type":28,"value":7787},"根分区为什么是只读，得从 fstab 往下查。fstab（",{"type":23,"tag":99,"props":7789,"children":7791},{"className":7790},[],[7792],{"type":28,"value":7793},"\u002Fetc\u002Ffstab",{"type":28,"value":7795},"）是一张清单，写着开机时要把哪块盘挂到哪个目录。用 systemd 的系统，开机时会把 fstab 的每一行翻译成一个挂载单元，就是一个以 ",{"type":23,"tag":99,"props":7797,"children":7799},{"className":7798},[],[7800],{"type":28,"value":7801},".mount",{"type":28,"value":7803}," 结尾的 systemd 单元，再由 systemd 按依赖顺序去挂。203、204 的 fstab 里，",{"type":23,"tag":99,"props":7805,"children":7807},{"className":7806},[],[7808],{"type":28,"value":6974},{"type":28,"value":7810}," 那一行还在，systemd 据此生成了一个 ",{"type":23,"tag":99,"props":7812,"children":7814},{"className":7813},[],[7815],{"type":28,"value":7273},{"type":28,"value":7817},"。可这个单元从 2026-04-27 起就被 mask 成了 ",{"type":23,"tag":99,"props":7819,"children":7821},{"className":7820},[],[7822],{"type":28,"value":7823},"\u002Fdev\u002Fnull",{"type":28,"value":287},{"type":23,"tag":24,"props":7826,"children":7827},{},[7828],{"type":23,"tag":65,"props":7829,"children":7832},{"alt":7830,"src":7831},"203 和 204 的开机链路：fstab 里的 \u002Fdata\u002Fhdfs\u002Fdata 一行生成 data-hdfs-data.mount，但同名单元从 2026-04-27 起被 mask 成 \u002Fdev\u002Fnull，挂载单元起不来，local-fs.target 失败，systemd-remount-fs 没执行，根分区停在只读，start-dfs.sh 和 start-yarn.sh 报 \u002Ftmp 不可写，Hadoop 各组件全没起，HDFS 缺 252 个块卡在安全模式。右侧说明 mask 的做法、查看命令和修法","\u002Fimages\u002Fblog\u002Fpve2-boot\u002Fboot-chain-mask.svg",[],{"type":23,"tag":24,"props":7834,"children":7835},{},[7836,7838,7844,7846,7851,7853,7859],{"type":28,"value":7837},"mask 是 systemd 里最彻底的一种禁用。做法是在 ",{"type":23,"tag":99,"props":7839,"children":7841},{"className":7840},[],[7842],{"type":28,"value":7843},"\u002Fetc\u002Fsystemd\u002Fsystem",{"type":28,"value":7845}," 下放一个同名的软链，指向 ",{"type":23,"tag":99,"props":7847,"children":7849},{"className":7848},[],[7850],{"type":28,"value":7823},{"type":28,"value":7852},"。它的优先级比 fstab 生成出来的单元高，单元被它盖住以后就再也启动不了。想看一台机器上有哪些单元被 mask 了，可以用 ",{"type":23,"tag":99,"props":7854,"children":7856},{"className":7855},[],[7857],{"type":28,"value":7858},"systemctl list-unit-files --state=masked",{"type":28,"value":287},{"type":23,"tag":24,"props":7861,"children":7862},{},[7863,7865,7870,7872,7877,7879,7885],{"type":28,"value":7864},"fstab 要挂这块盘，对应的单元又被禁掉了，",{"type":23,"tag":99,"props":7866,"children":7868},{"className":7867},[],[7869],{"type":28,"value":5611},{"type":28,"value":7871}," 就起不来。",{"type":23,"tag":99,"props":7873,"children":7875},{"className":7874},[],[7876],{"type":28,"value":5611},{"type":28,"value":7878}," 是 systemd 里\"本地文件系统都挂好了\"这个节点，后面一大串东西都要等它。按当时的记录，",{"type":23,"tag":99,"props":7880,"children":7882},{"className":7881},[],[7883],{"type":28,"value":7884},"systemd-remount-fs",{"type":28,"value":7886}," 也一直没执行。这个服务负责按 fstab 把根分区重新挂一遍，平时就是靠它把根分区从只读改成可写。它没跑，根分区就停在只读，后面的服务全起不来。",{"type":23,"tag":24,"props":7888,"children":7889},{},[7890],{"type":28,"value":7891},"说起来，那行 fstab 本身没毛病，UUID 是对的，盘也好好的，挡路的只有这个 mask。至于 4 月 27 号为什么要把它 mask 掉，提交记录和集群文档里都没写，现在已经说不清了。这种问题平时不重启根本看不出来。",{"type":23,"tag":24,"props":7893,"children":7894},{},[7895,7897,7903,7905,7910],{"type":28,"value":7896},"处理很简单：删掉 203、204 上的 mask 软链，效果和 ",{"type":23,"tag":99,"props":7898,"children":7900},{"className":7899},[],[7901],{"type":28,"value":7902},"systemctl unmask",{"type":28,"value":7904}," 一样，fstab 原样保留。然后逐台重启验证，203 在 11:38，204 在 11:40。重启后根分区是 rw，两块数据盘在开机 3 秒内由 systemd 自动挂好，",{"type":23,"tag":99,"props":7906,"children":7908},{"className":7907},[],[7909],{"type":28,"value":5611},{"type":28,"value":7911}," 是 active，没有失败的单元，也没有进过 emergency 的痕迹。",{"type":23,"tag":24,"props":7913,"children":7914},{},[7915],{"type":28,"value":7916},"重启得一台一台来。这套 HDFS 的副本数是 2，每个块只存两份，两台 DataNode 同时下线，就可能有块暂时一个可用副本都不剩。所以每台重启完，先确认 HDFS 回到 4 个 DataNode、0 个缺失块，再动下一台。",{"type":23,"tag":50,"props":7918,"children":7920},{"id":7919},"_206能-ping-通就是-ssh-连不上",[7921],{"type":28,"value":7922},"206：能 ping 通，就是 ssh 连不上",{"type":23,"tag":24,"props":7924,"children":7925},{},[7926],{"type":28,"value":7927},"206 是纯计算节点，只跑 NodeManager，没有数据盘。它的样子是 ping 得通，ssh 却连不上，第一眼很像网络出了问题。",{"type":23,"tag":24,"props":7929,"children":7930},{},[7931,7933,7938],{"type":28,"value":7932},"实际上它卡在了 emergency mode。这是 systemd 开机出错时进的应急模式，只给一个 root shell 等人来修，sshd 这类普通服务都不会起。206 的 fstab 里有一条 ",{"type":23,"tag":99,"props":7934,"children":7936},{"className":7935},[],[7937],{"type":28,"value":7016},{"type":28,"value":7939},"，指向的 UUID 是 204 上的那块 sdb，206 上根本没有这块盘。systemd 等这个设备等了 90 秒，超时以后进了应急 shell，停在那里等 root 密码。这时候机器能 ping 通，sshd 却没起来。",{"type":23,"tag":24,"props":7941,"children":7942},{},[7943],{"type":28,"value":7944},"这种故障最容易判断错。ping 通、ssh 不通，第一反应是去查网络和防火墙，其实打开 PVE 的控制台看一眼，就知道它停在哪了。处理是把这一行注释掉，10:08 重启实测通过。",{"type":23,"tag":50,"props":7946,"children":7948},{"id":7947},"_205压根没起来",[7949],{"type":28,"value":7950},"205：压根没起来",{"type":23,"tag":24,"props":7952,"children":7953},{},[7954,7956,7962,7964,7970],{"type":28,"value":7955},"205 的问题更直接。",{"type":23,"tag":99,"props":7957,"children":7959},{"className":7958},[],[7960],{"type":28,"value":7961},"onboot",{"type":28,"value":7963}," 是 PVE 里控制虚拟机跟着宿主机一起开机的开关，205 的这个值是 0，宿主机重启后它不会自己起来。205 上跑着 Atlas、Solr、一个 Kafka broker 和一个 DataNode，它不起来，Atlas 和 Solr 就都没了，Kafka 少一个 broker，HDFS 也少一个 DataNode。改回 ",{"type":23,"tag":99,"props":7965,"children":7967},{"className":7966},[],[7968],{"type":28,"value":7969},"onboot=1",{"type":28,"value":7971}," 以后，pve2 上 8 台 VM 现在都是 1。",{"type":23,"tag":24,"props":7973,"children":7974},{},[7975],{"type":28,"value":7976},"三台放在一起看是这样：",{"type":23,"tag":24,"props":7978,"children":7979},{},[7980],{"type":23,"tag":65,"props":7981,"children":7984},{"alt":7982,"src":7983},"三台出问题的节点对比。203、204：start-dfs.sh 报 \u002Ftmp 写不进，原因是挂载单元被 mask、local-fs.target 起不来，修法是删 mask 软链，11:38 和 11:40 重启验证。206：能 ping 通但 ssh 连不上，原因是 fstab 有一行指向 204 的 sdb，等 90 秒超时进了 emergency，修法是注释掉那行，10:08 重启通过。205：宿主机开机后它还关着，原因是 onboot=0，改成 onboot=1，影响是 Atlas、Solr 没了，Kafka 少一个 broker，HDFS 少一个 DataNode","\u002Fimages\u002Fblog\u002Fpve2-boot\u002Fthree-nodes.svg",[],{"type":23,"tag":50,"props":7986,"children":7988},{"id":7987},"恢复以后",[7989],{"type":28,"value":7987},{"type":23,"tag":24,"props":7991,"children":7992},{},[7993,7995,8000,8001,8006,8007,8011],{"type":28,"value":7994},"集群起来以后，",{"type":23,"tag":99,"props":7996,"children":7998},{"className":7997},[],[7999],{"type":28,"value":5619},{"type":28,"value":5621},{"type":23,"tag":99,"props":8002,"children":8004},{"className":8003},[],[8005],{"type":28,"value":5627},{"type":28,"value":7388},{"type":23,"tag":41,"props":8008,"children":8009},{"href":43},[8010],{"type":28,"value":46},{"type":28,"value":8012}," 从前端经过 nginx 到后端，再到 MySQL、Redis、DolphinScheduler、Atlas，走了一遍全链路，血缘图也能正常出来。",{"type":23,"tag":24,"props":8014,"children":8015},{},[8016,8018,8023,8025,8029,8030,8034],{"type":28,"value":8017},"恢复过程中还碰到两件事：202 和 205 的 DataNode 一直在往系统盘写；从 mac 上跑 ",{"type":23,"tag":99,"props":8019,"children":8021},{"className":8020},[],[8022],{"type":28,"value":5577},{"type":28,"value":8024},"，主节点本机起的几个守护进程会被带走。这两件后面单独写了，见",{"type":23,"tag":41,"props":8026,"children":8027},{"href":5032},[8028],{"type":28,"value":5591},{"type":28,"value":5593},{"type":23,"tag":41,"props":8031,"children":8032},{"href":5596},[8033],{"type":28,"value":5599},{"type":28,"value":287},{"type":23,"tag":24,"props":8036,"children":8037},{},[8038],{"type":28,"value":8039},"这三台的毛病都是早就埋下的，平时不重启就发现不了。开机路径只有真重启一次才验得出来，所以这次每修完一台，都实打实重启了一遍才算数。",{"title":8,"searchDepth":924,"depth":924,"links":8041},[8042,8043,8044,8045,8046],{"id":7697,"depth":927,"text":7697},{"id":7746,"depth":927,"text":7749},{"id":7919,"depth":927,"text":7922},{"id":7947,"depth":927,"text":7950},{"id":7987,"depth":927,"text":7987},"content:blog:2026-09-22-pve2-power-key-boot-path.md","blog\u002F2026-09-22-pve2-power-key-boot-path.md","blog\u002F2026-09-22-pve2-power-key-boot-path",{"_path":8051,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":1262,"description":8052,"date":8053,"tags":8054,"body":8055,"_type":937,"_id":8308,"_source":939,"_file":8309,"_stem":8310,"_extension":942},"\u002Fblog\u002F2026-09-21-argus-lookahead-bias","收盘才到账的钱拿去买开盘的票，竞价表里存的其实是开盘第一分钟的行情。四处未来函数都不报错，回测曲线照样好看。","2026-09-21",[949,950,951,5719],{"type":20,"children":8056,"toc":8299},[8057,8062,8067,8072,8077,8095,8100,8105,8113,8118,8123,8129,8134,8142,8147,8152,8157,8163,8168,8173,8178,8183,8191,8196,8201,8206,8211,8217,8222,8227,8233,8238,8246,8251,8256,8261,8266,8271,8276,8294],{"type":23,"tag":24,"props":8058,"children":8059},{},[8060],{"type":28,"value":8061},"argus-quant 是我 7 月开始做的 A 股日频选股研究系统。每天收盘后用模型给全市场的股票打分，我想回答的问题是：按分数买一小篮子股票，拿几天卖掉，扣完成本能不能跑赢市场。这个问题只能靠回测回答，就是拿历史数据模拟：假如当年按这套规则买卖，结果会怎样。",{"type":23,"tag":24,"props":8063,"children":8064},{},[8065],{"type":28,"value":8066},"回测最常见的坑叫未来函数：模拟某一天的决策时，用到了那一刻还不知道的信息。今天我按「不要有未来函数、数据泄露和曲线过拟合」这条要求，把回测代码从头查了一遍，查出三处，加上 8 月底查出的一处，一共四处。四处都是早就在跑的代码，没有一处报过错。",{"type":23,"tag":50,"props":8068,"children":8070},{"id":8069},"先把时间线摆出来",[8071],{"type":28,"value":8069},{"type":23,"tag":24,"props":8073,"children":8074},{},[8075],{"type":28,"value":8076},"A 股一个交易日里，跟这几处有关的是这几个时刻：",{"type":23,"tag":399,"props":8078,"children":8079},{},[8080,8085,8090],{"type":23,"tag":403,"props":8081,"children":8082},{},[8083],{"type":28,"value":8084},"09:15 到 09:25 是开盘集合竞价，09:25 撮合出当天的开盘价；",{"type":23,"tag":403,"props":8086,"children":8087},{},[8088],{"type":28,"value":8089},"09:30 开始连续交易；",{"type":23,"tag":403,"props":8091,"children":8092},{},[8093],{"type":28,"value":8094},"15:00 收盘。",{"type":23,"tag":24,"props":8096,"children":8097},{},[8098],{"type":28,"value":8099},"另外还有两条规矩：股票是 T+1，当天买的第二天才能卖；卖出回来的钱当天就能用。",{"type":23,"tag":24,"props":8101,"children":8102},{},[8103],{"type":28,"value":8104},"我的回测约定是当天 09:30 按开盘价买入。所以每用到一个数，都要问一句：下单那一刻，这个数已经产生了吗？",{"type":23,"tag":24,"props":8106,"children":8107},{},[8108],{"type":23,"tag":65,"props":8109,"children":8112},{"alt":8110,"src":8111},"时间轴上的六个价格：前一天 15:00 的收盘价和当天 09:25 公布的开盘价标为能用；当天 09:30 按开盘价下单；当天 09:30–09:31 第一分钟的价格、当天 15:00 的收盘价、第二天的任何价格都标为不能用","\u002Fimages\u002Fblog\u002Fargus-lookahead\u002Forder-time.svg",[],{"type":23,"tag":24,"props":8114,"children":8115},{},[8116],{"type":28,"value":8117},"09:30 按开盘价下单时，前一天的收盘价和当天 09:25 公布的开盘价能用，开盘以后的任何价格都不能用。",{"type":23,"tag":24,"props":8119,"children":8120},{},[8121],{"type":28,"value":8122},"这句话听起来简单，下面四处都栽在它上面。",{"type":23,"tag":50,"props":8124,"children":8126},{"id":8125},"收盘才到账的钱拿去买开盘的票",[8127],{"type":28,"value":8128},"收盘才到账的钱，拿去买开盘的票",{"type":23,"tag":24,"props":8130,"children":8131},{},[8132],{"type":28,"value":8133},"第一处在回测引擎里。它处理一个交易日的顺序是先卖、后买。卖出如果按收盘价成交，回款当场记进账户，紧接着就按当天的开盘价买新票。",{"type":23,"tag":24,"props":8135,"children":8136},{},[8137],{"type":23,"tag":65,"props":8138,"children":8141},{"alt":8139,"src":8140},"一个交易日的时间轴：右边 15:00 按收盘价卖出旧票、回款到账，一条红色箭头指回左边 09:30 按开盘价买入新票，标注「这笔钱 09:30 时还不存在」","\u002Fimages\u002Fblog\u002Fargus-lookahead\u002Fbackflow.svg",[],{"type":23,"tag":24,"props":8143,"children":8144},{},[8145],{"type":28,"value":8146},"09:30 买入的时候，15:00 卖出的那笔钱还不存在。",{"type":23,"tag":24,"props":8148,"children":8149},{},[8150],{"type":28,"value":8151},"账户里的钱因此凭空多了一截，能多买，复利滚起来差距就大了。修掉以后，一个按收盘价卖出、两天换一次仓的模型，在开发集（专门拿来做研究、可以反复用的那段历史数据）上的总收益少了大约四成。另一个按开盘价卖出的模型，修完以后结果一个数都没变：开盘卖出的钱，09:30 买入时确实已经到账。",{"type":23,"tag":24,"props":8153,"children":8154},{},[8155],{"type":28,"value":8156},"修的时候还得防着矫枉过正。卖出回款当天能用，这是 A 股的真实规则，不能一刀切成「当天回款一律不能用」，有问题的只是时间顺序颠倒的那部分。我专门写了一个反面用例，钉住开盘卖出的钱当天可以用。",{"type":23,"tag":50,"props":8158,"children":8160},{"id":8159},"竞价表里存的是-0930-那一分钟",[8161],{"type":28,"value":8162},"竞价表里存的是 09:30 那一分钟",{"type":23,"tag":24,"props":8164,"children":8165},{},[8166],{"type":28,"value":8167},"第二处是 8 月 31 号查出来的，影响最大。",{"type":23,"tag":24,"props":8169,"children":8170},{},[8171],{"type":28,"value":8172},"系统里有张表，名字叫开盘集合竞价，我一直以为里面是 09:15 到 09:25 的竞价数据，还基于它算了一个「竞价涨幅」用来选票。后来系统接上了分钟线，我拿这张表和分钟线里 09:30 那一根对了一下：64 个交易日、2,509 只股票，一共 33,344 行，开盘、最高、最低、收盘、成交量五列一行不差。",{"type":23,"tag":24,"props":8174,"children":8175},{},[8176],{"type":28,"value":8177},"也就是说，这张表里存的是 09:30 到 09:31 那一分钟的行情，所谓「竞价涨幅」就是开盘后第一分钟的涨幅。拿它选票、再按开盘价买入，等于先看了开盘后一分钟的走势，再回到 09:30 下单。",{"type":23,"tag":24,"props":8179,"children":8180},{},[8181],{"type":28,"value":8182},"还有两个现象指向同一个结论。一个是把买入价从开盘价往后挪：",{"type":23,"tag":24,"props":8184,"children":8185},{},[8186],{"type":23,"tag":65,"props":8187,"children":8190},{"alt":8188,"src":8189},"柱状图：同一批信号的每笔平均净收益，按开盘价买 +3.33%，按开盘后 1 分钟均价买 +2.62%，按开盘后 3 分钟均价买 +0.47%，按开盘后 15 分钟均价买 +0.12%；标注晚 3 分钟入场收益少了 86%","\u002Fimages\u002Fblog\u002Fargus-lookahead\u002Fdecay.svg",[],{"type":23,"tag":24,"props":8192,"children":8193},{},[8194],{"type":28,"value":8195},"同一批信号，按开盘价买，每笔平均净收益 +3.33%；按开盘后 3 分钟的均价买，只剩 +0.47%。",{"type":23,"tag":24,"props":8197,"children":8198},{},[8199],{"type":28,"value":8200},"真要是盘前就知道的信息，不会开盘才 3 分钟就少了 86%。另一个是按这个数选出来的 105 笔交易，开盘第一分钟的均价笔笔都比开盘价高，没有一笔例外。真信号不会这么一边倒。",{"type":23,"tag":24,"props":8202,"children":8203},{},[8204],{"type":28,"value":8205},"根子在建表那天。那次只核对了字段名和行数，没拿任何独立的价格源对过，当时系统里还没有分钟线，想对也没东西可对。数据商接口里一个字段是什么意思，属于对方自己的说法，要用独立的数据源逐值对过才算数。",{"type":23,"tag":24,"props":8207,"children":8208},{},[8209],{"type":28,"value":8210},"建在这张表上的整条研究线都得重做。换成真实的开盘跳空重新算，方向反过来了：高开越多的票，接下来两天反而越差。",{"type":23,"tag":50,"props":8212,"children":8214},{"id":8213},"判断在不在股票池用了第二天的开盘价",[8215],{"type":28,"value":8216},"判断在不在股票池，用了第二天的开盘价",{"type":23,"tag":24,"props":8218,"children":8219},{},[8220],{"type":28,"value":8221},"股票池是每天允许挑选的候选范围，有一条价格上限。第三处就在这里：判断某一天一只票在不在池里，代码比的是它第二天的开盘价。",{"type":23,"tag":24,"props":8223,"children":8224},{},[8225],{"type":28,"value":8226},"这一处量很小，因为它而进出股票池的票不到 0.5%，方向还偏保守，被剔掉的是第二天跳空高开的票。但它照样是未来函数，照样要修。",{"type":23,"tag":50,"props":8228,"children":8230},{"id":8229},"补跑早几天的信号用上了后训出来的模型",[8231],{"type":28,"value":8232},"补跑早几天的信号，用上了后训出来的模型",{"type":23,"tag":24,"props":8234,"children":8235},{},[8236],{"type":28,"value":8237},"第四处跟模型的训练时间有关。模型按月训练，每月一份。按日子顺序往前跑没有问题，问题出在补跑：补的日子要是早于这一份模型的训练日，就会用上当时还不存在的模型。",{"type":23,"tag":24,"props":8239,"children":8240},{},[8241],{"type":23,"tag":65,"props":8242,"children":8245},{"alt":8243,"src":8244},"9 月 1 日到 10 日的 8 个交易日都标为补跑，9 月 11 日标为训出 9 月模型，红色箭头从 9 月 11 日的模型指回前面 8 天，标注这 8 天的信号用的是当时还不存在的模型；下方对比按日子顺序往前跑没有问题，补跑早于训练日的日子现在测试必须变红","\u002Fimages\u002Fblog\u002Fargus-lookahead\u002Freplay-model.svg",[],{"type":23,"tag":24,"props":8247,"children":8248},{},[8249],{"type":28,"value":8250},"9 月 1 号到 10 号有 8 天的回放信号就是这么来的，那个月的模型是 9 月 11 号训出来的。",{"type":23,"tag":50,"props":8252,"children":8254},{"id":8253},"为什么能活这么久",[8255],{"type":28,"value":8253},{"type":23,"tag":24,"props":8257,"children":8258},{},[8259],{"type":28,"value":8260},"都不报错，程序跑得完，每个指标也都有值。",{"type":23,"tag":24,"props":8262,"children":8263},{},[8264],{"type":28,"value":8265},"查的过程中我自己也被骗过一次。有一组「理想口径」的回测，关掉了成本、涨跌停和成交量上限，跑出来一个大得离谱的数。我第一反应是涨跌停：开盘涨停的票其实买不进。去数了一下，9,540 笔买入里没有一笔是开盘涨停，猜错了。把几个开关一个个单独开、单独关，才看出差额全在成交量上限那一项。几个开关的效果搅在一起时，别凭感觉把它安到其中一个头上。",{"type":23,"tag":24,"props":8267,"children":8268},{},[8269],{"type":28,"value":8270},"还有一个更要命的现象：有个模型只修了一处的时候，有 2 组结果跑赢基准；两处都修完，一组都没有。少修一处，会得到一个更好看、也更像新发现的结果。",{"type":23,"tag":50,"props":8272,"children":8274},{"id":8273},"现在怎么防",[8275],{"type":28,"value":8273},{"type":23,"tag":399,"props":8277,"children":8278},{},[8279,8284,8289],{"type":23,"tag":403,"props":8280,"children":8281},{},[8282],{"type":28,"value":8283},"每个进模型、进回测的数，都过一遍「下单那一刻它产生了吗」。",{"type":23,"tag":403,"props":8285,"children":8286},{},[8287],{"type":28,"value":8288},"测试断言后果，不断言实现。「有没有调用某个函数」「日志里有没有某个标记」这种断言，代码写反了照样是绿的。现在的断言是这一类：建仓金额不能超过前一天收盘时的账户净值；补跑早于模型训练日的日子，测试必须变红。",{"type":23,"tag":403,"props":8290,"children":8291},{},[8292],{"type":28,"value":8293},"新数据源进来，先拿独立的源逐值对一遍，对上了才用。",{"type":23,"tag":24,"props":8295,"children":8296},{},[8297],{"type":28,"value":8298},"这篇整理自 8 月 31 日和 9 月 21 日的排查记录。文中的收益数字全部来自回测，只讨论研究方法，不构成任何投资建议。",{"title":8,"searchDepth":924,"depth":924,"links":8300},[8301,8302,8303,8304,8305,8306,8307],{"id":8069,"depth":927,"text":8069},{"id":8125,"depth":927,"text":8128},{"id":8159,"depth":927,"text":8162},{"id":8213,"depth":927,"text":8216},{"id":8229,"depth":927,"text":8232},{"id":8253,"depth":927,"text":8253},{"id":8273,"depth":927,"text":8273},"content:blog:2026-09-21-argus-lookahead-bias.md","blog\u002F2026-09-21-argus-lookahead-bias.md","blog\u002F2026-09-21-argus-lookahead-bias",{"_path":8312,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":8313,"description":8314,"date":8315,"tags":8316,"body":8317,"_type":937,"_id":8910,"_source":939,"_file":8911,"_stem":8912,"_extension":942},"\u002Fblog\u002F2026-09-16-genesis-architecture-overview","Genesis 架构总览：后端怎么分模块，一个 SQL 节点怎么上线，外部系统怎么接","Genesis 的后端模块怎么分、一个 SQL 节点从编写到调度上线要经过哪些地方、跑起来以后故障怎么被发现、外部系统怎么接、怎么部署，以及还没做的部分。","2026-09-16",[46,14,1504],{"type":20,"children":8318,"toc":8900},[8319,8328,8341,8347,8355,8360,8365,8371,8384,8392,8397,8402,8410,8415,8420,8424,8442,8448,8453,8458,8463,8468,8495,8500,8521,8526,8531,8537,8547,8552,8557,8567,8572,8762,8775,8779,8787,8792,8813,8856,8869,8874,8880,8885,8890,8895],{"type":23,"tag":24,"props":8320,"children":8321},{},[8322,8326],{"type":23,"tag":41,"props":8323,"children":8324},{"href":43},[8325],{"type":28,"value":46},{"type":28,"value":8327}," 是我在做的一站式数据平台，产品形态参照 DataWorks，给中小团队自己部署用。功能铺开以后，经常要跟人讲它到底由哪几块组成，每次都现画一遍图，干脆写下来，顺序按新同事第一天需要知道的来排。",{"type":23,"tag":24,"props":8329,"children":8330},{},[8331,8333,8339],{"type":28,"value":8332},"内容是照着代码和 8 月那次架构诊断整理的，地址和账号都去掉了。想先看个大概的话，可以先看后来写的",{"type":23,"tag":41,"props":8334,"children":8336},{"href":8335},"\u002Fblog\u002F2026-11-07-genesis-architecture-illustrated\u002F",[8337],{"type":28,"value":8338},"图解版",{"type":28,"value":8340},"，那篇更入门一些。",{"type":23,"tag":50,"props":8342,"children":8344},{"id":8343},"genesis-自己只有三台机器",[8345],{"type":28,"value":8346},"Genesis 自己只有三台机器",{"type":23,"tag":2152,"props":8348,"children":8350},{"code":8349},"浏览器\n  │\n  ▼\n前端节点    genesis-web 容器：nginx + 前端静态文件\n  │  \u002Fapi\u002F 反代到后端；日志流和 Agent 回复走 SSE，单独配了 location\n  ▼\n后端节点    genesis-server 容器：Spring Boot 单体，20 个业务模块\n  │\n  ├─ 数据库节点  MySQL 8.0：genesis 库，Flyway 管 schema\n  ├─ 数据库节点  Redis 7：Agent 对话历史、手写缓存\n  │\n  ├─ DolphinScheduler 3.2.2   REST   建\u002F改工作流、上线、排期、查实例\n  ├─ HiveServer2              JDBC   试跑、DDL、库表元数据\n  ├─ Spark 3.5.8 Thrift       JDBC   Spark SQL \u002F Iceberg \u002F Hudi 数据源\n  ├─ Atlas 2.3.0              REST   注册血缘、查血缘图\n  ├─ YARN ResourceManager     REST   取队列和使用率\n  └─ 大模型接口               HTTP   IDE 助手、发布建议、AI 预审\n\n调度执行：DS Worker（5 台）→ beeline → HiveServer2 \u002F Spark Thrift → YARN\n",[8351],{"type":23,"tag":99,"props":8352,"children":8353},{"__ignoreMap":8},[8354],{"type":28,"value":8349},{"type":23,"tag":24,"props":8356,"children":8357},{},[8358],{"type":28,"value":8359},"Genesis 自己只有三个节点，都是 PVE 上的虚拟机：一台放 MySQL 和 Redis，下面叫数据库节点；一台跑后端，叫后端节点；一台跑 nginx 和前端，叫前端节点。真正算数据的活全在外面那套七个节点的大数据集群上，Hive、Spark、YARN、HDFS、DolphinScheduler（下面简称 DS）、Atlas 都在那边。",{"type":23,"tag":24,"props":8361,"children":8362},{},[8363],{"type":28,"value":8364},"后端干的事，是把用户在页面上写的 SQL 和调度配置变成 DS 能跑的工作流，再把运行结果、质量和血缘收回来给人看。图里的 SSE 是服务端推送：浏览器开一条长连接，后端有一行日志就往下推一行，IDE 的运行日志和 AI 助手的回复都靠它。",{"type":23,"tag":50,"props":8366,"children":8368},{"id":8367},"后端一个-jar20-个模块",[8369],{"type":28,"value":8370},"后端：一个 jar，20 个模块",{"type":23,"tag":24,"props":8372,"children":8373},{},[8374,8376,8382],{"type":28,"value":8375},"后端是 Spring Boot 3.2 + MyBatis-Plus，JDK 17，打成一个 jar 跑在一个容器里，没拆微服务。8 月初盘点是 461 个类、48,575 行，按功能分包，",{"type":23,"tag":99,"props":8377,"children":8379},{"className":8378},[],[8380],{"type":28,"value":8381},"module",{"type":28,"value":8383}," 下面 20 个业务模块。",{"type":23,"tag":24,"props":8385,"children":8386},{},[8387],{"type":23,"tag":65,"props":8388,"children":8391},{"alt":8389,"src":8390},"genesis-server 的 20 个业务模块按业务边界分组：身份与租户（auth、system、project），数据开发（devnode、resource、sql，标蓝），数据集成（transfer），调度运维（scheduler 加 common\u002Fds 的 DS 客户端），数据治理（datastandard、quality、catalog、lineage），数据建模（onedata），支撑（notification、report、workbench、global、security），demo（虚线框，计划剥离）；底部是被一大半模块依赖的数据源 engine，以及 AI 功能共用的 AgentService","\u002Fimages\u002Fblog\u002Fgenesis-overview\u002Fbackend-modules.svg",[],{"type":23,"tag":24,"props":8393,"children":8394},{},[8395],{"type":28,"value":8396},"8 月做架构决策时，我按业务边界（DDD 里叫限界上下文）把这 20 个模块归了组，代码现在基本还是图里这个格局。几处要多说一句：devnode 是最大的模块，节点的增删改、试跑、提交、发布、下线都在里面；engine 管数据源，一大半模块都依赖它；security 管租户、队列、Worker 分组和敏感字段；demo 是演示数据，计划剥成独立的 Maven 模块。",{"type":23,"tag":24,"props":8398,"children":8399},{},[8400],{"type":28,"value":8401},"模块之间有一部分靠 Spring 的进程内事件解耦：一个模块发事件，别的模块各自去听，互相不直接调用。",{"type":23,"tag":24,"props":8403,"children":8404},{},[8405],{"type":23,"tag":65,"props":8406,"children":8409},{"alt":8407,"src":8408},"Genesis 的三类进程内事件：节点发布事件由血缘模块和数据域推断去听；IDE 执行完成事件触发自动质量检查（每条规则 30 秒超时预算）、慢 SQL 检测和执行异常检测；调度失败事件由每 30 秒一轮的轮询器在实例变成 FAILURE 时发出，Incident 监听器和通知模块去听；底部红框说明没有 MQ 和 Outbox，进程重启会丢事件","\u002Fimages\u002Fblog\u002Fgenesis-overview\u002Fevents.svg",[],{"type":23,"tag":24,"props":8411,"children":8412},{},[8413],{"type":28,"value":8414},"这些事件不经过 MQ，也没有 Outbox。Outbox 的做法是把要发的事件和业务数据写进同一个数据库事务，再由单独的投递程序推到消息队列，进程挂了事件也还在库里。Genesis 现在没有这一层，代码注释里写得很明白，这是有损交付：进程重启的时候，正在跑的检查会静默丢掉。现阶段我接受这个代价，换成 Outbox + Kafka 排在路线的 Phase 4。",{"type":23,"tag":24,"props":8416,"children":8417},{},[8418],{"type":28,"value":8419},"AI 相关的功能也都在这个单体里：IDE 助手、发布建议、影响分析、调度建议、工作流模板、全局 Agent，还有提交审核时的 AI 预审。它们共用一个 AgentService，负责工具注册、对话历史和流式调用。对话历史放 Redis，模型地址和 key 配在系统参数里，没有写死在代码里。",{"type":23,"tag":50,"props":8421,"children":8422},{"id":3456},[8423],{"type":28,"value":3456},{"type":23,"tag":24,"props":8425,"children":8426},{},[8427,8429,8434,8436,8440],{"type":28,"value":8428},"前端是 Vue 3 + TypeScript + Vite + Ant Design Vue 4，状态用 Pinia，SQL 编辑器是 Monaco，DAG 画布用 AntV X6，图表用 ECharts。页面按功能分目录，IDE、数据地图、血缘、质量、数据标准、OneData、报表、运维监控各占一块，8 月初是 124 个 ",{"type":23,"tag":99,"props":8430,"children":8432},{"className":8431},[],[8433],{"type":28,"value":3469},{"type":28,"value":8435}," 文件、93 个路由。首屏体积的问题单独写过",{"type":23,"tag":41,"props":8437,"children":8438},{"href":1976},[8439],{"type":28,"value":1658},{"type":28,"value":8441},"，首屏 JS 从 1462KB 降到了 523KB（gzip）。",{"type":23,"tag":50,"props":8443,"children":8445},{"id":8444},"一个-sql-节点从写到上线",[8446],{"type":28,"value":8447},"一个 SQL 节点从写到上线",{"type":23,"tag":24,"props":8449,"children":8450},{},[8451],{"type":28,"value":8452},"这是平台的主链路，按用户实际点按钮的顺序走一遍。",{"type":23,"tag":24,"props":8454,"children":8455},{},[8456],{"type":28,"value":8457},"在 IDE 里新建 SQL 节点，用 Monaco 写 SQL，点运行就是开发态试跑。后端按节点绑定的数据源拿 JDBC 连接，没绑就按项目和环境去找：Hive 走 HiveServer2，Spark SQL、Iceberg、Hudi 走 Spark 3.5.8 的 Thrift Server，日志通过 SSE 一行行推回浏览器。SQL 前面会注入项目配的 YARN 队列。这一条是电商数仓实调那晚才补上的，在那之前，试跑和发布用的不是同一个队列。",{"type":23,"tag":24,"props":8459,"children":8460},{},[8461],{"type":28,"value":8462},"写完点提交，节点从 DRAFT 变成 SUBMITTED，同时存一份版本快照。项目可以设成强制代码审核，这时必须有人审过当前版本才能发生产。审核单一建，AI 先预审一遍，意见追加到审核单的评论里，再通知审核人去看。",{"type":23,"tag":24,"props":8464,"children":8465},{},[8466],{"type":28,"value":8467},"发生产之前先过预检。写这篇时线上一共 10 个检查器：SQL 语法、表是否存在、命名规范、词根、字段词根、字段合规、调度参数占位符、数据源、质量规则、字段标准绑定。后来为单机 lite 模式加的一个（检查调度引擎有没有启用）也合了进来，现在是 11 个。每个检查器给出 ERROR、WARNING 或 INFO，只有没通过的 ERROR 会拦住发布，像字段标准绑定这一项目前只报 WARNING。同一份内容在预检端点跑过、没有阻断错误的话，10 分钟内再点发布不会重跑一遍，内容一改就失效。",{"type":23,"tag":24,"props":8469,"children":8470},{},[8471,8473,8478,8480,8485,8487,8493],{"type":28,"value":8472},"调度参数占位符这一项也是实调时补的。当时代码里写的是 ",{"type":23,"tag":99,"props":8474,"children":8476},{"className":8475},[],[8477],{"type":28,"value":1765},{"type":28,"value":8479},"，面板上配的参数叫 ",{"type":23,"tag":99,"props":8481,"children":8483},{"className":8482},[],[8484],{"type":28,"value":1773},{"type":28,"value":8486},"，提交、发布全程没有任何提示，DS 替换不了这个占位符，",{"type":23,"tag":99,"props":8488,"children":8490},{"className":8489},[],[8491],{"type":28,"value":8492},"where dt='${do_date}'",{"type":28,"value":8494}," 就静默读了一个空分区。",{"type":23,"tag":24,"props":8496,"children":8497},{},[8498],{"type":28,"value":8499},"真正发到 DS 分三段，为的是任何一步失败都留痕、能重试。第一段先落库，节点置 PUBLISHING，发布记录置 RUNNING。第二段按步骤调 DS 的 REST 接口：生成任务编码、创建或更新工作流、上线、同步排期，每走一步都记下当前步骤；工作流编码一拿到就落库，后面失败了重试走更新，不会重复建。第三段收敛：成功是 PUBLISHED；失败是 PUBLISH_FAILED，带上失败在哪一步、原因是什么，可以重试。",{"type":23,"tag":24,"props":8501,"children":8502},{},[8503,8505,8511,8513,8519],{"type":28,"value":8504},"SQL 节点到了 DS 那边，会被包成一个 beeline 的 SHELL 任务。DS 自带的 SQL 任务要求先在 DS 里注册数据源，我们没在 DS 侧注册，直接把原始 SQL 塞进去会被 DS 用错误码 50020 拒掉。beeline 用 ",{"type":23,"tag":99,"props":8506,"children":8508},{"className":8507},[],[8509],{"type":28,"value":8510},"-e",{"type":28,"value":8512}," 传 SQL，不从 stdin 读，因为没有 TTY 的时候从 stdin 读会挂住。工作流名字是 ",{"type":23,"tag":99,"props":8514,"children":8516},{"className":8515},[],[8517],{"type":28,"value":8518},"genesis_",{"type":28,"value":8520}," 加节点名。",{"type":23,"tag":24,"props":8522,"children":8523},{},[8524],{"type":28,"value":8525},"另外有一个对账任务，默认每小时拿 Genesis 里已发布、已下线的节点去对 DS 上的工作流定义，对不上的标成 OUT_OF_SYNC，面板上可以一键 resync；卡在 PUBLISHING 不动的中断发布，收敛成 PUBLISH_FAILED。DS 暂时连不上的那一轮就跳过，免得把网络问题误判成定义漂移。",{"type":23,"tag":24,"props":8527,"children":8528},{},[8529],{"type":28,"value":8530},"发布成功会发一个节点发布事件。血缘模块收到后异步解析 SQL、往 Atlas 注册，失败不影响发布本身；另一个监听器按节点名和 SQL 里的关键词推断数据域，节点没设域标签的话顺手补上。",{"type":23,"tag":50,"props":8532,"children":8534},{"id":8533},"跑起来以后故障怎么被发现",[8535],{"type":28,"value":8536},"跑起来以后，故障怎么被发现",{"type":23,"tag":24,"props":8538,"children":8539},{},[8540,8542,8546],{"type":28,"value":8541},"到点以后，DS 的 Worker 执行那段 beeline 脚本，SQL 落到 HiveServer2 或 Spark Thrift 上，再变成 YARN 上的作业。DS 从 9 月 4 号起是集群模式：主节点上跑 Master、Api、Alert 和一个 Worker，另外四台各跑一个 Worker，元数据放 MySQL。在这之前它其实一直是单机模式加 H2 内存库，迁移过程写在",{"type":23,"tag":41,"props":8543,"children":8544},{"href":1715},[8545],{"type":28,"value":1718},{"type":28,"value":1720},{"type":23,"tag":24,"props":8548,"children":8549},{},[8550],{"type":28,"value":8551},"Genesis 这边有个轮询器，默认每 30 秒去 DS 查一遍已发布工作流的实例状态，发现实例变成 FAILURE 就发一个调度失败事件。Incident 监听器收到以后，按工作流和实例去重，开一个 Incident，故障时间取 DS 实例的结束时间，然后异步补两样上下文：把这个节点绑的质量规则重跑一遍，再查血缘看下游影响到谁。通知模块同时发一条失败通知。",{"type":23,"tag":24,"props":8553,"children":8554},{},[8555],{"type":28,"value":8556},"IDE 试跑那条路也有事件。试跑结束时发执行完成事件，后面挂着自动质量检查（每条规则 30 秒超时预算）、慢 SQL 检测和执行异常检测。",{"type":23,"tag":24,"props":8558,"children":8559},{},[8560,8562,8566],{"type":28,"value":8561},"人真正盯着看的是表指挥中心，也就是表详情页。它背后是 catalog 模块里的表上下文服务：把一张表的质量摘要、质量详情、活跃 Incident、最近变更、引用它的 IDE 节点这 5 段丢进专用线程池并行查，共享一个截止时间（默认 5 秒），每段单独标 OK、TIMEOUT 或 ERROR。状态不是 OK 的段，响应里就不给这个键；前端配套改成把健康点判灰、标出哪一段暂不可用，不会把查询失败后的零值当成健康。这个服务设计上是页面和 Agent 共用的，目前只有表指挥中心在用。为什么这么改、线程池参数怎么定的，单独写过",{"type":23,"tag":41,"props":8563,"children":8564},{"href":1834},[8565],{"type":28,"value":1658},{"type":28,"value":287},{"type":23,"tag":50,"props":8568,"children":8570},{"id":8569},"外部系统怎么接的",[8571],{"type":28,"value":8569},{"type":23,"tag":533,"props":8573,"children":8574},{},[8575,8596],{"type":23,"tag":537,"props":8576,"children":8577},{},[8578],{"type":23,"tag":541,"props":8579,"children":8580},{},[8581,8586,8591],{"type":23,"tag":545,"props":8582,"children":8583},{},[8584],{"type":28,"value":8585},"系统",{"type":23,"tag":545,"props":8587,"children":8588},{},[8589],{"type":28,"value":8590},"用来做什么",{"type":23,"tag":545,"props":8592,"children":8593},{},[8594],{"type":28,"value":8595},"怎么接",{"type":23,"tag":561,"props":8597,"children":8598},{},[8599,8617,8649,8675,8693,8711,8745],{"type":23,"tag":541,"props":8600,"children":8601},{},[8602,8607,8612],{"type":23,"tag":568,"props":8603,"children":8604},{},[8605],{"type":28,"value":8606},"DolphinScheduler 3.2.2",{"type":23,"tag":568,"props":8608,"children":8609},{},[8610],{"type":28,"value":8611},"工作流定义、上线、排期、实例状态、补数",{"type":23,"tag":568,"props":8613,"children":8614},{},[8615],{"type":28,"value":8616},"REST，自己封装的客户端，token 失效自动重新获取",{"type":23,"tag":541,"props":8618,"children":8619},{},[8620,8625,8630],{"type":23,"tag":568,"props":8621,"children":8622},{},[8623],{"type":28,"value":8624},"HiveServer2 \u002F Spark 3.5.8 Thrift",{"type":23,"tag":568,"props":8626,"children":8627},{},[8628],{"type":28,"value":8629},"试跑、DDL、库表和分区元数据",{"type":23,"tag":568,"props":8631,"children":8632},{},[8633,8635,8641,8643],{"type":28,"value":8634},"JDBC，Spark 的 ",{"type":23,"tag":99,"props":8636,"children":8638},{"className":8637},[],[8639],{"type":28,"value":8640},"jdbc:spark:\u002F\u002F",{"type":28,"value":8642}," 会被改写成 ",{"type":23,"tag":99,"props":8644,"children":8646},{"className":8645},[],[8647],{"type":28,"value":8648},"jdbc:hive2:\u002F\u002F",{"type":23,"tag":541,"props":8650,"children":8651},{},[8652,8657,8662],{"type":23,"tag":568,"props":8653,"children":8654},{},[8655],{"type":28,"value":8656},"Apache Atlas 2.3.0",{"type":23,"tag":568,"props":8658,"children":8659},{},[8660],{"type":28,"value":8661},"血缘注册、血缘图、实体搜索",{"type":23,"tag":568,"props":8663,"children":8664},{},[8665,8667,8673],{"type":28,"value":8666},"REST，应用启动后幂等注册一套 ",{"type":23,"tag":99,"props":8668,"children":8670},{"className":8669},[],[8671],{"type":28,"value":8672},"genesis_*",{"type":28,"value":8674}," 自定义类型",{"type":23,"tag":541,"props":8676,"children":8677},{},[8678,8683,8688],{"type":23,"tag":568,"props":8679,"children":8680},{},[8681],{"type":28,"value":8682},"DataX \u002F SeaTunnel",{"type":23,"tag":568,"props":8684,"children":8685},{},[8686],{"type":28,"value":8687},"数据同步",{"type":23,"tag":568,"props":8689,"children":8690},{},[8691],{"type":28,"value":8692},"平台渲染任务配置，包成 DS 的 SHELL 任务发布；CDC 模式走 SeaTunnel，目前只支持 MySQL 源",{"type":23,"tag":541,"props":8694,"children":8695},{},[8696,8701,8706],{"type":23,"tag":568,"props":8697,"children":8698},{},[8699],{"type":28,"value":8700},"YARN",{"type":23,"tag":568,"props":8702,"children":8703},{},[8704],{"type":28,"value":8705},"选队列",{"type":23,"tag":568,"props":8707,"children":8708},{},[8709],{"type":28,"value":8710},"ResourceManager 的 REST 接口取叶子队列和使用率，连不上就退回 default",{"type":23,"tag":541,"props":8712,"children":8713},{},[8714,8719,8724],{"type":23,"tag":568,"props":8715,"children":8716},{},[8717],{"type":28,"value":8718},"Superset 4.1.1",{"type":23,"tag":568,"props":8720,"children":8721},{},[8722],{"type":28,"value":8723},"报表看板",{"type":23,"tag":568,"props":8725,"children":8726},{},[8727,8729,8735,8737,8743],{"type":28,"value":8728},"报表的 ",{"type":23,"tag":99,"props":8730,"children":8732},{"className":8731},[],[8733],{"type":28,"value":8734},"layoutConfig",{"type":28,"value":8736}," 里配 ",{"type":23,"tag":99,"props":8738,"children":8740},{"className":8739},[],[8741],{"type":28,"value":8742},"supersetUrl",{"type":28,"value":8744},"，报表页挂入口或内嵌",{"type":23,"tag":541,"props":8746,"children":8747},{},[8748,8752,8757],{"type":23,"tag":568,"props":8749,"children":8750},{},[8751],{"type":28,"value":1606},{"type":23,"tag":568,"props":8753,"children":8754},{},[8755],{"type":28,"value":8756},"各类 Agent 和 AI 预审",{"type":23,"tag":568,"props":8758,"children":8759},{},[8760],{"type":28,"value":8761},"HTTP 流式调用，地址和 key 在系统参数里",{"type":23,"tag":24,"props":8763,"children":8764},{},[8765,8767,8773],{"type":28,"value":8766},"这些外部调用都是手写的 REST 和 JDBC 客户端，没有熔断，也没有降级：对方慢了或挂了，请求就一直等或者直接报错，没有自动断开、改走备用逻辑这一层。数据源这块最乱，DatasourceServiceImpl 里还是一处处直接 ",{"type":23,"tag":99,"props":8768,"children":8770},{"className":8769},[],[8771],{"type":28,"value":8772},"DriverManager.getConnection",{"type":28,"value":8774},"，方言靠字符串前缀判断。8 月定的方案是抽一层统一的 Connector SPI，每个数据源配自己的连接池，目前还没动。",{"type":23,"tag":50,"props":8776,"children":8777},{"id":4659},[8778],{"type":28,"value":4659},{"type":23,"tag":24,"props":8780,"children":8781},{},[8782],{"type":23,"tag":65,"props":8783,"children":8786},{"alt":8784,"src":8785},"Genesis 的部署与发布：开发用的 Mac 上 mvn clean package 打 jar、vite build 打 dist，分别同步到后端节点和前端节点再 docker build；三台 VM 在同一台物理机（PVE 集群里的一台 i7 笔记本）上，后端容器限 2 核 2G，前端 nginx 给 3 个 SSE 接口单独配 location，数据库节点的 MySQL 装在系统里、Redis 在容器里；下方红色虚线框是计划废掉的 hotpatch，最底下说明镜像只有 latest 标签，回滚要重新构建","\u002Fimages\u002Fblog\u002Fgenesis-overview\u002Fdeploy.svg",[],{"type":23,"tag":24,"props":8788,"children":8789},{},[8790],{"type":28,"value":8791},"三个节点上的服务都用 Docker Compose 管，只有数据库节点的 MySQL 是装在系统里的，没进容器。",{"type":23,"tag":24,"props":8793,"children":8794},{},[8795,8797,8803,8805,8811],{"type":28,"value":8796},"数据库节点上，MySQL 8.0 只放 genesis 一个库，Redis 7 跑在容器里。Hive 元数据和 DS 元数据在大数据集群主节点的 MySQL 上，不在这台。后端节点跑 genesis-server 容器，限 2 核、2G 内存，健康检查打 actuator 的 health 端点。前端节点跑 genesis-web 容器，nginx 托管前端静态文件，",{"type":23,"tag":99,"props":8798,"children":8800},{"className":8799},[],[8801],{"type":28,"value":8802},"\u002Fapi\u002F",{"type":28,"value":8804}," 反代到后端节点。IDE 日志流、IDE 助手、全局 Agent 这三个 SSE 接口单独配了 location，关掉 ",{"type":23,"tag":99,"props":8806,"children":8808},{"className":8807},[],[8809],{"type":28,"value":8810},"proxy_buffering",{"type":28,"value":8812},"，读超时放到 10 分钟，否则事件攒在 nginx 的缓冲区里推不到前端。",{"type":23,"tag":24,"props":8814,"children":8815},{},[8816,8818,8824,8826,8832,8834,8840,8842,8847,8849,8854],{"type":28,"value":8817},"发布靠仓库里的 deploy.sh。后端在 Mac 上 ",{"type":23,"tag":99,"props":8819,"children":8821},{"className":8820},[],[8822],{"type":28,"value":8823},"mvn clean package",{"type":28,"value":8825}," 打出 jar，连同源码一起 rsync 到后端节点，在那台上 ",{"type":23,"tag":99,"props":8827,"children":8829},{"className":8828},[],[8830],{"type":28,"value":8831},"docker build",{"type":28,"value":8833},"；前端在本地 ",{"type":23,"tag":99,"props":8835,"children":8837},{"className":8836},[],[8838],{"type":28,"value":8839},"vite build",{"type":28,"value":8841},"，把 dist 同步到前端节点再打镜像。镜像一律是 ",{"type":23,"tag":99,"props":8843,"children":8845},{"className":8844},[],[8846],{"type":28,"value":3566},{"type":28,"value":8848},"，没有镜像仓库，想回滚只能把旧版本重新构建一遍。还有一个 hotpatch 子命令，直接把新 jar ",{"type":23,"tag":99,"props":8850,"children":8852},{"className":8851},[],[8853],{"type":28,"value":3574},{"type":28,"value":8855}," 进正在跑的容器再重启，用多了容器和镜像就对不上，架构方案里已经定了要废掉它。",{"type":23,"tag":24,"props":8857,"children":8858},{},[8859,8861,8867],{"type":28,"value":8860},"schema 从 9 月 3 号起交给 Flyway（一个按版本号顺序执行建表、改表脚本的工具）。V100 是当天按生产库真实结构做的基线：生产库第一次接入时只登记基线、不执行 V100，空库则从 V100 建出和生产一样的结构，之后的变更一律写 V101 往后的新文件，不再手工执行 DDL。接入时踩过一个小坑：基线里 naming_rule 表 name_pattern 字段的默认值带着 ",{"type":23,"tag":99,"props":8862,"children":8864},{"className":8863},[],[8865],{"type":28,"value":8866},"${layer}",{"type":28,"value":8868},"，Flyway 把它当成占位符去替换，应用起不来。这是在 devbox 上拿空库试的时候抓出来的，后来把占位符替换整个关了，我们的脚本本来也不用。",{"type":23,"tag":24,"props":8870,"children":8871},{},[8872],{"type":28,"value":8873},"这三台 VM 在同一台物理机上，是 PVE 集群里的一台 i7 笔记本；大数据集群的七个节点也全在另一台物理机上。集群那边 NameNode、ResourceManager、HBase Master 都做了主备，可物理机一停就全停，这些 HA 在物理机这一层被抵消了。8 月诊断时就写下了这条，现在也还是这样。",{"type":23,"tag":50,"props":8875,"children":8877},{"id":8876},"没做的和已经封存的",[8878],{"type":28,"value":8879},"没做的，和已经封存的",{"type":23,"tag":24,"props":8881,"children":8882},{},[8883],{"type":28,"value":8884},"字段级血缘。发布时 SQL 用 JSqlParser 解析，输入输出表注册成 Atlas 里的 process；能解析出字段映射的，也会顺带往 Atlas 写一份列级实体。但这只是个雏形，8 月诊断给的结论仍然是 Hive 表级为主。正式方案是血缘迁到 OpenMetadata，采集按 OpenLineage 标准，平台自己的 SQL 用 sqlglot 做列级解析，排在 Phase 2，还在计划里。",{"type":23,"tag":24,"props":8886,"children":8887},{},[8888],{"type":28,"value":8889},"应用监控。pom 里有 micrometer 的 Prometheus 依赖，默认配置也打开了 prometheus 端点，但生产用的 docker profile 只暴露了 health，Prometheus 没有抓 Genesis 的指标，日志也没有进 Loki。集群那边的主机和容器监控是有的，Genesis 应用自己的指标和日志目前都不在里面。",{"type":23,"tag":24,"props":8891,"children":8892},{},[8893],{"type":28,"value":8894},"自研调度核心。仓库里原来有一个 genesis-scheduler-core，是从 DS 3.2.2 精简出来的嵌入式调度骨架。8 月定架构决策时决定继续用 DS，计划从 3.2.2 升到 3.3.2，这个骨架封存，不投产。当时后端的 pom 里还挂着这个依赖，但代码里没有一处引用它。9 月 6 日做单机 lite 模式时核实过：它的自动配置开关在任何配置文件里都没出现过，从来没被装配过，于是连模块带依赖一起从仓库删了。生产调度只有 DS 一套。",{"type":23,"tag":24,"props":8896,"children":8897},{},[8898],{"type":28,"value":8899},"还有三件 8 月就定了方向、还没落地的事：用 ArchUnit 把模块边界固化下来，数据源抽成 Connector SPI，镜像按 git sha 打标签。现在后端要回滚一次，还得在后端节点上把旧版本重新 build 一遍。",{"title":8,"searchDepth":924,"depth":924,"links":8901},[8902,8903,8904,8905,8906,8907,8908,8909],{"id":8343,"depth":927,"text":8346},{"id":8367,"depth":927,"text":8370},{"id":3456,"depth":927,"text":3456},{"id":8444,"depth":927,"text":8447},{"id":8533,"depth":927,"text":8536},{"id":8569,"depth":927,"text":8569},{"id":4659,"depth":927,"text":4659},{"id":8876,"depth":927,"text":8879},"content:blog:2026-09-16-genesis-architecture-overview.md","blog\u002F2026-09-16-genesis-architecture-overview.md","blog\u002F2026-09-16-genesis-architecture-overview",{"_path":8914,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":8915,"description":8916,"date":8917,"tags":8918,"body":8920,"_type":937,"_id":10313,"_source":939,"_file":10314,"_stem":10315,"_extension":942},"\u002Fblog\u002F2026-09-12-genesis-lakehouse-hudi-iceberg","给 Genesis 接 Hudi 和 Iceberg：灰度怎么设计，canary 卡在了哪","给七节点 Spark 集群正式接入 Hudi 和 Iceberg：版本怎么定，四段式灰度怎么走，五次 canary 各自停在哪，最后卡在了 Java 版本上。","2026-09-12",[46,8919,725,572],"湖仓",{"type":20,"children":8921,"toc":10302},[8922,8931,8936,8941,8953,8958,8963,8968,8973,8991,9004,9009,9014,9019,9048,9084,9089,9094,9100,9127,9216,9224,9257,9294,9314,9320,9400,9405,9410,9415,9420,9425,9438,9443,9456,9461,9469,9594,9599,9619,9625,9630,9650,9658,9857,9875,9880,9892,9897,9930,9935,9940,9945,9992,9997,10021,10071,10076,10118,10123,10164,10249,10261,10274,10287,10293,10298],{"type":23,"tag":24,"props":8923,"children":8924},{},[8925,8929],{"type":23,"tag":41,"props":8926,"children":8927},{"href":43},[8928],{"type":28,"value":46},{"type":28,"value":8930}," 是我在做的数据平台，对标 DataWorks，面向中小团队自部署。真正跑计算的是一套七节点的 Spark on YARN 集群。",{"type":23,"tag":24,"props":8932,"children":8933},{},[8934],{"type":28,"value":8935},"Hudi 和 Iceberg 都是「表格式」：数据还是 HDFS 上的一堆文件，它们在文件上面加一层元数据，让表能做更新、删除、合并（MERGE），还能按快照回看历史版本（time travel）。在这套集群上，这两样原本只是手工放进去的雏形：能查，但版本说不清，也没有灰度和回滚。",{"type":23,"tag":24,"props":8937,"children":8938},{},[8939],{"type":28,"value":8940},"2026 年 9 月我开始把它做成正式接入，要求版本锁定、能验证、能回滚。目标版本是 Hudi 1.2.0 加 Iceberg 1.6.1，按 Preflight、Stage、Canary、Cutover 四段上线。最后一次 canary 拦下的问题是 Hudi 1.2.0 需要 Java 11，到写这篇的时候，正式切换还没有发生。",{"type":23,"tag":24,"props":8942,"children":8943},{},[8944,8946,8952],{"type":28,"value":8945},"下面的内容来自 9 月的湖仓接入设计文档和验证记录，配置里地址类的值换成了 ",{"type":23,"tag":99,"props":8947,"children":8949},{"className":8948},[],[8950],{"type":28,"value":8951},"\u003Credacted>",{"type":28,"value":287},{"type":23,"tag":50,"props":8954,"children":8956},{"id":8955},"开工前集群上有什么",[8957],{"type":28,"value":8955},{"type":23,"tag":24,"props":8959,"children":8960},{},[8961],{"type":28,"value":8962},"集群跑的是 Hadoop 3.3.6、YARN、Spark 3.5.8（Scala 2.12）和 Hive Metastore 3.1.3。Hive Metastore（下面简称 HMS）是存表结构、分区、存储位置这些元数据的服务。Spark Thrift Server 跑在主节点上，它让 Spark 能像数据库一样接 JDBC 连接，Genesis 下发的 SQL 都从它进。主机默认的 Java 已经升级了，但 Thrift Server 进程和 YARN 容器仍固定用 JDK 8，这一点后面很关键。",{"type":23,"tag":24,"props":8964,"children":8965},{},[8966],{"type":28,"value":8967},"现场已经有一套手工雏形：Spark 本地 jars 和 HDFS 上的 Spark JAR 目录里都放着 Hudi 0.15.0 与 Iceberg 1.5.2，Spark 同时加载了两个 SQL extension，两种测试表都能查，Genesis 库里也有两条健康的 HUDI、ICEBERG 数据源。",{"type":23,"tag":24,"props":8969,"children":8970},{},[8971],{"type":28,"value":8972},"离交付还差得远：",{"type":23,"tag":399,"props":8974,"children":8975},{},[8976,8981,8986],{"type":23,"tag":403,"props":8977,"children":8978},{},[8979],{"type":28,"value":8980},"后端只正式声明了 ICEBERG，前端没有这两种引擎的创建入口；",{"type":23,"tag":403,"props":8982,"children":8983},{},[8984],{"type":28,"value":8985},"集群规划文档里 Iceberg 同时写着 1.7.1 和 1.5.2，而 1.7 起要求 Java 11，和 JDK 8 的运行环境冲突；",{"type":23,"tag":403,"props":8987,"children":8988},{},[8989],{"type":28,"value":8990},"没有版本清单、校验和、灰度和自动回滚，七个节点各是什么版本，拿不出可审计的证明。",{"type":23,"tag":24,"props":8992,"children":8993},{},[8994,8996,9002],{"type":28,"value":8995},"目标定得很具体：七个节点统一、可审计的运行版本；runtime JAR 经 HDFS 分发，任何一个 NodeManager 都能跑 Hudi\u002FIceberg 任务；一个 Thrift 入口同时支持 Hive、Hudi 和命名的 Iceberg catalog；Genesis 这边从数据源、元数据、IDE、调度发布到质量、血缘、报表都要能用；集群操作只走 ",{"type":23,"tag":99,"props":8997,"children":8999},{"className":8998},[],[9000],{"type":28,"value":9001},"deploy.sh",{"type":28,"value":9003}," 一个入口；存量数据一律不碰。",{"type":23,"tag":24,"props":9005,"children":9006},{},[9007],{"type":28,"value":9008},"范围也刻意收窄了：不给 Flink 1.14.6 装 connector，不升级 Flink、JDK、Hadoop、Hive；不引入 Nessie、REST Catalog、Trino 或新的对象存储，Iceberg 继续用 HMS，数据落 HDFS；写入只走 Genesis 的 Spark SQL 节点。",{"type":23,"tag":50,"props":9010,"children":9012},{"id":9011},"版本怎么定",[9013],{"type":28,"value":9011},{"type":23,"tag":24,"props":9015,"children":9016},{},[9017],{"type":28,"value":9018},"Spark 保持 3.5.8 \u002F Scala 2.12 不动，跑在 JDK 8 和 YARN 离线队列上；Hadoop 3.3.6（HDFS HA \u002F YARN）和 HMS 3.1.3 也不变，HMS 同时给 Hudi 的表注册和 Iceberg 的 Hive Catalog 用。要换的只是两个 connector：",{"type":23,"tag":399,"props":9020,"children":9021},{},[9022,9035],{"type":23,"tag":403,"props":9023,"children":9024},{},[9025,9027,9033],{"type":28,"value":9026},"Hudi 选 ",{"type":23,"tag":99,"props":9028,"children":9030},{"className":9029},[],[9031],{"type":28,"value":9032},"hudi-spark3.5-bundle_2.12",{"type":28,"value":9034}," 的 1.2.0。当时的依据是它支持 Spark 3.5、Scala 2.12，并且能跑在 Java 8 上。Java 8 这一条后来被证伪了。",{"type":23,"tag":403,"props":9036,"children":9037},{},[9038,9040,9046],{"type":28,"value":9039},"Iceberg 选 ",{"type":23,"tag":99,"props":9041,"children":9043},{"className":9042},[],[9044],{"type":28,"value":9045},"iceberg-spark-runtime-3.5_2.12",{"type":28,"value":9047}," 的 1.6.1，因为它是仍兼容 Java 8 的最后一个维护版本，能避开 1.7 以后的 Java 11 门槛。",{"type":23,"tag":24,"props":9049,"children":9050},{},[9051,9053,9059,9061,9067,9068,9074,9076,9082],{"type":28,"value":9052},"版本清单给每个 artifact 记下 Maven Central 坐标、文件名、SHA-512 和下载源。部署脚本先校验 SHA-512，",{"type":23,"tag":99,"props":9054,"children":9056},{"className":9055},[],[9057],{"type":28,"value":9058},"latest",{"type":28,"value":9060}," 和没校验过的下载物一律不许用。坐标是 ",{"type":23,"tag":99,"props":9062,"children":9064},{"className":9063},[],[9065],{"type":28,"value":9066},"org.apache.hudi:hudi-spark3.5-bundle_2.12:1.2.0",{"type":28,"value":1148},{"type":23,"tag":99,"props":9069,"children":9071},{"className":9070},[],[9072],{"type":28,"value":9073},"org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.6.1",{"type":28,"value":9075},"，发布号固定为 ",{"type":23,"tag":99,"props":9077,"children":9079},{"className":9078},[],[9080],{"type":28,"value":9081},"hudi-1.2.0_iceberg-1.6.1",{"type":28,"value":9083},"，主机目录和 HDFS 路径都用它命名。",{"type":23,"tag":24,"props":9085,"children":9086},{},[9087],{"type":28,"value":9088},"Iceberg 停在 1.6.1，代价是放弃 1.7 以后的版本，换来这一期不动 JDK。动 JDK 就得重启正在服务的 Thrift Server。",{"type":23,"tag":24,"props":9090,"children":9091},{},[9092],{"type":28,"value":9093},"Hudi 还多一层风险：1.2.0 的默认表版本比 0.15.x 高。基础设施能回滚，数据格式不一定能：表一旦被写成新的 table version，退回 0.15.x 不保证还能读。所以 preflight 先盘点 Hudi 表的 table version 和 Iceberg 表的 format version；存量表只做只读兼容验证；会升级表版本的写入只在独立的验证表里做；切换前不许自动升级任何业务表。",{"type":23,"tag":50,"props":9095,"children":9097},{"id":9096},"spark_catalog-只能给一个",[9098],{"type":28,"value":9099},"spark_catalog 只能给一个",{"type":23,"tag":24,"props":9101,"children":9102},{},[9103,9105,9111,9113,9119,9121,9126],{"type":28,"value":9104},"Spark SQL 里的 catalog，可以理解成「表名该去哪儿解析」。不写 catalog 前缀的两段名 ",{"type":23,"tag":99,"props":9106,"children":9108},{"className":9107},[],[9109],{"type":28,"value":9110},"库.表",{"type":28,"value":9112},"，都归默认的 ",{"type":23,"tag":99,"props":9114,"children":9116},{"className":9115},[],[9117],{"type":28,"value":9118},"spark_catalog",{"type":28,"value":9120}," 管，而它只有一个。部署脚本管理的候选配置是这样的，地址类的值已经换成 ",{"type":23,"tag":99,"props":9122,"children":9124},{"className":9123},[],[9125],{"type":28,"value":8951},{"type":28,"value":445},{"type":23,"tag":2152,"props":9128,"children":9132},{"className":9129,"code":9130,"language":9131,"meta":8,"style":8},"language-properties shiki shiki-themes github-light github-dark","spark.sql.catalogImplementation      hive\nspark.sql.extensions                 org.apache.spark.sql.hudi.HoodieSparkSessionExtension,org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions\nspark.sql.catalog.spark_catalog      org.apache.spark.sql.hudi.catalog.HoodieCatalog\nspark.sql.catalog.iceberg            org.apache.iceberg.spark.SparkCatalog\nspark.sql.catalog.iceberg.type       hive\nspark.sql.catalog.iceberg.uri        \u003Credacted>\nspark.sql.catalog.iceberg.warehouse  \u003Credacted>\nspark.serializer                     org.apache.spark.serializer.KryoSerializer\nspark.kryo.registrator               org.apache.spark.HoodieSparkKryoRegistrar\nspark.yarn.jars                      \u003Credacted>\n","properties",[9133],{"type":23,"tag":99,"props":9134,"children":9135},{"__ignoreMap":8},[9136,9144,9152,9160,9168,9176,9184,9192,9200,9208],{"type":23,"tag":2161,"props":9137,"children":9138},{"class":2163,"line":2164},[9139],{"type":23,"tag":2161,"props":9140,"children":9141},{},[9142],{"type":28,"value":9143},"spark.sql.catalogImplementation      hive\n",{"type":23,"tag":2161,"props":9145,"children":9146},{"class":2163,"line":927},[9147],{"type":23,"tag":2161,"props":9148,"children":9149},{},[9150],{"type":28,"value":9151},"spark.sql.extensions                 org.apache.spark.sql.hudi.HoodieSparkSessionExtension,org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions\n",{"type":23,"tag":2161,"props":9153,"children":9154},{"class":2163,"line":924},[9155],{"type":23,"tag":2161,"props":9156,"children":9157},{},[9158],{"type":28,"value":9159},"spark.sql.catalog.spark_catalog      org.apache.spark.sql.hudi.catalog.HoodieCatalog\n",{"type":23,"tag":2161,"props":9161,"children":9162},{"class":2163,"line":2190},[9163],{"type":23,"tag":2161,"props":9164,"children":9165},{},[9166],{"type":28,"value":9167},"spark.sql.catalog.iceberg            org.apache.iceberg.spark.SparkCatalog\n",{"type":23,"tag":2161,"props":9169,"children":9170},{"class":2163,"line":2199},[9171],{"type":23,"tag":2161,"props":9172,"children":9173},{},[9174],{"type":28,"value":9175},"spark.sql.catalog.iceberg.type       hive\n",{"type":23,"tag":2161,"props":9177,"children":9178},{"class":2163,"line":2208},[9179],{"type":23,"tag":2161,"props":9180,"children":9181},{},[9182],{"type":28,"value":9183},"spark.sql.catalog.iceberg.uri        \u003Credacted>\n",{"type":23,"tag":2161,"props":9185,"children":9186},{"class":2163,"line":2217},[9187],{"type":23,"tag":2161,"props":9188,"children":9189},{},[9190],{"type":28,"value":9191},"spark.sql.catalog.iceberg.warehouse  \u003Credacted>\n",{"type":23,"tag":2161,"props":9193,"children":9194},{"class":2163,"line":2226},[9195],{"type":23,"tag":2161,"props":9196,"children":9197},{},[9198],{"type":28,"value":9199},"spark.serializer                     org.apache.spark.serializer.KryoSerializer\n",{"type":23,"tag":2161,"props":9201,"children":9202},{"class":2163,"line":2235},[9203],{"type":23,"tag":2161,"props":9204,"children":9205},{},[9206],{"type":28,"value":9207},"spark.kryo.registrator               org.apache.spark.HoodieSparkKryoRegistrar\n",{"type":23,"tag":2161,"props":9209,"children":9210},{"class":2163,"line":2244},[9211],{"type":23,"tag":2161,"props":9212,"children":9213},{},[9214],{"type":28,"value":9215},"spark.yarn.jars                      \u003Credacted>\n",{"type":23,"tag":24,"props":9217,"children":9218},{},[9219],{"type":23,"tag":65,"props":9220,"children":9223},{"alt":9221,"src":9222},"catalog 布局：Spark Thrift Server（主节点，Spark 3.5.8、Scala 2.12、JDK 8）下面挂两个 catalog；左边 spark_catalog 交给 HoodieCatalog，普通 Hive 表由它委托处理，同时开启完整的 Hudi SQL，用两段名，LOCATION 指向 HDFS 上的 Hudi 仓库目录；右边 iceberg 是独立的命名 catalog，SparkCatalog、type 为 hive，用三段名 iceberg.namespace.table，warehouse 指向 HDFS 上 Iceberg 专用目录；两者共用 Hive Metastore 3.1.3；spark.yarn.jars 指向以发布号命名的 HDFS JAR 目录","\u002Fimages\u002Fblog\u002Fgenesis-lakehouse\u002Fcatalog-layout.svg",[],{"type":23,"tag":24,"props":9225,"children":9226},{},[9227,9232,9234,9240,9242,9247,9249,9255],{"type":23,"tag":99,"props":9228,"children":9230},{"className":9229},[],[9231],{"type":28,"value":9118},{"type":28,"value":9233}," 交给 Hudi 的 ",{"type":23,"tag":99,"props":9235,"children":9237},{"className":9236},[],[9238],{"type":28,"value":9239},"HoodieCatalog",{"type":28,"value":9241},"：普通 Hive 表由它委托处理，同时开启完整的 Hudi SQL。原来挂在 ",{"type":23,"tag":99,"props":9243,"children":9245},{"className":9244},[],[9246],{"type":28,"value":9118},{"type":28,"value":9248}," 上的 Iceberg ",{"type":23,"tag":99,"props":9250,"children":9252},{"className":9251},[],[9253],{"type":28,"value":9254},"SparkSessionCatalog",{"type":28,"value":9256}," 包装不再保留。canary 里专门有一项验证普通 Hive 表还能查，防的就是 catalog 换了包装以后把存量表弄坏。",{"type":23,"tag":24,"props":9258,"children":9259},{},[9260,9262,9268,9270,9276,9278,9284,9286,9292],{"type":28,"value":9261},"Iceberg 用独立的命名 catalog ",{"type":23,"tag":99,"props":9263,"children":9265},{"className":9264},[],[9266],{"type":28,"value":9267},"iceberg",{"type":28,"value":9269},"，类型 ",{"type":23,"tag":99,"props":9271,"children":9273},{"className":9272},[],[9274],{"type":28,"value":9275},"hive",{"type":28,"value":9277},"，和 Hudi 共用一个 HMS，warehouse 指向 HDFS 上 Iceberg 专用的目录；Hudi 的库也建在 HMS 里，LOCATION 指向 HDFS 上的 Hudi 仓库目录。Kryo serializer 加 ",{"type":23,"tag":99,"props":9279,"children":9281},{"className":9280},[],[9282],{"type":28,"value":9283},"HoodieSparkKryoRegistrar",{"type":28,"value":9285}," 是 Hudi 官方要求的配置。",{"type":23,"tag":99,"props":9287,"children":9289},{"className":9288},[],[9290],{"type":28,"value":9291},"spark.yarn.jars",{"type":28,"value":9293}," 指向以发布号命名的 HDFS JAR 目录，换版本就是换路径。两个 extension 的顺序按设计要先在 canary 上验证再锁定；canary 还没跑到过 SQL 验证，所以顺序也还没验证。",{"type":23,"tag":24,"props":9295,"children":9296},{},[9297,9299,9304,9306,9312],{"type":28,"value":9298},"这么分，是因为 Hudi 的完整 SQL 要靠 ",{"type":23,"tag":99,"props":9300,"children":9302},{"className":9301},[],[9303],{"type":28,"value":9239},{"type":28,"value":9305}," 占住 session catalog，Iceberg 走命名 catalog 就够了。代价是 Iceberg 表永远要写三段名 ",{"type":23,"tag":99,"props":9307,"children":9309},{"className":9308},[],[9310],{"type":28,"value":9311},"iceberg.\u003Cnamespace>.\u003Ctable>",{"type":28,"value":9313},"，Hudi 表则和普通 Hive 表混在同一套两段名里。这一点直接影响了 Genesis 的代码。",{"type":23,"tag":50,"props":9315,"children":9317},{"id":9316},"genesis-这边改了什么",[9318],{"type":28,"value":9319},"Genesis 这边改了什么",{"type":23,"tag":399,"props":9321,"children":9322},{},[9323,9336,9365,9378,9383,9388],{"type":23,"tag":403,"props":9324,"children":9325},{},[9326,9328,9334],{"type":28,"value":9327},"后端正式加入 ",{"type":23,"tag":99,"props":9329,"children":9331},{"className":9330},[],[9332],{"type":28,"value":9333},"HUDI",{"type":28,"value":9335}," 引擎类型，抽出一个小的湖仓 SQL 方言 \u002F 标识符工具类，集中生成 namespace、table、column 的 SQL，不再往数据源服务里堆分支。",{"type":23,"tag":403,"props":9337,"children":9338},{},[9339,9341,9347,9349,9355,9357,9363],{"type":28,"value":9340},"Iceberg 元数据一律用三段名；Hudi 经 HMS 浏览，列表时读 ",{"type":23,"tag":99,"props":9342,"children":9344},{"className":9343},[],[9345],{"type":28,"value":9346},"DESCRIBE EXTENDED",{"type":28,"value":9348}," 的 ",{"type":23,"tag":99,"props":9350,"children":9352},{"className":9351},[],[9353],{"type":28,"value":9354},"Provider",{"type":28,"value":9356},"，只留 ",{"type":23,"tag":99,"props":9358,"children":9360},{"className":9359},[],[9361],{"type":28,"value":9362},"hudi",{"type":28,"value":9364},"，防止同库的 Hive、Iceberg 表串进来。",{"type":23,"tag":403,"props":9366,"children":9367},{},[9368,9370,9376],{"type":28,"value":9369},"动态标识符先过白名单 ",{"type":23,"tag":99,"props":9371,"children":9373},{"className":9372},[],[9374],{"type":28,"value":9375},"[A-Za-z0-9_-]+",{"type":28,"value":9377},"，反引号、分号、空白、SQL 注释和空段一律拒绝；值参数走 JDBC 参数化，连接密码不进日志。",{"type":23,"tag":403,"props":9379,"children":9380},{},[9381],{"type":28,"value":9382},"连接测试要过元数据探测，光 JDBC 能连上不算；接口出错返回能诊断的错误，不伪装成空列表。",{"type":23,"tag":403,"props":9384,"children":9385},{},[9386],{"type":28,"value":9387},"血缘解析保留 Iceberg 三段名，质量规则和报表按段引用；湖仓 SQL 节点发布时按节点记录的执行引擎选数据源，不许静默回落到 Hive。",{"type":23,"tag":403,"props":9389,"children":9390},{},[9391,9393,9398],{"type":28,"value":9392},"前端两种引擎都用 ",{"type":23,"tag":99,"props":9394,"children":9396},{"className":9395},[],[9397],{"type":28,"value":8648},{"type":28,"value":9399}," 拼 URL。光看协议分不出底层表格式，所以引擎由用户显式选。",{"type":23,"tag":24,"props":9401,"children":9402},{},[9403],{"type":28,"value":9404},"动集群之前，本地回归先跑完了：50 项部署脚本检查、36 个 smoke fixture、172 个后端测试、72 个前端测试都通过，后端编译、前端构建成功；前端 typecheck 的 175 条存量诊断逐条比对，零新增、零减少。这些代码都过了独立审查，但 Genesis 还没带着它上线，认证全链路验收排在集群切换之后。",{"type":23,"tag":50,"props":9406,"children":9408},{"id":9407},"七个节点怎么部署",[9409],{"type":28,"value":9407},{"type":23,"tag":24,"props":9411,"children":9412},{},[9413],{"type":28,"value":9414},"主节点 1 台，跑 Spark driver（也就是 Thrift Server），同时是 HDFS、YARN、HMS 的控制主机；计算节点 6 台，跑 YARN NodeManager，executor 在这上面运行。HDFS 是 HA 部署，存活 DataNode 的基线是 4 个。",{"type":23,"tag":24,"props":9416,"children":9417},{},[9418],{"type":28,"value":9419},"部署分两层。一层是静态版本：七个节点各放一份以发布号命名的只读版本目录，SHA-512 必须一致，主节点的 Spark driver 经受控软链接加载它。另一层是 YARN 执行：完整的 Spark 依赖加两个 runtime JAR 发布到带版本的 HDFS 路径，YARN 容器启动时从 HDFS 把依赖拉到本地，不依赖计算节点上未必存在的本地 Spark 目录。",{"type":23,"tag":24,"props":9421,"children":9422},{},[9423],{"type":28,"value":9424},"HDFS 上的发布这样构建：把现有依赖集拷进新路径，只在新路径里删掉旧 connector，上传两个校验过的目标 JAR，再断言每种格式恰好一个 runtime。preflight 发现同一个 artifact 有多个版本，就直接失败。",{"type":23,"tag":24,"props":9426,"children":9427},{},[9428,9430,9436],{"type":28,"value":9429},"光看主节点上的文件，证明不了七个节点都没问题。验收要证明：六个 NodeManager 在线，HDFS runtime 路径里只有目标版本，Spark 应用申请到了 executor，并且 executor 能完成两种格式的分布式读写。验证 SQL 用 ",{"type":23,"tag":99,"props":9431,"children":9433},{"className":9432},[],[9434],{"type":28,"value":9435},"REPARTITION(12)",{"type":28,"value":9437}," 做分布式聚合，保证活真的落在 executor 上，光 driver 本地成功不算。",{"type":23,"tag":50,"props":9439,"children":9441},{"id":9440},"四段式上线",[9442],{"type":28,"value":9440},{"type":23,"tag":24,"props":9444,"children":9445},{},[9446,9448,9454],{"type":28,"value":9447},"改集群的操作只能从 ",{"type":23,"tag":99,"props":9449,"children":9451},{"className":9450},[],[9452],{"type":28,"value":9453},"deploy.sh … lakehouse \u003Caction>",{"type":28,"value":9455}," 进，action 有 preflight、canary、deploy、verify、status、rollback。preflight 和 status 只读，从开发机发起、在主节点上远程探测。以前 status 是在开发机本地查端口，会把本机端口不通误判成集群故障。",{"type":23,"tag":24,"props":9457,"children":9458},{},[9459],{"type":28,"value":9460},"canary 就是「金丝雀」：先在旁边单独起一份新版本的服务，只拿验证数据试，确认没问题再动正式服务。",{"type":23,"tag":24,"props":9462,"children":9463},{},[9464],{"type":23,"tag":65,"props":9465,"children":9468},{"alt":9466,"src":9467},"四段式上线流程：Preflight 只读检查七节点、HDFS HA 和 HMS、六个 NodeManager、canary 端口、表版本，不健康就 fail closed；Stage 校验官方 SHA-512、分发七个节点并复核、构建版本化的 HDFS JAR 目录、备份原配置，同一发布号已存在但内容不同就失败；Canary 在空闲端口起独立 Thrift，只在专用验证库建表，验证 Hudi、Iceberg 和普通 Hive 表，任一步失败就停 canary、留证据、拒绝切换，标注到写这篇时五次 canary 都没过；Cutover 停旧应用、原子切换软链接与 HDFS JAR 路径和配置、仍以 JDK 8 启动后复验，验证失败自动进入 Rollback，只恢复同批次备份、重启旧应用、复验旧表","\u002Fimages\u002Fblog\u002Fgenesis-lakehouse\u002Frollout-stages.svg",[],{"type":23,"tag":533,"props":9470,"children":9471},{},[9472,9493],{"type":23,"tag":537,"props":9473,"children":9474},{},[9475],{"type":23,"tag":541,"props":9476,"children":9477},{},[9478,9483,9488],{"type":23,"tag":545,"props":9479,"children":9480},{},[9481],{"type":28,"value":9482},"阶段",{"type":23,"tag":545,"props":9484,"children":9485},{},[9486],{"type":28,"value":9487},"做什么",{"type":23,"tag":545,"props":9489,"children":9490},{},[9491],{"type":28,"value":9492},"失败时",{"type":23,"tag":561,"props":9494,"children":9495},{},[9496,9514,9540,9558,9576],{"type":23,"tag":541,"props":9497,"children":9498},{},[9499,9504,9509],{"type":23,"tag":568,"props":9500,"children":9501},{},[9502],{"type":28,"value":9503},"Preflight（只读）",{"type":23,"tag":568,"props":9505,"children":9506},{},[9507],{"type":28,"value":9508},"七节点 SSH、磁盘、JDK 8；HDFS HA、六个 NodeManager、HMS，canary 端口空闲；记录现有配置、进程、YARN 应用、JAR 与 SHA-512；盘点表版本",{"type":23,"tag":568,"props":9510,"children":9511},{},[9512],{"type":28,"value":9513},"同一 artifact 多版本、NodeManager 不全、HDFS\u002FHMS 不健康或备份失败，一律 fail closed",{"type":23,"tag":541,"props":9515,"children":9516},{},[9517,9522,9535],{"type":23,"tag":568,"props":9518,"children":9519},{},[9520],{"type":28,"value":9521},"Stage",{"type":23,"tag":568,"props":9523,"children":9524},{},[9525,9527,9533],{"type":28,"value":9526},"下载并校验官方 SHA-512；分发七个节点、逐节点复核；构建版本化 HDFS JAR 目录；生成候选 ",{"type":23,"tag":99,"props":9528,"children":9530},{"className":9529},[],[9531],{"type":28,"value":9532},"spark-defaults.conf",{"type":28,"value":9534},"，原文件连同权限、属主、时间戳备份",{"type":23,"tag":568,"props":9536,"children":9537},{},[9538],{"type":28,"value":9539},"同一发布号已存在但内容不同即失败，不覆盖",{"type":23,"tag":541,"props":9541,"children":9542},{},[9543,9548,9553],{"type":23,"tag":568,"props":9544,"children":9545},{},[9546],{"type":28,"value":9547},"Canary",{"type":23,"tag":568,"props":9549,"children":9550},{},[9551],{"type":28,"value":9552},"在空闲端口起独立 Thrift 应用，用候选配置和 JAR；只在专用验证库建表；验证 Hudi 的 CRUD\u002FMERGE\u002F时间线、Iceberg 的 CRUD\u002F快照\u002Ftime travel、普通 Hive 表可查、分布式查询",{"type":23,"tag":568,"props":9554,"children":9555},{},[9556],{"type":28,"value":9557},"任一步失败即停 canary、留证据、拒绝切换",{"type":23,"tag":541,"props":9559,"children":9560},{},[9561,9566,9571],{"type":23,"tag":568,"props":9562,"children":9563},{},[9564],{"type":28,"value":9565},"Cutover",{"type":23,"tag":568,"props":9567,"children":9568},{},[9569],{"type":28,"value":9570},"停旧 Thrift 应用；原子切换 runtime 软链接、HDFS JAR 路径和配置；仍以 JDK 8、离线队列启动；探活后跑同一套验证，再开放 Genesis 连接测试",{"type":23,"tag":568,"props":9572,"children":9573},{},[9574],{"type":28,"value":9575},"验证失败自动回滚",{"type":23,"tag":541,"props":9577,"children":9578},{},[9579,9584,9589],{"type":23,"tag":568,"props":9580,"children":9581},{},[9582],{"type":28,"value":9583},"Rollback",{"type":23,"tag":568,"props":9585,"children":9586},{},[9587],{"type":28,"value":9588},"只恢复同批次备份，重启旧应用，复验普通 Hive 和旧 Hudi\u002FIceberg 表",{"type":23,"tag":568,"props":9590,"children":9591},{},[9592],{"type":28,"value":9593},"不删新格式验证数据",{"type":23,"tag":24,"props":9595,"children":9596},{},[9597],{"type":28,"value":9598},"表里的 fail closed 意思是：拿不准就当失败处理，宁可停下也不放行。",{"type":23,"tag":24,"props":9600,"children":9601},{},[9602,9604,9609,9611,9617],{"type":28,"value":9603},"有几条约束贯穿全程。canary 和正式服务各用一组端口并存，canary 失败只停 canary。停正式服务之前，旧 Spark 路径、配置、JAR 列表与校验和、启动命令、YARN 应用 ID、属主和权限，先记进不可变的批次状态。健康不看 PID，要等端口、YARN 应用状态和 Beeline ",{"type":23,"tag":99,"props":9605,"children":9607},{"className":9606},[],[9608],{"type":28,"value":1893},{"type":28,"value":9610}," 都通过。关键步骤不许用 ",{"type":23,"tag":99,"props":9612,"children":9614},{"className":9613},[],[9615],{"type":28,"value":9616},"|| true",{"type":28,"value":9618}," 吞错。",{"type":23,"tag":50,"props":9620,"children":9622},{"id":9621},"canary-拦下了什么",[9623],{"type":28,"value":9624},"canary 拦下了什么",{"type":23,"tag":24,"props":9626,"children":9627},{},[9628],{"type":28,"value":9629},"先说结果：到写这篇的时候，没有一次 canary 是绿的，正式切换和 Genesis 上线都没发生。",{"type":23,"tag":24,"props":9631,"children":9632},{},[9633,9635,9641,9643,9648],{"type":28,"value":9634},"失败都止于 canary，正式服务的进程和端口没受影响。靠的是端口隔离、切换前不动正式配置、发布只读封存，以及失败后清理候选。对正式服务唯一的副作用，是第四次覆盖了它的 PID 记录文件，后面细说。失败后的只读检查里，正式端口的 SQL 一直返回 ",{"type":23,"tag":99,"props":9636,"children":9638},{"className":9637},[],[9639],{"type":28,"value":9640},"1 \u002F 12 \u002F 12",{"type":28,"value":9642},"，也就是 ",{"type":23,"tag":99,"props":9644,"children":9646},{"className":9645},[],[9647],{"type":28,"value":1893},{"type":28,"value":9649}," 加两张旧演示表（Hudi、Iceberg 各一张）各 12 行。",{"type":23,"tag":24,"props":9651,"children":9652},{},[9653],{"type":23,"tag":65,"props":9654,"children":9657},{"alt":9655,"src":9656},"五次 canary 各停在哪一步的格子图，列是制品 manifest 校验、HDFS 构建、Thrift 启动、SQL 验证与 executor：9 月 5 日第一次停在 manifest 校验，临时 manifest 没留，这一次定不了因；第二次也停在 manifest 校验，两个目录期望 555 实际 2555（SGID）；第三次 manifest 通过，停在 HDFS 构建，HDFS 上发布目录的父链从未创建；第四次前两步通过，停在 Thrift 启动，绑正式端口失败退出但 YARN 报成功；9 月 9 日复用已封存的发布，前两步通过，停在 Thrift 启动，class 55 跑在只认 52 的 Java 8 上；SQL 验证一次都没跑到","\u002Fimages\u002Fblog\u002Fgenesis-lakehouse\u002Fcanary-attempts.svg",[],{"type":23,"tag":533,"props":9659,"children":9660},{},[9661,9687],{"type":23,"tag":537,"props":9662,"children":9663},{},[9664],{"type":23,"tag":541,"props":9665,"children":9666},{},[9667,9672,9677,9682],{"type":23,"tag":545,"props":9668,"children":9669},{},[9670],{"type":28,"value":9671},"时间",{"type":23,"tag":545,"props":9673,"children":9674},{},[9675],{"type":28,"value":9676},"停在哪一步",{"type":23,"tag":545,"props":9678,"children":9679},{},[9680],{"type":28,"value":9681},"原因",{"type":23,"tag":545,"props":9683,"children":9684},{},[9685],{"type":28,"value":9686},"处理",{"type":23,"tag":561,"props":9688,"children":9689},{},[9690,9713,9768,9799,9828],{"type":23,"tag":541,"props":9691,"children":9692},{},[9693,9698,9703,9708],{"type":23,"tag":568,"props":9694,"children":9695},{},[9696],{"type":28,"value":9697},"9 月 5 日，第一次",{"type":23,"tag":568,"props":9699,"children":9700},{},[9701],{"type":28,"value":9702},"主节点候选目录的 manifest 校验",{"type":23,"tag":568,"props":9704,"children":9705},{},[9706],{"type":28,"value":9707},"没保留临时 manifest，原因无法仅凭这一次证明；另发现一个孤儿心跳占着协调租约",{"type":23,"tag":568,"props":9709,"children":9710},{},[9711],{"type":28,"value":9712},"补精确的 manifest 差异诊断；经统一入口做一次性租约恢复",{"type":23,"tag":541,"props":9714,"children":9715},{},[9716,9721,9726,9763],{"type":23,"tag":568,"props":9717,"children":9718},{},[9719],{"type":28,"value":9720},"9 月 5 日，第二次",{"type":23,"tag":568,"props":9722,"children":9723},{},[9724],{"type":28,"value":9725},"候选目录的 manifest 比对",{"type":23,"tag":568,"props":9727,"children":9728},{},[9729,9731,9737,9739,9745,9747,9753,9755,9761],{"type":28,"value":9730},"两个新建目录期望 ",{"type":23,"tag":99,"props":9732,"children":9734},{"className":9733},[],[9735],{"type":28,"value":9736},"555",{"type":28,"value":9738},"、实际 ",{"type":23,"tag":99,"props":9740,"children":9742},{"className":9741},[],[9743],{"type":28,"value":9744},"2555",{"type":28,"value":9746},"：从 ",{"type":23,"tag":99,"props":9748,"children":9750},{"className":9749},[],[9751],{"type":28,"value":9752},"2775",{"type":28,"value":9754}," 的共享父目录继承了 SGID，",{"type":23,"tag":99,"props":9756,"children":9758},{"className":9757},[],[9759],{"type":28,"value":9760},"install -d -m 0755",{"type":28,"value":9762}," 和之后去写位都没清掉",{"type":23,"tag":568,"props":9764,"children":9765},{},[9766],{"type":28,"value":9767},"只对这两个新目录清 SGID，不动共享父目录",{"type":23,"tag":541,"props":9769,"children":9770},{},[9771,9776,9781,9786],{"type":23,"tag":568,"props":9772,"children":9773},{},[9774],{"type":28,"value":9775},"9 月 5 日，第三次",{"type":23,"tag":568,"props":9777,"children":9778},{},[9779],{"type":28,"value":9780},"HDFS 构建",{"type":23,"tag":568,"props":9782,"children":9783},{},[9784],{"type":28,"value":9785},"七节点 finalize 通过，SGID 修复生效；但 HDFS 上发布目录的父链从未创建",{"type":23,"tag":568,"props":9787,"children":9788},{},[9789,9791,9797],{"type":28,"value":9790},"只用 ",{"type":23,"tag":99,"props":9792,"children":9794},{"className":9793},[],[9795],{"type":28,"value":9796},"mkdir -p",{"type":28,"value":9798}," 建必需的父链，临时叶子目录仍独占创建",{"type":23,"tag":541,"props":9800,"children":9801},{},[9802,9807,9812,9823],{"type":23,"tag":568,"props":9803,"children":9804},{},[9805],{"type":28,"value":9806},"9 月 5 日，第四次",{"type":23,"tag":568,"props":9808,"children":9809},{},[9810],{"type":28,"value":9811},"新 Thrift 应用启动",{"type":23,"tag":568,"props":9813,"children":9814},{},[9815,9817],{"type":28,"value":9816},"staging 全部通过；候选 driver 去绑已被占用的正式端口失败后退出，YARN 却报 ",{"type":23,"tag":99,"props":9818,"children":9820},{"className":9819},[],[9821],{"type":28,"value":9822},"FINISHED\u002FSUCCEEDED",{"type":23,"tag":568,"props":9824,"children":9825},{},[9826],{"type":28,"value":9827},"启动隔离设计，见下一节",{"type":23,"tag":541,"props":9829,"children":9830},{},[9831,9836,9841,9852],{"type":23,"tag":568,"props":9832,"children":9833},{},[9834],{"type":28,"value":9835},"9 月 9 日",{"type":23,"tag":568,"props":9837,"children":9838},{},[9839],{"type":28,"value":9840},"Thrift JVM 启动",{"type":23,"tag":568,"props":9842,"children":9843},{},[9844,9850],{"type":23,"tag":99,"props":9845,"children":9847},{"className":9846},[],[9848],{"type":28,"value":9849},"UnsupportedClassVersionError",{"type":28,"value":9851},"：Hudi 1.2.0 的类是 class file 55（Java 11），运行时只认到 52（Java 8）",{"type":23,"tag":568,"props":9853,"children":9854},{},[9855],{"type":28,"value":9856},"发布本身的阻塞，需要对 JVM 做决定",{"type":23,"tag":24,"props":9858,"children":9859},{},[9860,9862,9867,9869,9874],{"type":28,"value":9861},"第二次那个 SGID 是目录上的一个权限位，设了它，目录里新建的子目录会继承父目录的属组和这个位本身，所以权限从期望的 ",{"type":23,"tag":99,"props":9863,"children":9865},{"className":9864},[],[9866],{"type":28,"value":9736},{"type":28,"value":9868}," 变成了 ",{"type":23,"tag":99,"props":9870,"children":9872},{"className":9871},[],[9873],{"type":28,"value":9744},{"type":28,"value":287},{"type":23,"tag":24,"props":9876,"children":9877},{},[9878],{"type":28,"value":9879},"第四次那个应用不到十秒就结束了，YARN 照样报成功。一个终态、一个监听端口、一个 PID 文件，单拿出来都证明不了服务可用，验收得落到 JDBC 结果、真实的 UI\u002FAPI 身份和 executor 上。",{"type":23,"tag":24,"props":9881,"children":9882},{},[9883,9885,9890],{"type":28,"value":9884},"9 月 9 日那个 ",{"type":23,"tag":99,"props":9886,"children":9888},{"className":9887},[],[9889],{"type":28,"value":9849},{"type":28,"value":9891}," 本可以更早发现。Java 的 class 文件头里写着编译它的版本号，Java 8 对应 52，Java 11 对应 55，低版本 JVM 加载高版本的类就会报这个错。SHA-512 只能证明拿到的是那个文件，证明不了它能被 Java 8 加载；stage 阶段读一下 JAR 里 class 文件的主版本号，分发到七个节点之前就能发现。设计里明确写着这一期不升级 JDK，最后卡住的偏偏就是 JDK。",{"type":23,"tag":24,"props":9893,"children":9894},{},[9895],{"type":28,"value":9896},"确实通过的有三项：",{"type":23,"tag":399,"props":9898,"children":9899},{},[9900,9920,9925],{"type":23,"tag":403,"props":9901,"children":9902},{},[9903,9905,9910,9912,9918],{"type":28,"value":9904},"七个节点的制品一致。第四次 canary 期间独立 SSH 复核，七个节点 14 个 artifact 的 SHA-512 加主节点两份 driver 副本，全部和固定清单一致，目录 ",{"type":23,"tag":99,"props":9906,"children":9908},{"className":9907},[],[9909],{"type":28,"value":9736},{"type":28,"value":9911},"、connector 文件 ",{"type":23,"tag":99,"props":9913,"children":9915},{"className":9914},[],[9916],{"type":28,"value":9917},"444",{"type":28,"value":9919},"。不过这只说明主机上的制品一致，算不上运行时验收。",{"type":23,"tag":403,"props":9921,"children":9922},{},[9923],{"type":28,"value":9924},"HDFS 构建和提升，从第四次起通过；9 月 9 日复用已封存的发布，六个计算节点和 HDFS 的 staging 都通过。",{"type":23,"tag":403,"props":9926,"children":9927},{},[9928],{"type":28,"value":9929},"Preflight，9 月 9 日通过，两条告警正是预期的漂移：集群在跑 Hudi 0.15.0 和 Iceberg 1.5.2，目标是 1.2.0 和 1.6.1。",{"type":23,"tag":24,"props":9931,"children":9932},{},[9933],{"type":28,"value":9934},"还没有证据的：canary 里的 Hudi\u002FIceberg CRUD、时间线、快照、time travel 和 executor 分配一次都没跑到；extension 顺序没验证；没切换过，也就没有回滚的实战证据；Genesis 认证全链路验收还没开始。",{"type":23,"tag":50,"props":9936,"children":9938},{"id":9937},"第四次之后补的启动隔离",[9939],{"type":28,"value":9937},{"type":23,"tag":24,"props":9941,"children":9942},{},[9943],{"type":28,"value":9944},"第四次暴露了启动链上的四个问题：",{"type":23,"tag":890,"props":9946,"children":9947},{},[9948,9969,9982,9987],{"type":23,"tag":403,"props":9949,"children":9950},{},[9951,9953,9959,9961,9967],{"type":28,"value":9952},"从候选发布拷来的 ",{"type":23,"tag":99,"props":9954,"children":9956},{"className":9955},[],[9957],{"type":28,"value":9958},"spark-env.sh",{"type":28,"value":9960}," 无条件把 ",{"type":23,"tag":99,"props":9962,"children":9964},{"className":9963},[],[9965],{"type":28,"value":9966},"SPARK_HOME",{"type":28,"value":9968},"、日志和 PID 目录设回旧安装；",{"type":23,"tag":403,"props":9970,"children":9971},{},[9972,9974,9980],{"type":28,"value":9973},"候选和旧的 ",{"type":23,"tag":99,"props":9975,"children":9977},{"className":9976},[],[9978],{"type":28,"value":9979},"hive-site.xml",{"type":28,"value":9981}," 都写着正式端口，canary 的端口覆盖为什么没生效，当时没查清；",{"type":23,"tag":403,"props":9983,"children":9984},{},[9985],{"type":28,"value":9986},"canary 的 PID 文件是空的，校验脚本却没中止；",{"type":23,"tag":403,"props":9988,"children":9989},{},[9990],{"type":28,"value":9991},"候选进程还把旧服务的 PID 文件覆盖成了自己那个已经退出的 PID。",{"type":23,"tag":24,"props":9993,"children":9994},{},[9995],{"type":28,"value":9996},"空 PID 那条一行就能复现，它会打印出「继续执行」的标记：",{"type":23,"tag":2152,"props":9998,"children":10000},{"className":5795,"code":9999,"language":5797,"meta":8,"style":8},"bash -c 'set -euo pipefail; pid=; test -n \"$pid\" && kill -0 \"$pid\"; printf \"EMPTY_PID_CHECK_CONTINUED\\n\"'\n",[10001],{"type":23,"tag":99,"props":10002,"children":10003},{"__ignoreMap":8},[10004],{"type":23,"tag":2161,"props":10005,"children":10006},{"class":2163,"line":2164},[10007,10011,10016],{"type":23,"tag":2161,"props":10008,"children":10009},{"style":5824},[10010],{"type":28,"value":5797},{"type":23,"tag":2161,"props":10012,"children":10013},{"style":5844},[10014],{"type":28,"value":10015}," -c",{"type":23,"tag":2161,"props":10017,"children":10018},{"style":5855},[10019],{"type":28,"value":10020}," 'set -euo pipefail; pid=; test -n \"$pid\" && kill -0 \"$pid\"; printf \"EMPTY_PID_CHECK_CONTINUED\\n\"'\n",{"type":23,"tag":24,"props":10022,"children":10023},{},[10024,10030,10032,10038,10040,10046,10048,10054,10056,10061,10063,10069],{"type":23,"tag":99,"props":10025,"children":10027},{"className":10026},[],[10028],{"type":28,"value":10029},"set -e",{"type":28,"value":10031},"（errexit）的本意是任何命令失败就退出脚本，但它会豁免 ",{"type":23,"tag":99,"props":10033,"children":10035},{"className":10034},[],[10036],{"type":28,"value":10037},"&&",{"type":28,"value":10039}," 列表里非最后一项的失败。上面 ",{"type":23,"tag":99,"props":10041,"children":10043},{"className":10042},[],[10044],{"type":28,"value":10045},"test -n \"$pid\"",{"type":28,"value":10047}," 失败了，脚本照样往下走，这种写法只检查了最后一项。生命周期脚本里所有处在语句位置、失败会放行的 AND-list，后来都拆成了独立语句，一共 28 处。其中两处用了 shell 的 ",{"type":23,"tag":99,"props":10049,"children":10051},{"className":10050},[],[10052],{"type":28,"value":10053},"!",{"type":28,"value":10055}," 取反，而 errexit 同样豁免被 ",{"type":23,"tag":99,"props":10057,"children":10059},{"className":10058},[],[10060],{"type":28,"value":10053},{"type":28,"value":10062}," 取反的命令，光拆开还是不中止，于是改用 ",{"type":23,"tag":99,"props":10064,"children":10066},{"className":10065},[],[10067],{"type":28,"value":10068},"test",{"type":28,"value":10070}," 自带的取反。",{"type":23,"tag":24,"props":10072,"children":10073},{},[10074],{"type":28,"value":10075},"补救的前提是不改已经封存的发布内容、canary 期间不打扰正式服务。设计分五块：",{"type":23,"tag":399,"props":10077,"children":10078},{},[10079,10098,10103,10108,10113],{"type":23,"tag":403,"props":10080,"children":10081},{},[10082,10084,10089,10091,10096],{"type":28,"value":10083},"受控启动配置。每个角色在批次目录下有私有配置目录，只拷审计过的必需配置；",{"type":23,"tag":99,"props":10085,"children":10087},{"className":10086},[],[10088],{"type":28,"value":9958},{"type":28,"value":10090}," 换成生成的受管设置，旧的环境脚本永远不执行；不支持的链接、特殊文件、逃逸路径和认不出来的启动覆盖一律拒绝，必需配置也不许悄悄丢掉。canary 和正式之间只允许端口不同，端口由角色派生、和命令行参数一致，还专门拿写着正式端口的 ",{"type":23,"tag":99,"props":10092,"children":10094},{"className":10093},[],[10095],{"type":28,"value":9979},{"type":28,"value":10097}," 做了冲突测试；验收看真实启动链加载出来的环境和实际监听，光看生成的字符串不算。发布摘要、模板摘要、批次配置清单和验证协议标识封存成带版本的 profile，任何一项变了，之前的绿色标记就作废。",{"type":23,"tag":403,"props":10099,"children":10100},{},[10101],{"type":28,"value":10102},"启动身份。记 PID 之前，要求恰好一个正十进制 PID、活着的非僵尸进程、启动时刻、精确的应用名和候选 Spark\u002FJDK 身份；启动前先记下启动意图，进程早退也不会让清理误伤旧服务；清理只停确认属于本批次的进程，归属不明就失败、留证据。SIGTERM 发给 pidfd 钉住的进程句柄（pidfd 是 Linux 给进程开的文件描述符，进程退出后数字 PID 被复用也不会认错人），不支持 pidfd 就 fail closed，不回退到数字 PID。健康要求 PID 和端口一致、YARN 应用 RUNNING、JDBC 成功，并拿到真实的 Spark HTTP\u002FAPI 身份。",{"type":23,"tag":403,"props":10104,"children":10105},{},[10106],{"type":28,"value":10107},"快照与回滚。独立配置目录纳入快照、恢复、重启和接管的全过程；快照 schema 精确校验，旧快照缺字段不能当成「该设置不存在」，不支持的旧快照在 STOP 之前就失败；回滚从封存的旧快照重建私有配置，不把候选设置套到旧服务上。旧服务的 Spark UI 经 YARN 代理本来就打不开，回滚验收如实记为降级，也不借机去改全局 YARN 配置。",{"type":23,"tag":403,"props":10109,"children":10110},{},[10111],{"type":28,"value":10112},"PID 记账修复。单独的 helper 加一个五参数的 action（失败批次、过期 PID、在线 PID、启动时刻、应用 ID）。它不停、不起、不杀任何服务，只允许改旧服务那一个 PID 文件：确认两个正式端口属于同一个进程，逐级校验路径，拒绝软链接、硬链接和特殊文件，先写持久化的 before 记录，替换前再复核一次，然后原子替换，保留原属主和权限。",{"type":23,"tag":403,"props":10114,"children":10115},{},[10116],{"type":28,"value":10117},"验证纪律。TDD，用真实生成的远程命令和忠实的启动链做 fixture；先规格审查、后质量审查，两道都过了才允许线上修复或重试。",{"type":23,"tag":24,"props":10119,"children":10120},{},[10121],{"type":28,"value":10122},"实现里最有价值的，是去量测试到底能不能发现错误。办法是变异测试：故意把代码里的检查改坏，看测试会不会因此变红；不变红，就说明这条检查没有测试在守。",{"type":23,"tag":399,"props":10124,"children":10125},{},[10126,10139,10159],{"type":23,"tag":403,"props":10127,"children":10128},{},[10129,10131,10137],{"type":28,"value":10130},"启动助手有 183 个 ",{"type":23,"tag":99,"props":10132,"children":10134},{"className":10133},[],[10135],{"type":28,"value":10136},"require",{"type":28,"value":10138}," 守卫，逐个换成恒真，一开始换掉 132 个测试依旧全绿；补完测试后 180 个能被杀掉，剩下 3 个是被更早的守卫覆盖、永远走不到的等价变异体，在原处注释后刻意保留。",{"type":23,"tag":403,"props":10140,"children":10141},{},[10142,10144,10149,10151,10157],{"type":28,"value":10143},"PID 修复助手按 ",{"type":23,"tag":99,"props":10145,"children":10147},{"className":10146},[],[10148],{"type":28,"value":10136},{"type":28,"value":10150}," 计数是 37\u002F37，改成逐个合取项、",{"type":23,"tag":99,"props":10152,"children":10154},{"className":10153},[],[10155],{"type":28,"value":10156},"if",{"type":28,"value":10158}," 和异常处理去变异，实际是 55\u002F61，六个幸存者逐一写明了原因。计数口径本身也会骗人。",{"type":23,"tag":403,"props":10160,"children":10161},{},[10162],{"type":28,"value":10163},"生成的修复命令有 105,477 字节，离内核单参数上限 131,072 字节不远，于是加了长度回归，免得它第一次以 E2BIG（参数过长）的样子出现在生产主机上。",{"type":23,"tag":24,"props":10165,"children":10166},{},[10167,10169,10175,10177,10183,10185,10191,10193,10199,10201,10207,10209,10214,10216,10221,10222,10227,10228,10234,10235,10240,10242,10247],{"type":28,"value":10168},"放宽权限检查也踩了坑。PID 文件实际是 ",{"type":23,"tag":99,"props":10170,"children":10172},{"className":10171},[],[10173],{"type":28,"value":10174},"664",{"type":28,"value":10176},"、目录 ",{"type":23,"tag":99,"props":10178,"children":10180},{"className":10179},[],[10181],{"type":28,"value":10182},"775",{"type":28,"value":10184},"，是守护进程在 umask 002 下的正常产物，原来不许组写的规则会拒绝它们。第一版放宽被两路审查各自独立推翻：有 POSIX ACL 时，",{"type":23,"tag":99,"props":10186,"children":10188},{"className":10187},[],[10189],{"type":28,"value":10190},"st_mode",{"type":28,"value":10192}," 里的组权限位显示的其实是 ACL mask，给 ",{"type":23,"tag":99,"props":10194,"children":10196},{"className":10195},[],[10197],{"type":28,"value":10198},"644",{"type":28,"value":10200}," 文件加一条具名用户 ACL，不用 ",{"type":23,"tag":99,"props":10202,"children":10204},{"className":10203},[],[10205],{"type":28,"value":10206},"chmod",{"type":28,"value":10208}," 也会显示成 ",{"type":23,"tag":99,"props":10210,"children":10212},{"className":10211},[],[10213],{"type":28,"value":10174},{"type":28,"value":10215},"。最终的规则只接受文件 ",{"type":23,"tag":99,"props":10217,"children":10219},{"className":10218},[],[10220],{"type":28,"value":10198},{"type":28,"value":7429},{"type":23,"tag":99,"props":10223,"children":10225},{"className":10224},[],[10226],{"type":28,"value":10174},{"type":28,"value":10176},{"type":23,"tag":99,"props":10229,"children":10231},{"className":10230},[],[10232],{"type":28,"value":10233},"755",{"type":28,"value":7429},{"type":23,"tag":99,"props":10236,"children":10238},{"className":10237},[],[10239],{"type":28,"value":10182},{"type":28,"value":10241},"、更上层 ",{"type":23,"tag":99,"props":10243,"children":10245},{"className":10244},[],[10246],{"type":28,"value":10233},{"type":28,"value":10248},"；允许组写时直接读 ACL，存在访问 ACL 或默认 ACL 都拒绝，读不到也拒绝。",{"type":23,"tag":24,"props":10250,"children":10251},{},[10252,10254,10259],{"type":28,"value":10253},"摘要校验原来的 awk 写法，在 Debian 12、Ubuntu 22.04 默认的 mawk 上会把每个合法摘要都判成非法，只因实测的集群节点装的是 gawk 才没出事，后来改写去掉了这个依赖。SGID 继承、HDFS 首装缺父目录、errexit 对 AND-list 和 ",{"type":23,"tag":99,"props":10255,"children":10257},{"className":10256},[],[10258],{"type":28,"value":10053},{"type":28,"value":10260}," 的豁免、ACL mask，这些坑都是线上 canary、真实命令回归或独立审查才暴露的。",{"type":23,"tag":24,"props":10262,"children":10263},{},[10264,10266,10272],{"type":28,"value":10265},"9 月 9 日，修复经统一入口执行了一次，输出 ",{"type":23,"tag":99,"props":10267,"children":10269},{"className":10268},[],[10270],{"type":28,"value":10271},"REPAIRED",{"type":28,"value":10273},"、退出码 0。输出之外我又独立复核了一遍：PID 文件指向在线进程，属主、权限没变，链接数 1，不是软链接，没有 ACL；inode 变了，说明是原子替换，没有原地改写；守护进程和启动时刻没变，两个正式端口还是它的，没有任何东西被停止、启动或者收到信号。同目录还有一个早先以另一身份运行留下的过期 PID 文件，不在这次范围内，只记录，没删。",{"type":23,"tag":24,"props":10275,"children":10276},{},[10277,10279,10285],{"type":28,"value":10278},"随后的 canary 就是表里 9 月 9 日那一行。这次失败是干净的：正式服务的 PID 文件、进程、启动时刻和两个端口都没变；canary 端口没有监听，YARN 没有孤儿应用，租约已释放，批次标成 ",{"type":23,"tag":99,"props":10280,"children":10282},{"className":10281},[],[10283],{"type":28,"value":10284},"FAILED",{"type":28,"value":10286},"，运行目录和日志都保留；没有尝试切换，也没有覆盖封存的发布。它证明了失败路径上的隔离和清理按设计工作，但成功路径上的健康判定、SQL 验证和 executor 还是没验证到。",{"type":23,"tag":50,"props":10288,"children":10290},{"id":10289},"接下来卡在-jvm-上",[10291],{"type":28,"value":10292},"接下来卡在 JVM 上",{"type":23,"tag":24,"props":10294,"children":10295},{},[10296],{"type":28,"value":10297},"到写这篇的时候，正式服务仍是 Hudi 0.15.0 加 Iceberg 1.5.2，Genesis 这边的代码已经就绪，但没上线。往下走得先对 JVM 做决定：正在服务的 Thrift Server 是 Java 8 进程，主节点上虽然装了 Java 11 和 21，可换 JVM 就意味着要重启这个项目一直在保护的那个服务。",{"type":23,"tag":2730,"props":10299,"children":10300},{},[10301],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":10303},[10304,10305,10306,10307,10308,10309,10310,10311,10312],{"id":8955,"depth":927,"text":8955},{"id":9011,"depth":927,"text":9011},{"id":9096,"depth":927,"text":9099},{"id":9316,"depth":927,"text":9319},{"id":9407,"depth":927,"text":9407},{"id":9440,"depth":927,"text":9440},{"id":9621,"depth":927,"text":9624},{"id":9937,"depth":927,"text":9937},{"id":10289,"depth":927,"text":10292},"content:blog:2026-09-12-genesis-lakehouse-hudi-iceberg.md","blog\u002F2026-09-12-genesis-lakehouse-hudi-iceberg.md","blog\u002F2026-09-12-genesis-lakehouse-hudi-iceberg",{"_path":10317,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":10318,"description":10319,"date":10320,"tags":10321,"body":10323,"_type":937,"_id":11924,"_source":939,"_file":11925,"_stem":11926,"_extension":942},"\u002Fblog\u002F2026-09-09-genesis-table-detail-truth","查询失败了，页面却亮绿灯：表详情页的修复，和一个改了三次的线程池","子查询失败被显示成零值和绿灯。后端改成每段单独报状态，前端接上以后又修掉六处断链，线程池队列从 100 收到 16。","2026-09-09",[46,3372,10322,5719],"线程池",{"type":20,"children":10324,"toc":11916},[10325,10342,10347,10352,10357,10362,10382,10514,10527,10731,10736,10742,10761,10774,10782,10795,10872,10884,10889,10945,10965,11069,11074,11079,11091,11096,11101,11106,11223,11231,11243,11248,11253,11258,11634,11639,11652,11658,11677,11682,11785,11830,11850,11855,11863,11875,11880,11892,11912],{"type":23,"tag":24,"props":10326,"children":10327},{},[10328,10332,10334,10340],{"type":23,"tag":41,"props":10329,"children":10330},{"href":43},[10331],{"type":28,"value":46},{"type":28,"value":10333}," 的表详情页顶上有一个健康点，分绿、黄、红、灰四种颜色，下面有质量和运行两个 Tab。这些数据来自 ",{"type":23,"tag":99,"props":10335,"children":10337},{"className":10336},[],[10338],{"type":28,"value":10339},"\u002Ffull",{"type":28,"value":10341}," 这个接口，它在后端把质量、Incident（平台记录的一次故障）、变更几路子查询并行跑完，再拼成一个响应。",{"type":23,"tag":24,"props":10343,"children":10344},{},[10345],{"type":28,"value":10346},"9 月 3 号，我准备把这段聚合逻辑从 Controller 里挪到一个单独的服务里，好让 Agent 也能读到同一份表上下文。写计划时对着旧代码过了一遍，发现这个页面在出错时会说假话：子查询失败了，返回的是全零的摘要，健康点照样亮绿灯。",{"type":23,"tag":24,"props":10348,"children":10349},{},[10350],{"type":28,"value":10351},"这类问题我在产品路线文档里专门记过，叫「绿灯断链」：代码在，页面能打开，编译通过，单测全绿，但链路上某一环是断的，而且不报任何错。",{"type":23,"tag":24,"props":10353,"children":10354},{},[10355],{"type":28,"value":10356},"下面的代码来自两份实施计划和对应的提交，有删减。",{"type":23,"tag":50,"props":10358,"children":10360},{"id":10359},"原来的聚合是怎么写的",[10361],{"type":28,"value":10359},{"type":23,"tag":24,"props":10363,"children":10364},{},[10365,10367,10372,10374,10380],{"type":28,"value":10366},"旧的 ",{"type":23,"tag":99,"props":10368,"children":10370},{"className":10369},[],[10371],{"type":28,"value":4613},{"type":28,"value":10373}," 用 ",{"type":23,"tag":99,"props":10375,"children":10377},{"className":10376},[],[10378],{"type":28,"value":10379},"CompletableFuture.supplyAsync",{"type":28,"value":10381}," 并行跑三路子查询，没指定线程池，总共最多等 5 秒：",{"type":23,"tag":2152,"props":10383,"children":10387},{"className":10384,"code":10385,"language":10386,"meta":8,"style":8},"language-java shiki shiki-themes github-light github-dark","try {\n    CompletableFuture.allOf(qualityFuture, incidentFuture, changesFuture)\n            .get(SUB_QUERY_TIMEOUT_SEC, TimeUnit.SECONDS);\n} catch (Exception e) {\n    log.warn(\"聚合子查询超时或失败 qName={}: {}\", qName, e.getMessage());\n}\n","java",[10388],{"type":23,"tag":99,"props":10389,"children":10390},{"__ignoreMap":8},[10391,10404,10422,10440,10469,10507],{"type":23,"tag":2161,"props":10392,"children":10393},{"class":2163,"line":2164},[10394,10399],{"type":23,"tag":2161,"props":10395,"children":10396},{"style":5948},[10397],{"type":28,"value":10398},"try",{"type":23,"tag":2161,"props":10400,"children":10401},{"style":5830},[10402],{"type":28,"value":10403}," {\n",{"type":23,"tag":2161,"props":10405,"children":10406},{"class":2163,"line":927},[10407,10412,10417],{"type":23,"tag":2161,"props":10408,"children":10409},{"style":5830},[10410],{"type":28,"value":10411},"    CompletableFuture.",{"type":23,"tag":2161,"props":10413,"children":10414},{"style":5824},[10415],{"type":28,"value":10416},"allOf",{"type":23,"tag":2161,"props":10418,"children":10419},{"style":5830},[10420],{"type":28,"value":10421},"(qualityFuture, incidentFuture, changesFuture)\n",{"type":23,"tag":2161,"props":10423,"children":10424},{"class":2163,"line":924},[10425,10430,10435],{"type":23,"tag":2161,"props":10426,"children":10427},{"style":5830},[10428],{"type":28,"value":10429},"            .",{"type":23,"tag":2161,"props":10431,"children":10432},{"style":5824},[10433],{"type":28,"value":10434},"get",{"type":23,"tag":2161,"props":10436,"children":10437},{"style":5830},[10438],{"type":28,"value":10439},"(SUB_QUERY_TIMEOUT_SEC, TimeUnit.SECONDS);\n",{"type":23,"tag":2161,"props":10441,"children":10442},{"class":2163,"line":2190},[10443,10448,10453,10458,10464],{"type":23,"tag":2161,"props":10444,"children":10445},{"style":5830},[10446],{"type":28,"value":10447},"} ",{"type":23,"tag":2161,"props":10449,"children":10450},{"style":5948},[10451],{"type":28,"value":10452},"catch",{"type":23,"tag":2161,"props":10454,"children":10455},{"style":5830},[10456],{"type":28,"value":10457}," (Exception ",{"type":23,"tag":2161,"props":10459,"children":10461},{"style":10460},"--shiki-default:#E36209;--shiki-dark:#FFAB70",[10462],{"type":28,"value":10463},"e",{"type":23,"tag":2161,"props":10465,"children":10466},{"style":5830},[10467],{"type":28,"value":10468},") {\n",{"type":23,"tag":2161,"props":10470,"children":10471},{"class":2163,"line":2199},[10472,10477,10482,10487,10492,10497,10502],{"type":23,"tag":2161,"props":10473,"children":10474},{"style":5830},[10475],{"type":28,"value":10476},"    log.",{"type":23,"tag":2161,"props":10478,"children":10479},{"style":5824},[10480],{"type":28,"value":10481},"warn",{"type":23,"tag":2161,"props":10483,"children":10484},{"style":5830},[10485],{"type":28,"value":10486},"(",{"type":23,"tag":2161,"props":10488,"children":10489},{"style":5855},[10490],{"type":28,"value":10491},"\"聚合子查询超时或失败 qName={}: {}\"",{"type":23,"tag":2161,"props":10493,"children":10494},{"style":5830},[10495],{"type":28,"value":10496},", qName, e.",{"type":23,"tag":2161,"props":10498,"children":10499},{"style":5824},[10500],{"type":28,"value":10501},"getMessage",{"type":23,"tag":2161,"props":10503,"children":10504},{"style":5830},[10505],{"type":28,"value":10506},"());\n",{"type":23,"tag":2161,"props":10508,"children":10509},{"class":2163,"line":2208},[10510],{"type":23,"tag":2161,"props":10511,"children":10512},{"style":5830},[10513],{"type":28,"value":5964},{"type":23,"tag":24,"props":10515,"children":10516},{},[10517,10519,10525],{"type":28,"value":10518},"没跑完的段会被 ",{"type":23,"tag":99,"props":10520,"children":10522},{"className":10521},[],[10523],{"type":28,"value":10524},"putIfNotNull",{"type":28,"value":10526}," 跳过，响应里直接少一个键。更要命的是每个段构建器里面还有一层 try\u002Fcatch，质量摘要是这么兜底的：",{"type":23,"tag":2152,"props":10528,"children":10530},{"className":10384,"code":10529,"language":10386,"meta":8,"style":8},"} catch (Exception e) {\n    log.warn(\"质量摘要构建失败 qName={}: {}\", qualifiedName, e.getMessage());\n    node.put(\"totalRules\", 0);\n    node.put(\"passedRules\", 0);\n    node.put(\"failedRules\", 0);\n    node.put(\"hasFailure\", false);\n}\n",[10531],{"type":23,"tag":99,"props":10532,"children":10533},{"__ignoreMap":8},[10534,10557,10590,10627,10659,10691,10724],{"type":23,"tag":2161,"props":10535,"children":10536},{"class":2163,"line":2164},[10537,10541,10545,10549,10553],{"type":23,"tag":2161,"props":10538,"children":10539},{"style":5830},[10540],{"type":28,"value":10447},{"type":23,"tag":2161,"props":10542,"children":10543},{"style":5948},[10544],{"type":28,"value":10452},{"type":23,"tag":2161,"props":10546,"children":10547},{"style":5830},[10548],{"type":28,"value":10457},{"type":23,"tag":2161,"props":10550,"children":10551},{"style":10460},[10552],{"type":28,"value":10463},{"type":23,"tag":2161,"props":10554,"children":10555},{"style":5830},[10556],{"type":28,"value":10468},{"type":23,"tag":2161,"props":10558,"children":10559},{"class":2163,"line":927},[10560,10564,10568,10572,10577,10582,10586],{"type":23,"tag":2161,"props":10561,"children":10562},{"style":5830},[10563],{"type":28,"value":10476},{"type":23,"tag":2161,"props":10565,"children":10566},{"style":5824},[10567],{"type":28,"value":10481},{"type":23,"tag":2161,"props":10569,"children":10570},{"style":5830},[10571],{"type":28,"value":10486},{"type":23,"tag":2161,"props":10573,"children":10574},{"style":5855},[10575],{"type":28,"value":10576},"\"质量摘要构建失败 qName={}: {}\"",{"type":23,"tag":2161,"props":10578,"children":10579},{"style":5830},[10580],{"type":28,"value":10581},", qualifiedName, e.",{"type":23,"tag":2161,"props":10583,"children":10584},{"style":5824},[10585],{"type":28,"value":10501},{"type":23,"tag":2161,"props":10587,"children":10588},{"style":5830},[10589],{"type":28,"value":10506},{"type":23,"tag":2161,"props":10591,"children":10592},{"class":2163,"line":924},[10593,10598,10603,10607,10612,10617,10622],{"type":23,"tag":2161,"props":10594,"children":10595},{"style":5830},[10596],{"type":28,"value":10597},"    node.",{"type":23,"tag":2161,"props":10599,"children":10600},{"style":5824},[10601],{"type":28,"value":10602},"put",{"type":23,"tag":2161,"props":10604,"children":10605},{"style":5830},[10606],{"type":28,"value":10486},{"type":23,"tag":2161,"props":10608,"children":10609},{"style":5855},[10610],{"type":28,"value":10611},"\"totalRules\"",{"type":23,"tag":2161,"props":10613,"children":10614},{"style":5830},[10615],{"type":28,"value":10616},", ",{"type":23,"tag":2161,"props":10618,"children":10619},{"style":5844},[10620],{"type":28,"value":10621},"0",{"type":23,"tag":2161,"props":10623,"children":10624},{"style":5830},[10625],{"type":28,"value":10626},");\n",{"type":23,"tag":2161,"props":10628,"children":10629},{"class":2163,"line":2190},[10630,10634,10638,10642,10647,10651,10655],{"type":23,"tag":2161,"props":10631,"children":10632},{"style":5830},[10633],{"type":28,"value":10597},{"type":23,"tag":2161,"props":10635,"children":10636},{"style":5824},[10637],{"type":28,"value":10602},{"type":23,"tag":2161,"props":10639,"children":10640},{"style":5830},[10641],{"type":28,"value":10486},{"type":23,"tag":2161,"props":10643,"children":10644},{"style":5855},[10645],{"type":28,"value":10646},"\"passedRules\"",{"type":23,"tag":2161,"props":10648,"children":10649},{"style":5830},[10650],{"type":28,"value":10616},{"type":23,"tag":2161,"props":10652,"children":10653},{"style":5844},[10654],{"type":28,"value":10621},{"type":23,"tag":2161,"props":10656,"children":10657},{"style":5830},[10658],{"type":28,"value":10626},{"type":23,"tag":2161,"props":10660,"children":10661},{"class":2163,"line":2199},[10662,10666,10670,10674,10679,10683,10687],{"type":23,"tag":2161,"props":10663,"children":10664},{"style":5830},[10665],{"type":28,"value":10597},{"type":23,"tag":2161,"props":10667,"children":10668},{"style":5824},[10669],{"type":28,"value":10602},{"type":23,"tag":2161,"props":10671,"children":10672},{"style":5830},[10673],{"type":28,"value":10486},{"type":23,"tag":2161,"props":10675,"children":10676},{"style":5855},[10677],{"type":28,"value":10678},"\"failedRules\"",{"type":23,"tag":2161,"props":10680,"children":10681},{"style":5830},[10682],{"type":28,"value":10616},{"type":23,"tag":2161,"props":10684,"children":10685},{"style":5844},[10686],{"type":28,"value":10621},{"type":23,"tag":2161,"props":10688,"children":10689},{"style":5830},[10690],{"type":28,"value":10626},{"type":23,"tag":2161,"props":10692,"children":10693},{"class":2163,"line":2208},[10694,10698,10702,10706,10711,10715,10720],{"type":23,"tag":2161,"props":10695,"children":10696},{"style":5830},[10697],{"type":28,"value":10597},{"type":23,"tag":2161,"props":10699,"children":10700},{"style":5824},[10701],{"type":28,"value":10602},{"type":23,"tag":2161,"props":10703,"children":10704},{"style":5830},[10705],{"type":28,"value":10486},{"type":23,"tag":2161,"props":10707,"children":10708},{"style":5855},[10709],{"type":28,"value":10710},"\"hasFailure\"",{"type":23,"tag":2161,"props":10712,"children":10713},{"style":5830},[10714],{"type":28,"value":10616},{"type":23,"tag":2161,"props":10716,"children":10717},{"style":5844},[10718],{"type":28,"value":10719},"false",{"type":23,"tag":2161,"props":10721,"children":10722},{"style":5830},[10723],{"type":28,"value":10626},{"type":23,"tag":2161,"props":10725,"children":10726},{"class":2163,"line":2217},[10727],{"type":23,"tag":2161,"props":10728,"children":10729},{"style":5830},[10730],{"type":28,"value":5964},{"type":23,"tag":24,"props":10732,"children":10733},{},[10734],{"type":28,"value":10735},"数据库挂了，返回的是一个格式完全正确、数值全是 0 的对象。前端拿到的就是一张「没有失败规则」的表，健康点亮绿灯，只有日志里留了一行 warn。",{"type":23,"tag":50,"props":10737,"children":10739},{"id":10738},"后端每一段自己报状态",[10740],{"type":28,"value":10741},"后端：每一段自己报状态",{"type":23,"tag":24,"props":10743,"children":10744},{},[10745,10747,10752,10753,10759],{"type":28,"value":10746},"新的 ",{"type":23,"tag":99,"props":10748,"children":10750},{"className":10749},[],[10751],{"type":28,"value":3132},{"type":28,"value":10373},{"type":23,"tag":99,"props":10754,"children":10756},{"className":10755},[],[10757],{"type":28,"value":10758},"TableContextScope",{"type":28,"value":10760}," 枚举选要拉哪几段，首批就是旧 Controller 已有的五段：QUALITY、QUALITY_DETAIL、INCIDENTS、CHANGES、IDE_NODES。每段扔进线程池并行跑，所有段共用一个截止时间，默认 5000ms；逐段收结果的时候，只等离截止时间还剩下的那点时间。",{"type":23,"tag":24,"props":10762,"children":10763},{},[10764,10766,10772],{"type":28,"value":10765},"每段的结果是一个 ",{"type":23,"tag":99,"props":10767,"children":10769},{"className":10768},[],[10770],{"type":28,"value":10771},"SectionResult",{"type":28,"value":10773},"，状态只有三种：OK、TIMEOUT、ERROR。段构建器里吞异常的 try\u002Fcatch 全部删掉，异常一路抛到收集那一层再分类。",{"type":23,"tag":24,"props":10775,"children":10776},{},[10777],{"type":23,"tag":65,"props":10778,"children":10781},{"alt":10779,"src":10780},"表上下文服务的收集流程：QUALITY、QUALITY_DETAIL、INCIDENTS、CHANGES、IDE_NODES 五段进入专用线程池 tableContextExecutor（core 8、max 16、queue 16、AbortPolicy），共用默认 5000ms 的截止时间；每段归为 OK（有数据才算，null 归为 ERROR）、TIMEOUT（到截止时间还没回来）或 ERROR（抛异常、返回 null、线程池拒绝，响应里只给异常类名）；响应里多一个 sections 字段，非 OK 的段直接省略对应的键","\u002Fimages\u002Fblog\u002Fgenesis-table-detail\u002Fsection-status.svg",[],{"type":23,"tag":24,"props":10783,"children":10784},{},[10785,10787,10793],{"type":28,"value":10786},"接口对前端保持兼容，原来的键都还在，只多一个顶层的 ",{"type":23,"tag":99,"props":10788,"children":10790},{"className":10789},[],[10791],{"type":28,"value":10792},"sections",{"type":28,"value":10794},"。比如某段超时时：",{"type":23,"tag":2152,"props":10796,"children":10800},{"className":10797,"code":10798,"language":10799,"meta":8,"style":8},"language-json shiki shiki-themes github-light github-dark","\"sections\": { \"quality\": \"TIMEOUT\", \"incidents\": \"OK\", \"changes\": \"OK\" }\n","json",[10801],{"type":23,"tag":99,"props":10802,"children":10803},{"__ignoreMap":8},[10804],{"type":23,"tag":2161,"props":10805,"children":10806},{"class":2163,"line":2164},[10807,10812,10817,10822,10827,10832,10836,10841,10845,10850,10854,10859,10863,10867],{"type":23,"tag":2161,"props":10808,"children":10809},{"style":5855},[10810],{"type":28,"value":10811},"\"sections\"",{"type":23,"tag":2161,"props":10813,"children":10814},{"style":5830},[10815],{"type":28,"value":10816},": { ",{"type":23,"tag":2161,"props":10818,"children":10819},{"style":5844},[10820],{"type":28,"value":10821},"\"quality\"",{"type":23,"tag":2161,"props":10823,"children":10824},{"style":5830},[10825],{"type":28,"value":10826},": ",{"type":23,"tag":2161,"props":10828,"children":10829},{"style":5855},[10830],{"type":28,"value":10831},"\"TIMEOUT\"",{"type":23,"tag":2161,"props":10833,"children":10834},{"style":5830},[10835],{"type":28,"value":10616},{"type":23,"tag":2161,"props":10837,"children":10838},{"style":5844},[10839],{"type":28,"value":10840},"\"incidents\"",{"type":23,"tag":2161,"props":10842,"children":10843},{"style":5830},[10844],{"type":28,"value":10826},{"type":23,"tag":2161,"props":10846,"children":10847},{"style":5855},[10848],{"type":28,"value":10849},"\"OK\"",{"type":23,"tag":2161,"props":10851,"children":10852},{"style":5830},[10853],{"type":28,"value":10616},{"type":23,"tag":2161,"props":10855,"children":10856},{"style":5844},[10857],{"type":28,"value":10858},"\"changes\"",{"type":23,"tag":2161,"props":10860,"children":10861},{"style":5830},[10862],{"type":28,"value":10826},{"type":23,"tag":2161,"props":10864,"children":10865},{"style":5855},[10866],{"type":28,"value":10849},{"type":23,"tag":2161,"props":10868,"children":10869},{"style":5830},[10870],{"type":28,"value":10871}," }\n",{"type":23,"tag":24,"props":10873,"children":10874},{},[10875,10877,10882],{"type":28,"value":10876},"非 OK 的段不再输出零值对象，直接省略对应的键，状态写在 ",{"type":23,"tag":99,"props":10878,"children":10880},{"className":10879},[],[10881],{"type":28,"value":10792},{"type":28,"value":10883}," 里。",{"type":23,"tag":24,"props":10885,"children":10886},{},[10887],{"type":28,"value":10888},"这个服务是按实施计划拆成几个 Task 交给 AI 子代理写的，每个 Task 写完过一轮规格审查和一轮代码质量审查。审查提了好几条，下面这几条是这次改进去的：",{"type":23,"tag":399,"props":10890,"children":10891},{},[10892,10905,10932],{"type":23,"tag":403,"props":10893,"children":10894},{},[10895,10897,10903],{"type":28,"value":10896},"异常原文不进响应。原始 message 里可能带着 SQL 和表名，现在返回给调用方的只有异常类名，形如 ",{"type":23,"tag":99,"props":10898,"children":10900},{"className":10899},[],[10901],{"type":28,"value":10902},"子查询失败: IllegalStateException",{"type":28,"value":10904},"，完整堆栈只进日志。",{"type":23,"tag":403,"props":10906,"children":10907},{},[10908,10914,10916,10922,10924,10930],{"type":23,"tag":99,"props":10909,"children":10911},{"className":10910},[],[10912],{"type":28,"value":10913},"cancel(true)",{"type":28,"value":10915}," 改成 ",{"type":23,"tag":99,"props":10917,"children":10919},{"className":10918},[],[10920],{"type":28,"value":10921},"cancel(false)",{"type":28,"value":10923},"。CompletableFuture 的 cancel 不靠中断线程，传 true 也停不了底层的 JDBC 查询，只是标记这个结果不要了；写成 true 容易让人以为查询被掐掉了。真正给查询设上限要靠 MyBatis 的 ",{"type":23,"tag":99,"props":10925,"children":10927},{"className":10926},[],[10928],{"type":28,"value":10929},"default-statement-timeout",{"type":28,"value":10931},"，那是全局行为，得单独立项。",{"type":23,"tag":403,"props":10933,"children":10934},{},[10935,10937,10943],{"type":28,"value":10936},"OK 段必须有数据，",{"type":23,"tag":99,"props":10938,"children":10940},{"className":10939},[],[10941],{"type":28,"value":10942},"SectionResult.ok(null)",{"type":28,"value":10944}," 直接拒绝。",{"type":23,"tag":24,"props":10946,"children":10947},{},[10948,10950,10956,10957,10963],{"type":28,"value":10949},"第三条还带出一个新问题。",{"type":23,"tag":99,"props":10951,"children":10953},{"className":10952},[],[10954],{"type":28,"value":10955},"ok()",{"type":28,"value":173},{"type":23,"tag":99,"props":10958,"children":10960},{"className":10959},[],[10961],{"type":28,"value":10962},"requireNonNull",{"type":28,"value":10964}," 抛出的 NPE 落在收集方法的 try 块里，三个 catch 一个都接不住，于是只要哪个段构建器返回了 null，整个请求就是 500。复审时改成先判空，null 归为 ERROR：",{"type":23,"tag":2152,"props":10966,"children":10968},{"className":10384,"code":10967,"language":10386,"meta":8,"style":8},"ObjectNode data = future.get(remaining, TimeUnit.NANOSECONDS);\nreturn data == null ? SectionResult.error(\"子查询返回空数据\") : SectionResult.ok(data);\n",[10969],{"type":23,"tag":99,"props":10970,"children":10971},{"__ignoreMap":8},[10972,10998],{"type":23,"tag":2161,"props":10973,"children":10974},{"class":2163,"line":2164},[10975,10980,10984,10989,10993],{"type":23,"tag":2161,"props":10976,"children":10977},{"style":5830},[10978],{"type":28,"value":10979},"ObjectNode data ",{"type":23,"tag":2161,"props":10981,"children":10982},{"style":5948},[10983],{"type":28,"value":6258},{"type":23,"tag":2161,"props":10985,"children":10986},{"style":5830},[10987],{"type":28,"value":10988}," future.",{"type":23,"tag":2161,"props":10990,"children":10991},{"style":5824},[10992],{"type":28,"value":10434},{"type":23,"tag":2161,"props":10994,"children":10995},{"style":5830},[10996],{"type":28,"value":10997},"(remaining, TimeUnit.NANOSECONDS);\n",{"type":23,"tag":2161,"props":10999,"children":11000},{"class":2163,"line":927},[11001,11006,11011,11016,11021,11026,11031,11036,11040,11045,11050,11055,11059,11064],{"type":23,"tag":2161,"props":11002,"children":11003},{"style":5948},[11004],{"type":28,"value":11005},"return",{"type":23,"tag":2161,"props":11007,"children":11008},{"style":5830},[11009],{"type":28,"value":11010}," data ",{"type":23,"tag":2161,"props":11012,"children":11013},{"style":5948},[11014],{"type":28,"value":11015},"==",{"type":23,"tag":2161,"props":11017,"children":11018},{"style":5844},[11019],{"type":28,"value":11020}," null",{"type":23,"tag":2161,"props":11022,"children":11023},{"style":5948},[11024],{"type":28,"value":11025}," ?",{"type":23,"tag":2161,"props":11027,"children":11028},{"style":5830},[11029],{"type":28,"value":11030}," SectionResult.",{"type":23,"tag":2161,"props":11032,"children":11033},{"style":5824},[11034],{"type":28,"value":11035},"error",{"type":23,"tag":2161,"props":11037,"children":11038},{"style":5830},[11039],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11041,"children":11042},{"style":5855},[11043],{"type":28,"value":11044},"\"子查询返回空数据\"",{"type":23,"tag":2161,"props":11046,"children":11047},{"style":5830},[11048],{"type":28,"value":11049},") ",{"type":23,"tag":2161,"props":11051,"children":11052},{"style":5948},[11053],{"type":28,"value":11054},":",{"type":23,"tag":2161,"props":11056,"children":11057},{"style":5830},[11058],{"type":28,"value":11030},{"type":23,"tag":2161,"props":11060,"children":11061},{"style":5824},[11062],{"type":28,"value":11063},"ok",{"type":23,"tag":2161,"props":11065,"children":11066},{"style":5830},[11067],{"type":28,"value":11068},"(data);\n",{"type":23,"tag":50,"props":11070,"children":11072},{"id":11071},"线程池改了三次",[11073],{"type":28,"value":11071},{"type":23,"tag":24,"props":11075,"children":11076},{},[11077],{"type":28,"value":11078},"旧代码没指定线程池，用的是 CompletableFuture 默认的异步执行器。审查意见是：阻塞的 JDBC 查询不该放在那里。",{"type":23,"tag":24,"props":11080,"children":11081},{},[11082,11084,11090],{"type":28,"value":11083},"默认的 commonPool 按 CPU 核数定线程数，是给计算型任务准备的。几个慢查询就能把它占满，别处用到 commonPool 的代码也得跟着等。核数太少时 CompletableFuture 干脆不用 commonPool，每个任务新开一个线程，数量没有上限。哪种都不适合放阻塞查询，于是加了一个专用池 ",{"type":23,"tag":99,"props":11085,"children":11087},{"className":11086},[],[11088],{"type":28,"value":11089},"tableContextExecutor",{"type":28,"value":287},{"type":23,"tag":24,"props":11092,"children":11093},{},[11094],{"type":28,"value":11095},"第一版是 core 4、max 16、queue 100，拒绝策略用 AbortPolicy。这里特意没用 CallerRunsPolicy：队列满了就让提交失败，这一段归为 ERROR 露出来。要是回落到请求线程自己跑，拥塞就被伪装成了「慢」，又是一种假象。",{"type":23,"tag":24,"props":11097,"children":11098},{},[11099],{"type":28,"value":11100},"问题出在队列长度上。Spring 的 ThreadPoolTaskExecutor 底下就是 JDK 的 ThreadPoolExecutor，它的规矩是：核心线程满了以后，新任务先进队列，队列满了才会往 max 扩线程。core 4 配 queue 100，要排满 100 个任务才会开第 5 个线程，max 16 和 AbortPolicy 基本等于没配。第二版把队列收到 32。",{"type":23,"tag":24,"props":11102,"children":11103},{},[11104],{"type":28,"value":11105},"终审又改了一次。core 4 配 queue 32，并发一上来还是得先排满队列才扩容，排在队列里的段很容易撞上那个共享的 5 秒截止时间，结果就是一批 TIMEOUT。第三版定成 core 8、max 16、queue 16。队列故意留小，并发一来池子就能尽快扩到 16 个线程，任务不至于在队列里一直等到超时：",{"type":23,"tag":2152,"props":11107,"children":11109},{"className":10384,"code":11108,"language":10386,"meta":8,"style":8},"executor.setCorePoolSize(8);\nexecutor.setMaxPoolSize(16);\nexecutor.setQueueCapacity(16);\nexecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());\n",[11110],{"type":23,"tag":99,"props":11111,"children":11112},{"__ignoreMap":8},[11113,11139,11164,11188],{"type":23,"tag":2161,"props":11114,"children":11115},{"class":2163,"line":2164},[11116,11121,11126,11130,11135],{"type":23,"tag":2161,"props":11117,"children":11118},{"style":5830},[11119],{"type":28,"value":11120},"executor.",{"type":23,"tag":2161,"props":11122,"children":11123},{"style":5824},[11124],{"type":28,"value":11125},"setCorePoolSize",{"type":23,"tag":2161,"props":11127,"children":11128},{"style":5830},[11129],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11131,"children":11132},{"style":5844},[11133],{"type":28,"value":11134},"8",{"type":23,"tag":2161,"props":11136,"children":11137},{"style":5830},[11138],{"type":28,"value":10626},{"type":23,"tag":2161,"props":11140,"children":11141},{"class":2163,"line":927},[11142,11146,11151,11155,11160],{"type":23,"tag":2161,"props":11143,"children":11144},{"style":5830},[11145],{"type":28,"value":11120},{"type":23,"tag":2161,"props":11147,"children":11148},{"style":5824},[11149],{"type":28,"value":11150},"setMaxPoolSize",{"type":23,"tag":2161,"props":11152,"children":11153},{"style":5830},[11154],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11156,"children":11157},{"style":5844},[11158],{"type":28,"value":11159},"16",{"type":23,"tag":2161,"props":11161,"children":11162},{"style":5830},[11163],{"type":28,"value":10626},{"type":23,"tag":2161,"props":11165,"children":11166},{"class":2163,"line":924},[11167,11171,11176,11180,11184],{"type":23,"tag":2161,"props":11168,"children":11169},{"style":5830},[11170],{"type":28,"value":11120},{"type":23,"tag":2161,"props":11172,"children":11173},{"style":5824},[11174],{"type":28,"value":11175},"setQueueCapacity",{"type":23,"tag":2161,"props":11177,"children":11178},{"style":5830},[11179],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11181,"children":11182},{"style":5844},[11183],{"type":28,"value":11159},{"type":23,"tag":2161,"props":11185,"children":11186},{"style":5830},[11187],{"type":28,"value":10626},{"type":23,"tag":2161,"props":11189,"children":11190},{"class":2163,"line":2190},[11191,11195,11200,11204,11209,11214,11219],{"type":23,"tag":2161,"props":11192,"children":11193},{"style":5830},[11194],{"type":28,"value":11120},{"type":23,"tag":2161,"props":11196,"children":11197},{"style":5824},[11198],{"type":28,"value":11199},"setRejectedExecutionHandler",{"type":23,"tag":2161,"props":11201,"children":11202},{"style":5830},[11203],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11205,"children":11206},{"style":5948},[11207],{"type":28,"value":11208},"new",{"type":23,"tag":2161,"props":11210,"children":11211},{"style":5830},[11212],{"type":28,"value":11213}," ThreadPoolExecutor.",{"type":23,"tag":2161,"props":11215,"children":11216},{"style":5824},[11217],{"type":28,"value":11218},"AbortPolicy",{"type":23,"tag":2161,"props":11220,"children":11221},{"style":5830},[11222],{"type":28,"value":10506},{"type":23,"tag":24,"props":11224,"children":11225},{},[11226],{"type":23,"tag":65,"props":11227,"children":11230},{"alt":11228,"src":11229},"线程池三版对比：每版一条横条，按核心线程直接跑、排队、队列满了才扩到 max、再来就拒绝记 ERROR 四段着色；第一版 core 4、max 16、queue 100，要排满 100 个任务才开第 5 个线程；第二版 core 4、max 16、queue 32，排队的段撞上 5 秒截止时间成批 TIMEOUT；第三版 core 8、max 16、queue 16，队列故意留小，尽快扩到 16 个线程；三版拒绝策略都是 AbortPolicy","\u002Fimages\u002Fblog\u002Fgenesis-table-detail\u002Fpool-versions.svg",[],{"type":23,"tag":24,"props":11232,"children":11233},{},[11234,11236,11241],{"type":28,"value":11235},"有一点要说清楚：",{"type":23,"tag":99,"props":11237,"children":11239},{"className":11238},[],[11240],{"type":28,"value":10921},{"type":28,"value":11242}," 停不了 JDBC，超时的段还会继续占着线程。如果查询一直慢，最终会以 RejectedExecutionException 的形式暴露出来，同样归为 ERROR。这个口子要等语句级超时做了才算真正封上。",{"type":23,"tag":24,"props":11244,"children":11245},{},[11246],{"type":28,"value":11247},"审查还记了一条后续项，没放在这次做：质量摘要和质量详情是每条规则单独查一次最新执行记录，一张有 40 条规则的表会先把 QUALITY 段拖到超时，还会挤占后面的段，得改成一次 IN 查询。",{"type":23,"tag":50,"props":11249,"children":11251},{"id":11250},"变红测试",[11252],{"type":28,"value":11250},{"type":23,"tag":24,"props":11254,"children":11255},{},[11256],{"type":28,"value":11257},"这次我最看重的是：失败场景下，状态真的会变红。超时那条测试是这么写的：",{"type":23,"tag":2152,"props":11259,"children":11261},{"className":10384,"code":11260,"language":10386,"meta":8,"style":8},"when(dqRuleMapper.selectList(any())).thenAnswer(inv -> {\n    Thread.sleep(500);\n    return List.of();\n});\nlong start = System.currentTimeMillis();\nMap\u003CTableContextScope, SectionResult> result = service(100)\n        .build(Q_NAME, detail, EnumSet.of(TableContextScope.QUALITY, TableContextScope.INCIDENTS));\nlong elapsed = System.currentTimeMillis() - start;\n\nassertThat(result.get(TableContextScope.QUALITY).status()).isEqualTo(SectionStatus.TIMEOUT);\nassertThat(result.get(TableContextScope.INCIDENTS).status()).isEqualTo(SectionStatus.OK);\nassertThat(elapsed).isLessThan(450);\n",[11262],{"type":23,"tag":99,"props":11263,"children":11264},{"__ignoreMap":8},[11265,11316,11342,11365,11373,11404,11452,11479,11518,11525,11567,11604],{"type":23,"tag":2161,"props":11266,"children":11267},{"class":2163,"line":2164},[11268,11273,11278,11283,11287,11292,11297,11302,11307,11312],{"type":23,"tag":2161,"props":11269,"children":11270},{"style":5824},[11271],{"type":28,"value":11272},"when",{"type":23,"tag":2161,"props":11274,"children":11275},{"style":5830},[11276],{"type":28,"value":11277},"(dqRuleMapper.",{"type":23,"tag":2161,"props":11279,"children":11280},{"style":5824},[11281],{"type":28,"value":11282},"selectList",{"type":23,"tag":2161,"props":11284,"children":11285},{"style":5830},[11286],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11288,"children":11289},{"style":5824},[11290],{"type":28,"value":11291},"any",{"type":23,"tag":2161,"props":11293,"children":11294},{"style":5830},[11295],{"type":28,"value":11296},"())).",{"type":23,"tag":2161,"props":11298,"children":11299},{"style":5824},[11300],{"type":28,"value":11301},"thenAnswer",{"type":23,"tag":2161,"props":11303,"children":11304},{"style":5830},[11305],{"type":28,"value":11306},"(inv ",{"type":23,"tag":2161,"props":11308,"children":11309},{"style":5948},[11310],{"type":28,"value":11311},"->",{"type":23,"tag":2161,"props":11313,"children":11314},{"style":5830},[11315],{"type":28,"value":10403},{"type":23,"tag":2161,"props":11317,"children":11318},{"class":2163,"line":927},[11319,11324,11329,11333,11338],{"type":23,"tag":2161,"props":11320,"children":11321},{"style":5830},[11322],{"type":28,"value":11323},"    Thread.",{"type":23,"tag":2161,"props":11325,"children":11326},{"style":5824},[11327],{"type":28,"value":11328},"sleep",{"type":23,"tag":2161,"props":11330,"children":11331},{"style":5830},[11332],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11334,"children":11335},{"style":5844},[11336],{"type":28,"value":11337},"500",{"type":23,"tag":2161,"props":11339,"children":11340},{"style":5830},[11341],{"type":28,"value":10626},{"type":23,"tag":2161,"props":11343,"children":11344},{"class":2163,"line":924},[11345,11350,11355,11360],{"type":23,"tag":2161,"props":11346,"children":11347},{"style":5948},[11348],{"type":28,"value":11349},"    return",{"type":23,"tag":2161,"props":11351,"children":11352},{"style":5830},[11353],{"type":28,"value":11354}," List.",{"type":23,"tag":2161,"props":11356,"children":11357},{"style":5824},[11358],{"type":28,"value":11359},"of",{"type":23,"tag":2161,"props":11361,"children":11362},{"style":5830},[11363],{"type":28,"value":11364},"();\n",{"type":23,"tag":2161,"props":11366,"children":11367},{"class":2163,"line":2190},[11368],{"type":23,"tag":2161,"props":11369,"children":11370},{"style":5830},[11371],{"type":28,"value":11372},"});\n",{"type":23,"tag":2161,"props":11374,"children":11375},{"class":2163,"line":2199},[11376,11381,11386,11390,11395,11400],{"type":23,"tag":2161,"props":11377,"children":11378},{"style":5948},[11379],{"type":28,"value":11380},"long",{"type":23,"tag":2161,"props":11382,"children":11383},{"style":5830},[11384],{"type":28,"value":11385}," start ",{"type":23,"tag":2161,"props":11387,"children":11388},{"style":5948},[11389],{"type":28,"value":6258},{"type":23,"tag":2161,"props":11391,"children":11392},{"style":5830},[11393],{"type":28,"value":11394}," System.",{"type":23,"tag":2161,"props":11396,"children":11397},{"style":5824},[11398],{"type":28,"value":11399},"currentTimeMillis",{"type":23,"tag":2161,"props":11401,"children":11402},{"style":5830},[11403],{"type":28,"value":11364},{"type":23,"tag":2161,"props":11405,"children":11406},{"class":2163,"line":2208},[11407,11412,11416,11420,11424,11429,11433,11438,11442,11447],{"type":23,"tag":2161,"props":11408,"children":11409},{"style":5830},[11410],{"type":28,"value":11411},"Map\u003C",{"type":23,"tag":2161,"props":11413,"children":11414},{"style":5948},[11415],{"type":28,"value":10758},{"type":23,"tag":2161,"props":11417,"children":11418},{"style":5830},[11419],{"type":28,"value":10616},{"type":23,"tag":2161,"props":11421,"children":11422},{"style":5948},[11423],{"type":28,"value":10771},{"type":23,"tag":2161,"props":11425,"children":11426},{"style":5830},[11427],{"type":28,"value":11428},"> result ",{"type":23,"tag":2161,"props":11430,"children":11431},{"style":5948},[11432],{"type":28,"value":6258},{"type":23,"tag":2161,"props":11434,"children":11435},{"style":5824},[11436],{"type":28,"value":11437}," service",{"type":23,"tag":2161,"props":11439,"children":11440},{"style":5830},[11441],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11443,"children":11444},{"style":5844},[11445],{"type":28,"value":11446},"100",{"type":23,"tag":2161,"props":11448,"children":11449},{"style":5830},[11450],{"type":28,"value":11451},")\n",{"type":23,"tag":2161,"props":11453,"children":11454},{"class":2163,"line":2217},[11455,11460,11465,11470,11474],{"type":23,"tag":2161,"props":11456,"children":11457},{"style":5830},[11458],{"type":28,"value":11459},"        .",{"type":23,"tag":2161,"props":11461,"children":11462},{"style":5824},[11463],{"type":28,"value":11464},"build",{"type":23,"tag":2161,"props":11466,"children":11467},{"style":5830},[11468],{"type":28,"value":11469},"(Q_NAME, detail, EnumSet.",{"type":23,"tag":2161,"props":11471,"children":11472},{"style":5824},[11473],{"type":28,"value":11359},{"type":23,"tag":2161,"props":11475,"children":11476},{"style":5830},[11477],{"type":28,"value":11478},"(TableContextScope.QUALITY, TableContextScope.INCIDENTS));\n",{"type":23,"tag":2161,"props":11480,"children":11481},{"class":2163,"line":2226},[11482,11486,11491,11495,11499,11503,11508,11513],{"type":23,"tag":2161,"props":11483,"children":11484},{"style":5948},[11485],{"type":28,"value":11380},{"type":23,"tag":2161,"props":11487,"children":11488},{"style":5830},[11489],{"type":28,"value":11490}," elapsed ",{"type":23,"tag":2161,"props":11492,"children":11493},{"style":5948},[11494],{"type":28,"value":6258},{"type":23,"tag":2161,"props":11496,"children":11497},{"style":5830},[11498],{"type":28,"value":11394},{"type":23,"tag":2161,"props":11500,"children":11501},{"style":5824},[11502],{"type":28,"value":11399},{"type":23,"tag":2161,"props":11504,"children":11505},{"style":5830},[11506],{"type":28,"value":11507},"() ",{"type":23,"tag":2161,"props":11509,"children":11510},{"style":5948},[11511],{"type":28,"value":11512},"-",{"type":23,"tag":2161,"props":11514,"children":11515},{"style":5830},[11516],{"type":28,"value":11517}," start;\n",{"type":23,"tag":2161,"props":11519,"children":11520},{"class":2163,"line":2235},[11521],{"type":23,"tag":2161,"props":11522,"children":11523},{"emptyLinePlaceholder":2176},[11524],{"type":28,"value":2179},{"type":23,"tag":2161,"props":11526,"children":11527},{"class":2163,"line":2244},[11528,11533,11538,11542,11547,11552,11557,11562],{"type":23,"tag":2161,"props":11529,"children":11530},{"style":5824},[11531],{"type":28,"value":11532},"assertThat",{"type":23,"tag":2161,"props":11534,"children":11535},{"style":5830},[11536],{"type":28,"value":11537},"(result.",{"type":23,"tag":2161,"props":11539,"children":11540},{"style":5824},[11541],{"type":28,"value":10434},{"type":23,"tag":2161,"props":11543,"children":11544},{"style":5830},[11545],{"type":28,"value":11546},"(TableContextScope.QUALITY).",{"type":23,"tag":2161,"props":11548,"children":11549},{"style":5824},[11550],{"type":28,"value":11551},"status",{"type":23,"tag":2161,"props":11553,"children":11554},{"style":5830},[11555],{"type":28,"value":11556},"()).",{"type":23,"tag":2161,"props":11558,"children":11559},{"style":5824},[11560],{"type":28,"value":11561},"isEqualTo",{"type":23,"tag":2161,"props":11563,"children":11564},{"style":5830},[11565],{"type":28,"value":11566},"(SectionStatus.TIMEOUT);\n",{"type":23,"tag":2161,"props":11568,"children":11569},{"class":2163,"line":2253},[11570,11574,11578,11582,11587,11591,11595,11599],{"type":23,"tag":2161,"props":11571,"children":11572},{"style":5824},[11573],{"type":28,"value":11532},{"type":23,"tag":2161,"props":11575,"children":11576},{"style":5830},[11577],{"type":28,"value":11537},{"type":23,"tag":2161,"props":11579,"children":11580},{"style":5824},[11581],{"type":28,"value":10434},{"type":23,"tag":2161,"props":11583,"children":11584},{"style":5830},[11585],{"type":28,"value":11586},"(TableContextScope.INCIDENTS).",{"type":23,"tag":2161,"props":11588,"children":11589},{"style":5824},[11590],{"type":28,"value":11551},{"type":23,"tag":2161,"props":11592,"children":11593},{"style":5830},[11594],{"type":28,"value":11556},{"type":23,"tag":2161,"props":11596,"children":11597},{"style":5824},[11598],{"type":28,"value":11561},{"type":23,"tag":2161,"props":11600,"children":11601},{"style":5830},[11602],{"type":28,"value":11603},"(SectionStatus.OK);\n",{"type":23,"tag":2161,"props":11605,"children":11606},{"class":2163,"line":6337},[11607,11611,11616,11621,11625,11630],{"type":23,"tag":2161,"props":11608,"children":11609},{"style":5824},[11610],{"type":28,"value":11532},{"type":23,"tag":2161,"props":11612,"children":11613},{"style":5830},[11614],{"type":28,"value":11615},"(elapsed).",{"type":23,"tag":2161,"props":11617,"children":11618},{"style":5824},[11619],{"type":28,"value":11620},"isLessThan",{"type":23,"tag":2161,"props":11622,"children":11623},{"style":5830},[11624],{"type":28,"value":10486},{"type":23,"tag":2161,"props":11626,"children":11627},{"style":5844},[11628],{"type":28,"value":11629},"450",{"type":23,"tag":2161,"props":11631,"children":11632},{"style":5830},[11633],{"type":28,"value":10626},{"type":23,"tag":24,"props":11635,"children":11636},{},[11637],{"type":28,"value":11638},"截止时间设成 100ms，让质量段睡 500ms。断言质量段是 TIMEOUT、Incident 段还是 OK，而且整个 build 不到 450ms 就返回，说明它没有傻等慢的那段。",{"type":23,"tag":24,"props":11640,"children":11641},{},[11642,11644,11650],{"type":28,"value":11643},"另一条让 mapper 抛 ",{"type":23,"tag":99,"props":11645,"children":11647},{"className":11646},[],[11648],{"type":28,"value":11649},"IllegalStateException(\"db down\")",{"type":28,"value":11651},"，断言状态是 ERROR、data 为空、message 里有异常类名，但没有 db down 这几个字。超时、异常、空数据、线程池拒绝四类失败都有对应的测试，后端测试从 387 个涨到 414 个。",{"type":23,"tag":50,"props":11653,"children":11655},{"id":11654},"前端接上段状态又翻出六处断链",[11656],{"type":28,"value":11657},"前端：接上段状态，又翻出六处断链",{"type":23,"tag":24,"props":11659,"children":11660},{},[11661,11663,11669,11671,11676],{"type":28,"value":11662},"后端说实话了，前端还会接着骗人。",{"type":23,"tag":99,"props":11664,"children":11666},{"className":11665},[],[11667],{"type":28,"value":11668},"HealthIndicator.vue",{"type":28,"value":11670}," 原来只在质量和 Incident 两段都缺的时候才显示灰色；质量超时、Incident 正常，照样是绿灯。所以前端必须读 ",{"type":23,"tag":99,"props":11672,"children":11674},{"className":11673},[],[11675],{"type":28,"value":10792},{"type":28,"value":287},{"type":23,"tag":24,"props":11678,"children":11679},{},[11680],{"type":28,"value":11681},"排查时我是读代码，再用 grep 反查每个调用点，结果又翻出六处早就存在的断链。挑三处说：",{"type":23,"tag":399,"props":11683,"children":11684},{},[11685,11714,11757],{"type":23,"tag":403,"props":11686,"children":11687},{},[11688,11690,11696,11698,11704,11706,11712],{"type":28,"value":11689},"质量 Tab 永远显示「该表未绑定质量规则」。页面传给它的是 ",{"type":23,"tag":99,"props":11691,"children":11693},{"className":11692},[],[11694],{"type":28,"value":11695},"fullData?.quality",{"type":28,"value":11697},"，这是摘要，没有 ",{"type":23,"tag":99,"props":11699,"children":11701},{"className":11700},[],[11702],{"type":28,"value":11703},"rules",{"type":28,"value":11705}," 数组，而组件用 ",{"type":23,"tag":99,"props":11707,"children":11709},{"className":11708},[],[11710],{"type":28,"value":11711},"!qualityData.rules",{"type":28,"value":11713}," 判空。有规则的表也显示未绑定。",{"type":23,"tag":403,"props":11715,"children":11716},{},[11717,11719,11724,11726,11732,11734,11740,11741,11747,11749,11755],{"type":28,"value":11718},"运行 Tab 渲染出三张空卡片。传进去的是整个 ",{"type":23,"tag":99,"props":11720,"children":11722},{"className":11721},[],[11723],{"type":28,"value":10339},{"type":28,"value":11725}," 响应，",{"type":23,"tag":99,"props":11727,"children":11729},{"className":11728},[],[11730],{"type":28,"value":11731},"runData.incidents",{"type":28,"value":11733}," 成了对象 ",{"type":23,"tag":99,"props":11735,"children":11737},{"className":11736},[],[11738],{"type":28,"value":11739},"{activeCount, hasActiveFailure, incidents:[…]}",{"type":28,"value":287},{"type":23,"tag":99,"props":11742,"children":11744},{"className":11743},[],[11745],{"type":28,"value":11746},"incidents.length === 0",{"type":28,"value":11748}," 永远不成立，",{"type":23,"tag":99,"props":11750,"children":11752},{"className":11751},[],[11753],{"type":28,"value":11754},"v-for",{"type":28,"value":11756}," 遍历的是这个对象的三个值。",{"type":23,"tag":403,"props":11758,"children":11759},{},[11760,11762,11768,11770,11775,11777,11783],{"type":28,"value":11761},"非项目成员在运行 Tab 看到「暂无活跃故障」。组件判断的是 ",{"type":23,"tag":99,"props":11763,"children":11765},{"className":11764},[],[11766],{"type":28,"value":11767},"runData.authorized === false",{"type":28,"value":11769},"，可 ",{"type":23,"tag":99,"props":11771,"children":11773},{"className":11772},[],[11774],{"type":28,"value":10339},{"type":28,"value":11776}," 返回的字段叫 ",{"type":23,"tag":99,"props":11778,"children":11780},{"className":11779},[],[11781],{"type":28,"value":11782},"hasPermission",{"type":28,"value":11784},"。没权限被显示成了一切正常。",{"type":23,"tag":24,"props":11786,"children":11787},{},[11788,11790,11796,11798,11804,11806,11812,11814,11820,11822,11828],{"type":28,"value":11789},"另外三处是：关联 IDE 节点区块永远为空，因为 ",{"type":23,"tag":99,"props":11791,"children":11793},{"className":11792},[],[11794],{"type":28,"value":11795},"getTableRunStatus",{"type":28,"value":11797}," 只有定义没有调用点；从深链 ",{"type":23,"tag":99,"props":11799,"children":11801},{"className":11800},[],[11802],{"type":28,"value":11803},"?tab=run-status",{"type":28,"value":11805}," 进来不加载数据，因为 ",{"type":23,"tag":99,"props":11807,"children":11809},{"className":11808},[],[11810],{"type":28,"value":11811},"watch(activeTab)",{"type":28,"value":11813}," 没加 ",{"type":23,"tag":99,"props":11815,"children":11817},{"className":11816},[],[11818],{"type":28,"value":11819},"immediate",{"type":28,"value":11821},"；切换表时沿用上一张表的健康数据，因为 ",{"type":23,"tag":99,"props":11823,"children":11825},{"className":11824},[],[11826],{"type":28,"value":11827},"loadFullData()",{"type":28,"value":11829}," 开头写着「已有数据就直接返回」。",{"type":23,"tag":24,"props":11831,"children":11832},{},[11833,11835,11841,11842,11848],{"type":28,"value":11834},"查到底才发现，给两个 Tab 准备的懒加载端点 ",{"type":23,"tag":99,"props":11836,"children":11838},{"className":11837},[],[11839],{"type":28,"value":11840},"\u002Fquality-status",{"type":28,"value":2541},{"type":23,"tag":99,"props":11843,"children":11845},{"className":11844},[],[11846],{"type":28,"value":11847},"\u002Frun-status",{"type":28,"value":11849}," 一直都在，响应形状和组件的 props 完全对得上，组件本来就是照着它们写的，只是装载层从来没接上。所以前端这一步主要是接线：两个 Tab 改接各自的端点，组件对数据形状再做一层防御，以后再错配也只会退化成空态，不会渲染出乱码。几个加载函数都加了请求代次守卫：请求发出时记下是哪张表，结果回来时要是已经切到别的表，就把这份结果丢掉。快速切表时，旧请求晚回来的结果不会盖住新表的数据。",{"type":23,"tag":24,"props":11851,"children":11852},{},[11853],{"type":28,"value":11854},"健康点的判定改成已知异常优先：",{"type":23,"tag":24,"props":11856,"children":11857},{},[11858],{"type":23,"tag":65,"props":11859,"children":11862},{"alt":11860,"src":11861},"健康点判定顺序：先问有没有活跃失败，有就判红；再问有没有失败规则或活跃 Incident，有就判黄，缺了某一段也照样判黄；再问质量或运行是不是有一段没取到，是就判灰，提示质量数据暂不可用、无法判定健康状态；都没有才是绿；变更段不参与判定","\u002Fimages\u002Fblog\u002Fgenesis-table-detail\u002Fhealth-rule.svg",[],{"type":23,"tag":24,"props":11864,"children":11865},{},[11866,11868,11873],{"type":28,"value":11867},"有活跃失败是红，有失败规则或活跃 Incident 是黄；没有已知异常，但质量或运行有一段没取到，就判灰，提示写「质量数据暂不可用，无法判定健康状态」。缺一段，不能把另一段确实红了的情况盖掉。变更段不参与健康判定。两个 Tab 在段失败时显示「暂不可用」，不再显示「未绑定规则」或「暂无活跃故障」。",{"type":23,"tag":99,"props":11869,"children":11871},{"className":11870},[],[11872],{"type":28,"value":10339},{"type":28,"value":11874}," 整个请求失败时显示「加载失败」，审查之前这种情况会被说成无权限。前端测试从 113 个到 133 个。",{"type":23,"tag":50,"props":11876,"children":11878},{"id":11877},"还没做完的",[11879],{"type":28,"value":11877},{"type":23,"tag":24,"props":11881,"children":11882},{},[11883,11885,11890],{"type":28,"value":11884},"这次的证据是单测、类型检查和构建。后端那部分我没在 devbox 上起整套服务做冒烟：当时手上没有一套和生产隔离的后端环境，后端一起来，定时轮询、发布对账和 Flyway 迁移都会去碰生产，这不是一个重构任务能擅自做的事。当时定的是等下次生产部署后，用只读请求核一遍 ",{"type":23,"tag":99,"props":11886,"children":11888},{"className":11887},[],[11889],{"type":28,"value":10792},{"type":28,"value":11891},"，前端的运行时核验也一起放到那时候。",{"type":23,"tag":24,"props":11893,"children":11894},{},[11895,11897,11902,11904,11910],{"type":28,"value":11896},"还有两个尾巴。",{"type":23,"tag":99,"props":11898,"children":11900},{"className":11899},[],[11901],{"type":28,"value":10339},{"type":28,"value":11903}," 里的 changes 段前端没人渲染，",{"type":23,"tag":99,"props":11905,"children":11907},{"className":11906},[],[11908],{"type":28,"value":11909},"\u002Fide-nodes",{"type":28,"value":11911}," 端点也没有调用方，要么接到「最近变更」区块，要么删掉。段状态现在只有三态，查到了但确实没有数据的情况也算 OK，前端只能靠约定区分，后面想在后端补一个 EMPTY。",{"type":23,"tag":2730,"props":11913,"children":11914},{},[11915],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":11917},[11918,11919,11920,11921,11922,11923],{"id":10359,"depth":927,"text":10359},{"id":10738,"depth":927,"text":10741},{"id":11071,"depth":927,"text":11071},{"id":11250,"depth":927,"text":11250},{"id":11654,"depth":927,"text":11657},{"id":11877,"depth":927,"text":11877},"content:blog:2026-09-09-genesis-table-detail-truth.md","blog\u002F2026-09-09-genesis-table-detail-truth.md","blog\u002F2026-09-09-genesis-table-detail-truth",{"_path":11928,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":11929,"description":11930,"date":11931,"tags":11932,"body":11935,"_type":937,"_id":13225,"_source":939,"_file":13226,"_stem":13227,"_extension":942},"\u002Fblog\u002F2026-09-06-gmall-dw-on-genesis","在 Genesis 上一夜搭完电商数仓 V6，路上记下 30 个问题","照讲义在自己的平台上从零搭 gmall 数仓并挂上每日调度。先实调主链路，再一夜建仓，第二天迁调度引擎时被补发的旧调度打出一次 OOM，最后整理成 30 条问题台账。","2026-09-06",[46,11933,11934,5719],"数仓","端到端演练",{"type":20,"children":11936,"toc":13203},[11937,11946,11954,11959,11964,11969,11992,11997,12002,12031,12051,12056,12062,12074,12079,12084,12090,12095,12108,12113,12119,12132,12138,12143,12163,12169,12174,12180,12185,12342,12350,12371,12376,12384,12396,12432,12437,12442,12465,12497,12502,12507,12512,12518,12523,12562,12567,12635,12641,12649,12654,12667,12691,12696,12743,12748,12753,12758,12950,12955,12960,12965,12970,12991,13036,13049,13055,13099,13105,13146,13165,13178,13183,13188,13194,13199],{"type":23,"tag":24,"props":11938,"children":11939},{},[11940,11944],{"type":23,"tag":41,"props":11941,"children":11942},{"href":43},[11943],{"type":28,"value":46},{"type":28,"value":11945}," 是我在做的一站式数据平台，对标 DataWorks，面向中小团队自部署。单元测试和演示数据都证明不了数仓开发真能拿它干活，所以 2026 年 9 月 3 日晚上，我先在真实环境把主链路走了一遍：建节点、审核、发布、运行、制造故障、看 Incident（平台自动开的故障单）、看表指挥中心。然后照《电商数仓 V6.0》讲义第 4 部分，在平台上从零搭一套 gmall 数仓，凌晨 3 点建完，挂上了每日调度。第二天上午又把调度引擎从单机模式迁到集群模式，中间被补发的旧调度打出一次 OOM。",{"type":23,"tag":24,"props":11947,"children":11948},{},[11949],{"type":23,"tag":65,"props":11950,"children":11953},{"alt":11951,"src":11952},"gmall 数仓那两天的时间线：9 月 3 日 20:00 主链路实调，21:00 开始建仓，21:10 部署后复验发现 F5，21:23 热更新、21:24 复验通过，22:27 到 22:32 上线 F1、F3 的修复；9 月 4 日 03:00 建完挂调度，08:20 到 09:10 迁移 DS 中途 OOM，迁移后复验 57\u002F57，15:25 调度参数被 IDE 自动保存改写；出问题的节点标红","\u002Fimages\u002Fblog\u002Fgmall-dw\u002Ftimeline.svg",[],{"type":23,"tag":24,"props":11955,"children":11956},{},[11957],{"type":28,"value":11958},"下面按时间顺序记。素材是 9 月初那两天的落地和实调记录，环境地址和账号都删掉了。",{"type":23,"tag":50,"props":11960,"children":11962},{"id":11961},"开工前的家底",[11963],{"type":28,"value":11961},{"type":23,"tag":24,"props":11965,"children":11966},{},[11967],{"type":28,"value":11968},"开工前实查了一遍，能直接用的不多：",{"type":23,"tag":399,"props":11970,"children":11971},{},[11972,11977,11982,11987],{"type":23,"tag":403,"props":11973,"children":11974},{},[11975],{"type":28,"value":11976},"已有的电商项目 ecom_dw 是 V5 风格：ODS 是 DataX 平铺表，所有表只有一个分区，SQL 节点从没同步到调度引擎 DolphinScheduler（下面简称 DS）。",{"type":23,"tag":403,"props":11978,"children":11979},{},[11980],{"type":28,"value":11981},"业务库 gmall 有 49 张表，订单数据停在 2026-04-08，binlog 开着（ROW \u002F FULL，保留 30 天）；集群上没有 Flume、Maxwell，也没有 mock 数据生成器。",{"type":23,"tag":403,"props":11983,"children":11984},{},[11985],{"type":28,"value":11986},"DS 是一个元数据放在 H2 内存库里的 StandaloneServer，其他节点没有 Worker，Hive 客户端只装了一台机器。",{"type":23,"tag":403,"props":11988,"children":11989},{},[11990],{"type":28,"value":11991},"报表页的电商主题域全走演示快照，后端能读的库表被写死成了另一个项目的证券域 ADS 表。",{"type":23,"tag":24,"props":11993,"children":11994},{},[11995],{"type":28,"value":11996},"据此定了三件事。",{"type":23,"tag":24,"props":11998,"children":11999},{},[12000],{"type":28,"value":12001},"第一，新建项目 gmall，不复用 ecom_dw。V6.0 的 ODS 增量表是 Maxwell JSON 结构，和平铺 ODS 不兼容；新项目不碰旧数据，也正好把建项目、数据源、目录、节点、发布、调度完整走一遍。",{"type":23,"tag":24,"props":12003,"children":12004},{},[12005,12007,12013,12015,12021,12023,12029],{"type":28,"value":12006},"第二，采集层最小化模拟，但输出格式和讲义一致，让第 4 部分的 DDL 和 SQL 能逐字照用。课程自带的 mock jar 每天生成前一日的业务数据和行为日志；日志按 ",{"type":23,"tag":99,"props":12008,"children":12010},{"className":12009},[],[12011],{"type":28,"value":12012},"ts",{"type":28,"value":12014}," 分日期直接落 HDFS；全量表照讲义走 DataX；增量表用 Python 读 MySQL binlog（MySQL 记录每一行变更的日志），输出和 Maxwell 同格式的 JSON（",{"type":23,"tag":99,"props":12016,"children":12018},{"className":12017},[],[12019],{"type":28,"value":12020},"type \u002F ts \u002F data \u002F old",{"type":28,"value":12022},"，首日 ",{"type":23,"tag":99,"props":12024,"children":12026},{"className":12025},[],[12027],{"type":28,"value":12028},"bootstrap-insert",{"type":28,"value":12030},"）。Maxwell 本来就是干这件事的工具，读 binlog、吐 JSON，这里用一个脚本顶替它。日志和增量两条线都省掉了中间的 Kafka 和 Flume。",{"type":23,"tag":24,"props":12032,"children":12033},{},[12034,12036,12042,12044,12050],{"type":28,"value":12035},"第三，一表一节点。单节点先发布到生产，再由 WORKFLOW 画布节点 ",{"type":23,"tag":99,"props":12037,"children":12039},{"className":12038},[],[12040],{"type":28,"value":12041},"gmall_daily",{"type":28,"value":12043}," 引用它们编排成 DAG，每天 01:30 调度，参数 ",{"type":23,"tag":99,"props":12045,"children":12047},{"className":12046},[],[12048],{"type":28,"value":12049},"do_date=$[yyyy-MM-dd-1]",{"type":28,"value":287},{"type":23,"tag":24,"props":12052,"children":12053},{},[12054],{"type":28,"value":12055},"具体的活交给 AI 编码智能体：它以数仓开发的身份、用真实账号调平台 API，建仓时再去浏览器里抽查页面。约定了四条：全部走真实后端，演示数据和桩不算数；断点逐条记录、原子修复；挡住目标的平台 BUG 当场修；动环境的高风险操作只记录、给出步骤，由我拍板。",{"type":23,"tag":50,"props":12057,"children":12059},{"id":12058},"先把主链路走一遍用了-12-分钟",[12060],{"type":28,"value":12061},"先把主链路走一遍，用了 12 分钟",{"type":23,"tag":24,"props":12063,"children":12064},{},[12065,12067,12073],{"type":28,"value":12066},"实调 20:00 开始，用已有项目 ecom_dw 和两个真实账号：开发者账号建节点、提交，审核人账号（项目负责人）审核。节点里只有一句 ",{"type":23,"tag":99,"props":12068,"children":12070},{"className":12069},[],[12071],{"type":28,"value":12072},"SELECT 1 AS drill_ok",{"type":28,"value":287},{"type":23,"tag":24,"props":12075,"children":12076},{},[12077],{"type":28,"value":12078},"一共五步。建 SQL 节点、跑 9 项预检、提交审核，一次过，9 个检查器都有输出。审核通过后自动发布到生产、DS 生成定义，第一次发布失败了。手动运行，2 秒内成功、日志有内容，但执行记录是空的。故意弄一次失败，走 Incident 的确认和关闭，等了 2 分钟都没有 Incident。表指挥中心的质量、事件、变更三段都有返回，一次过。",{"type":23,"tag":24,"props":12080,"children":12081},{},[12082],{"type":28,"value":12083},"五步最后都通了，前提是补齐两处生产配置：生产 Hive 数据源和 DS 项目码，ecom_dw 实调前这两样都没有。查出来的 4 条问题里，两条 P0（挡住目标的那一级）都是静默失败：出错了，但哪里都不报。",{"type":23,"tag":76,"props":12085,"children":12087},{"id":12086},"故障发生了平台却看不见f2",[12088],{"type":28,"value":12089},"故障发生了，平台却看不见（F2）",{"type":23,"tag":24,"props":12091,"children":12092},{},[12093],{"type":28,"value":12094},"把 SQL 改成查一张不存在的表再跑，DS 两秒后报失败。然后我等了 2 分钟、4 个轮询周期，Incident 表里一行都没有。",{"type":23,"tag":24,"props":12096,"children":12097},{},[12098,12100,12106],{"type":28,"value":12099},"查下来，轮询器只读项目上的 ",{"type":23,"tag":99,"props":12101,"children":12103},{"className":12102},[],[12104],{"type":28,"value":12105},"ds_project_code",{"type":28,"value":12107},"，ecom_dw 这一列是 NULL，于是这个项目的工作流全被跳过；发布那边碰到同样的 NULL，却会回退到全局默认的 DS 项目码。结果是发布成功、轮询静默跳过，执行记录页一直是空的也是这个原因。当时生产上的 40 条 Incident 全来自配了项目码的项目，ecom_dw 一条都没有，这个项目就算出过故障，平台也看不见。",{"type":23,"tag":24,"props":12109,"children":12110},{},[12111],{"type":28,"value":12112},"补上项目码 26 秒后，Incident 出来了。从故障发生到平台知道，MTTD（平均发现时间）是 4 分 14 秒，其中 4 分钟耗在配置缺失上。代码的修法是让轮询器和实例列表也做同样的回退，附了回归测试。",{"type":23,"tag":76,"props":12114,"children":12116},{"id":12115},"incident-找不到是哪个节点f4",[12117],{"type":28,"value":12118},"Incident 找不到是哪个节点（F4）",{"type":23,"tag":24,"props":12120,"children":12121},{},[12122,12124,12130],{"type":28,"value":12123},"Incident 的 ",{"type":23,"tag":99,"props":12125,"children":12127},{"className":12126},[],[12128],{"type":28,"value":12129},"nodeId",{"type":28,"value":12131}," 是 NULL，血缘影响信号返回\"未找到关联表信息\"，质量重跑被跳过。反查节点只查一张任务映射表，而这张表只在画布工作流发布时写，单节点发布不写。修法是查不到映射时，按节点记录的 DS 任务码反查。",{"type":23,"tag":76,"props":12133,"children":12135},{"id":12134},"审核返回-200发布其实失败了f1f3",[12136],{"type":28,"value":12137},"审核返回 200，发布其实失败了（F1、F3）",{"type":23,"tag":24,"props":12139,"children":12140},{},[12141],{"type":28,"value":12142},"第一次审核通过，接口返回 200，节点却悄悄变成了 PUBLISH_FAILED：SQL 节点没绑数据源，项目也没配生产 Hive 数据源。审核人什么都不知道，只有服务端日志里有一条 ERROR。再往前看，预检把\"没有数据源\"当成不适用，判了通过，4 个依赖数据源的检查器跟着跳过，放行了一个注定发布失败的节点。",{"type":23,"tag":24,"props":12144,"children":12145},{},[12146,12148,12154,12155,12161],{"type":28,"value":12147},"修法有两处：审核响应带上自动发布的结果（",{"type":23,"tag":99,"props":12149,"children":12151},{"className":12150},[],[12152],{"type":28,"value":12153},"autoPublished",{"type":28,"value":639},{"type":23,"tag":99,"props":12156,"children":12158},{"className":12157},[],[12159],{"type":28,"value":12160},"publishError",{"type":28,"value":12162},"），前端按错误级别提示；SQL 节点没绑定、项目又没有生产 Hive 数据源时，预检直接报 ERROR 阻断。这两处 22:27–22:32 上线，失败和成功两条路径都在生产上复验过。另外，强制审核开关和 DS 项目码都没有 UI 或 API 入口，只能改库。",{"type":23,"tag":76,"props":12164,"children":12166},{"id":12165},"部署本身带进来的回退f5",[12167],{"type":28,"value":12168},"部署本身带进来的回退（F5）",{"type":23,"tag":24,"props":12170,"children":12171},{},[12172],{"type":28,"value":12173},"21:10 部署 HEAD 后复验，自动发布又报\"SQL 节点未绑定数据源\"。原来之前线上的镜像是用没提交的工作副本构建的，里面带着回退到项目生产数据源的逻辑，HEAD 里没有。旧镜像已经被覆盖，回滚不了，只能往前修，21:23 热更新。21:24 不改任何配置再复验：运行失败 4 秒后 Incident 出现，节点关联上了，质量和血缘信号也都有了。",{"type":23,"tag":50,"props":12175,"children":12177},{"id":12176},"一夜建仓dag-跑了三次才全绿",[12178],{"type":28,"value":12179},"一夜建仓，DAG 跑了三次才全绿",{"type":23,"tag":24,"props":12181,"children":12182},{},[12183],{"type":28,"value":12184},"建仓从 21:00 干到第二天 03:00，落地的东西如下：",{"type":23,"tag":533,"props":12186,"children":12187},{},[12188,12209],{"type":23,"tag":537,"props":12189,"children":12190},{},[12191],{"type":23,"tag":541,"props":12192,"children":12193},{},[12194,12199,12204],{"type":23,"tag":545,"props":12195,"children":12196},{},[12197],{"type":28,"value":12198},"层",{"type":23,"tag":545,"props":12200,"children":12201},{},[12202],{"type":28,"value":12203},"载体",{"type":23,"tag":545,"props":12205,"children":12206},{},[12207],{"type":28,"value":12208},"数量",{"type":23,"tag":561,"props":12210,"children":12211},{},[12212,12230,12248,12265,12283,12306,12324],{"type":23,"tag":541,"props":12213,"children":12214},{},[12215,12220,12225],{"type":23,"tag":568,"props":12216,"children":12217},{},[12218],{"type":28,"value":12219},"建表",{"type":23,"tag":568,"props":12221,"children":12222},{},[12223],{"type":28,"value":12224},"平台 SQL 执行，dev、prod 各一次",{"type":23,"tag":568,"props":12226,"children":12227},{},[12228],{"type":28,"value":12229},"79 张，讲义 DDL 只改 LOCATION",{"type":23,"tag":541,"props":12231,"children":12232},{},[12233,12238,12243],{"type":23,"tag":568,"props":12234,"children":12235},{},[12236],{"type":28,"value":12237},"采集",{"type":23,"tag":568,"props":12239,"children":12240},{},[12241],{"type":28,"value":12242},"SHELL 节点",{"type":23,"tag":568,"props":12244,"children":12245},{},[12246],{"type":28,"value":12247},"3 个：模拟业务系统、DataX 全量 17 张表、ADS 导出",{"type":23,"tag":541,"props":12249,"children":12250},{},[12251,12256,12260],{"type":23,"tag":568,"props":12252,"children":12253},{},[12254],{"type":28,"value":12255},"ODS 装载",{"type":23,"tag":568,"props":12257,"children":12258},{},[12259],{"type":28,"value":12242},{"type":23,"tag":568,"props":12261,"children":12262},{},[12263],{"type":28,"value":12264},"2 个：日志、业务库 30 张表",{"type":23,"tag":541,"props":12266,"children":12267},{},[12268,12273,12278],{"type":23,"tag":568,"props":12269,"children":12270},{},[12271],{"type":28,"value":12272},"DIM \u002F DWD \u002F DWS \u002F ADS",{"type":23,"tag":568,"props":12274,"children":12275},{},[12276],{"type":28,"value":12277},"SQL 节点",{"type":23,"tag":568,"props":12279,"children":12280},{},[12281],{"type":28,"value":12282},"7 \u002F 10 \u002F 13 \u002F 16 个",{"type":23,"tag":541,"props":12284,"children":12285},{},[12286,12291,12301],{"type":23,"tag":568,"props":12287,"children":12288},{},[12289],{"type":28,"value":12290},"编排",{"type":23,"tag":568,"props":12292,"children":12293},{},[12294,12296],{"type":28,"value":12295},"画布节点 ",{"type":23,"tag":99,"props":12297,"children":12299},{"className":12298},[],[12300],{"type":28,"value":12041},{"type":23,"tag":568,"props":12302,"children":12303},{},[12304],{"type":28,"value":12305},"57 个任务，107 条依赖",{"type":23,"tag":541,"props":12307,"children":12308},{},[12309,12314,12319],{"type":23,"tag":568,"props":12310,"children":12311},{},[12312],{"type":28,"value":12313},"质量",{"type":23,"tag":568,"props":12315,"children":12316},{},[12317],{"type":28,"value":12318},"数据质量规则",{"type":23,"tag":568,"props":12320,"children":12321},{},[12322],{"type":28,"value":12323},"6 条，全部通过",{"type":23,"tag":541,"props":12325,"children":12326},{},[12327,12332,12337],{"type":23,"tag":568,"props":12328,"children":12329},{},[12330],{"type":28,"value":12331},"展示",{"type":23,"tag":568,"props":12333,"children":12334},{},[12335],{"type":28,"value":12336},"Genesis 报表、Superset",{"type":23,"tag":568,"props":12338,"children":12339},{},[12340],{"type":28,"value":12341},"5 个报表 16 个组件；1 个看板 11 张图",{"type":23,"tag":24,"props":12343,"children":12344},{},[12345],{"type":23,"tag":65,"props":12346,"children":12349},{"alt":12347,"src":12348},"gmall 数仓结构：模拟业务系统产出行为日志、全量表 17 张（DataX）、增量表（Python 读 binlog 输出 Maxwell 格式 JSON）三条线，经 ODS 装载（SHELL 节点 2 个），进入 DIM 7、DWD 10、DWS 13、ADS 16 个 SQL 节点，再由 ADS 导出写回 MySQL，供 5 个 Genesis 报表和 1 个 Superset 看板使用；底部是 gmall_daily 的规模：57 个任务、107 条依赖、每天 01:30 调度","\u002Fimages\u002Fblog\u002Fgmall-dw\u002Fwarehouse-layers.svg",[],{"type":23,"tag":24,"props":12351,"children":12352},{},[12353,12355,12361,12363,12369],{"type":28,"value":12354},"57 个任务里，51 个引用已发布节点，6 个是层与层之间的门控 SHELL。首日（2026-09-02）的 4 组 init 脚本一共 28 段 SQL，用平台的 SQL 执行接口手工跑了一次；从 09-03 起，46 个 SQL 节点由 DAG 驱动。讲义正文里 ",{"type":23,"tag":99,"props":12356,"children":12358},{"className":12357},[],[12359],{"type":28,"value":12360},"dwd_trade_order_detail_inc",{"type":28,"value":12362}," 的每日脚本把分区写死成了 ",{"type":23,"tag":99,"props":12364,"children":12366},{"className":12365},[],[12367],{"type":28,"value":12368},"dt='2022-06-09'",{"type":28,"value":12370},"，是笔误，我改成了参数。",{"type":23,"tag":24,"props":12372,"children":12373},{},[12374],{"type":28,"value":12375},"两个业务日的量级：ODS 日志 1344 \u002F 1311 行；ODS 订单增量首日 4749 行（bootstrap 全量快照），次日 403 行（binlog 变更）；DWD 订单明细 7029 \u002F 276 行；ADS 省份交易统计两天都是 102 行。",{"type":23,"tag":24,"props":12377,"children":12378},{},[12379],{"type":23,"tag":65,"props":12380,"children":12383},{"alt":12381,"src":12382},"处理 09-03 这一天 DAG 跑了三次：第 1 次 56\u002F57，集群开了输出压缩，ADS 文本表写成 .deflate，DataX 按纯文本读导致导出失败；第 2 次 56\u002F57，3 行脏数据的省份、品类维度为 NULL，被 MySQL 主键拒收；第 3 次 57\u002F57。下半部分是第 2 次的根因链：binlog 不带列名，增量 JSON 列名变成 UNKNOWN_COL，ODS 增量表整表 NULL，DWD 静默产出 276 行 NULL，一路流到 ADS 和导出，最后被 MySQL 主键挡住","\u002Fimages\u002Fblog\u002Fgmall-dw\u002Fdag-runs.svg",[],{"type":23,"tag":24,"props":12385,"children":12386},{},[12387,12389,12394],{"type":28,"value":12388},"处理 09-03 这一天，DAG 一共跑了三次。第一次 56\u002F57，导出失败：集群开了输出压缩，ADS 文本表被写成 ",{"type":23,"tag":99,"props":12390,"children":12392},{"className":12391},[],[12393],{"type":28,"value":5677},{"type":28,"value":12395},"，DataX 按纯文本读，报\"源头读取字段数:1 与 目的表要写入的字段数:N 不相等\"。第二次还是 56\u002F57，导出照样失败，这回是 3 行脏数据的省份、品类维度为 NULL，被 MySQL 主键的 NOT NULL 拒收。第三次 57\u002F57，16 张表的导出也都过了。",{"type":23,"tag":24,"props":12397,"children":12398},{},[12399,12401,12407,12408,12414,12416,12422,12424,12430],{"type":28,"value":12400},"第二次那个失败一路追到了采集层。增量 JSON 里的列名是 ",{"type":23,"tag":99,"props":12402,"children":12404},{"className":12403},[],[12405],{"type":28,"value":12406},"UNKNOWN_COL0",{"type":28,"value":2541},{"type":23,"tag":99,"props":12409,"children":12411},{"className":12410},[],[12412],{"type":28,"value":12413},"UNKNOWN_COL1",{"type":28,"value":12415},"……因为 MySQL 8.0 默认 ",{"type":23,"tag":99,"props":12417,"children":12419},{"className":12418},[],[12420],{"type":28,"value":12421},"binlog_row_metadata=MINIMAL",{"type":28,"value":12423},"，binlog 里只有值、不带列名。ODS 增量表于是整表解析成 NULL，DWD 照样静默产出 276 行全 NULL 的数据，一路流到 ADS 并被导出，最后是 MySQL 的主键约束把它挡住了。采集脚本改成按 ",{"type":23,"tag":99,"props":12425,"children":12427},{"className":12426},[],[12428],{"type":28,"value":12429},"information_schema",{"type":28,"value":12431}," 里的列序补列名，集群侧建议改成 FULL。",{"type":23,"tag":24,"props":12433,"children":12434},{},[12435],{"type":28,"value":12436},"这条暴露出来的平台问题比脚本问题更大：当时项目没配质量规则，平台也没有产出行数、空值率这类默认基线，276 行全是 NULL 也没有任何一环拦下来。后来补了 6 条规则（关键维度非空 + 当日产出行数），但还没放进 DAG 里跑，下一步是挂到 ADS 层之后，失败就阻断导出。",{"type":23,"tag":24,"props":12438,"children":12439},{},[12440],{"type":28,"value":12441},"输出压缩，以及另一条\"任何 map-join 都失败\"，现在都靠在项目 Hive 数据源的 jdbcUrl 上加会话参数绕过去：",{"type":23,"tag":2152,"props":12443,"children":12445},{"className":9129,"code":12444,"language":9131,"meta":8,"style":8},"hive.exec.submit.local.task.via.child=false\nhive.exec.compress.output=false\n",[12446],{"type":23,"tag":99,"props":12447,"children":12448},{"__ignoreMap":8},[12449,12457],{"type":23,"tag":2161,"props":12450,"children":12451},{"class":2163,"line":2164},[12452],{"type":23,"tag":2161,"props":12453,"children":12454},{},[12455],{"type":28,"value":12456},"hive.exec.submit.local.task.via.child=false\n",{"type":23,"tag":2161,"props":12458,"children":12459},{"class":2163,"line":927},[12460],{"type":23,"tag":2161,"props":12461,"children":12462},{},[12463],{"type":28,"value":12464},"hive.exec.compress.output=false\n",{"type":23,"tag":24,"props":12466,"children":12467},{},[12468,12470,12475,12477,12483,12485,12490,12491,12496],{"type":28,"value":12469},"map-join 是 Hive 把小表先加载进内存再去关联大表的做法，加载小表这一步会在本地起一个子 JVM。那条的根因藏得很深：HiveServer2 的 ",{"type":23,"tag":99,"props":12471,"children":12473},{"className":12472},[],[12474],{"type":28,"value":5653},{"type":28,"value":12476}," 挂了 Prometheus 的 JMX javaagent，绑的是固定端口，本地任务的子 JVM 继承了这个参数又去绑一次，一启动就 ",{"type":23,"tag":99,"props":12478,"children":12480},{"className":12479},[],[12481],{"type":28,"value":12482},"BindException: Address already in use",{"type":28,"value":12484},"。第一个参数让本地任务改在 HiveServer2 进程里跑；第二个只影响文本表写出，不影响 ORC 层。要根治得改 ",{"type":23,"tag":99,"props":12486,"children":12488},{"className":12487},[],[12489],{"type":28,"value":5645},{"type":28,"value":1148},{"type":23,"tag":99,"props":12492,"children":12494},{"className":12493},[],[12495],{"type":28,"value":9979},{"type":28,"value":287},{"type":23,"tag":50,"props":12498,"children":12500},{"id":12499},"第二天上午迁调度引擎",[12501],{"type":28,"value":12499},{"type":23,"tag":24,"props":12503,"children":12504},{},[12505],{"type":28,"value":12506},"DS 跑在 H2 内存库上这件事，前一晚就记成了环境 P0，按约定没顺手处理。第二天上午排查 Worker 才发现，它压根没跑起来过。集群上只有一个 2026-04-27 起运行、已经跑了约 129 天的 StandaloneServer，运维脚本管的是另一套从来没启动过的集群模式。MySQL 里的 DS 元数据库停在 2026-04-22，只有 18 条定义，在线的 DS 里却有 60 多条 5 到 9 月的定义，集群规划文档里还写着集群模式。H2 内存库的数据只在进程里，这个进程只要重启一次，发布过去的工作流、调度和实例历史就全没了。",{"type":23,"tag":24,"props":12508,"children":12509},{},[12510],{"type":28,"value":12511},"08:20–09:10 迁到集群模式 + MySQL 元数据，顺序是：把 H2 里 4 个项目 142 个定义和 3 条调度导出备份，给其余 Worker 节点分发 Hive 客户端和采集脚本，停掉 Standalone，起集群，重建定义。中间连着踩了几个坑。",{"type":23,"tag":76,"props":12513,"children":12515},{"id":12514},"判活永远为真配置整份没加载",[12516],{"type":28,"value":12517},"判活永远为真，配置整份没加载",{"type":23,"tag":24,"props":12519,"children":12520},{},[12521],{"type":28,"value":12522},"集群运维脚本对 Master、Worker 一律显示\"已运行\"然后跳过，实际上什么都没起。判活就这一行：",{"type":23,"tag":2152,"props":12524,"children":12526},{"className":5795,"code":12525,"language":5797,"meta":8,"style":8},"ssh \u003Chost> \"pgrep -f 'MasterServer'\"\n",[12527],{"type":23,"tag":99,"props":12528,"children":12529},{"__ignoreMap":8},[12530],{"type":23,"tag":2161,"props":12531,"children":12532},{"class":2163,"line":2164},[12533,12538,12542,12547,12552,12557],{"type":23,"tag":2161,"props":12534,"children":12535},{"style":5824},[12536],{"type":28,"value":12537},"ssh",{"type":23,"tag":2161,"props":12539,"children":12540},{"style":5948},[12541],{"type":28,"value":6615},{"type":23,"tag":2161,"props":12543,"children":12544},{"style":5855},[12545],{"type":28,"value":12546},"hos",{"type":23,"tag":2161,"props":12548,"children":12549},{"style":5830},[12550],{"type":28,"value":12551},"t",{"type":23,"tag":2161,"props":12553,"children":12554},{"style":5948},[12555],{"type":28,"value":12556},">",{"type":23,"tag":2161,"props":12558,"children":12559},{"style":5855},[12560],{"type":28,"value":12561}," \"pgrep -f 'MasterServer'\"\n",{"type":23,"tag":24,"props":12563,"children":12564},{},[12565],{"type":28,"value":12566},"远端 shell 自己的命令行里就带着这个关键字，pgrep 匹配到的是它自己，结果永远为真；脚本也不认识 StandaloneServer，stop 停不掉它。这次没改脚本，改用 DS 自带的 daemon 脚本一个个起。",{"type":23,"tag":24,"props":12568,"children":12569},{},[12570,12572,12578,12580,12586,12588,12594,12596,12602,12604,12610,12611,12617,12619,12625,12627,12633],{"type":28,"value":12571},"起来以后，Master、Worker、Api 一启动就退出，报 ",{"type":23,"tag":99,"props":12573,"children":12575},{"className":12574},[],[12576],{"type":28,"value":12577},"No qualifying bean of type Registry",{"type":28,"value":12579},"，Spring 的条件报告显示 ",{"type":23,"tag":99,"props":12581,"children":12583},{"className":12582},[],[12584],{"type":28,"value":12585},"registry.type",{"type":28,"value":12587}," 这个属性不存在。原因是 ",{"type":23,"tag":99,"props":12589,"children":12591},{"className":12590},[],[12592],{"type":28,"value":12593},"bin\u002Fenv\u002Fdolphinscheduler_env.sh",{"type":28,"value":12595}," 里有一行后加的 ",{"type":23,"tag":99,"props":12597,"children":12599},{"className":12598},[],[12600],{"type":28,"value":12601},"export DOLPHINSCHEDULER_HOME=\u003C安装目录>",{"type":28,"value":12603},"，各模块的 ",{"type":23,"tag":99,"props":12605,"children":12607},{"className":12606},[],[12608],{"type":28,"value":12609},"start.sh",{"type":28,"value":10373},{"type":23,"tag":99,"props":12612,"children":12614},{"className":12613},[],[12615],{"type":28,"value":12616},"${DOLPHINSCHEDULER_HOME:-模块目录}",{"type":28,"value":12618}," 拼 classpath，于是指向了一个不存在的顶层 ",{"type":23,"tag":99,"props":12620,"children":12622},{"className":12621},[],[12623],{"type":28,"value":12624},"conf\u002F",{"type":28,"value":12626},"，整份 ",{"type":23,"tag":99,"props":12628,"children":12630},{"className":12629},[],[12631],{"type":28,"value":12632},"application.yaml",{"type":28,"value":12634}," 都没加载，Jetty 起在默认端口上也印证了这一点。删掉这行（留了备份）就好了。",{"type":23,"tag":76,"props":12636,"children":12638},{"id":12637},"补发的旧调度把主节点打到-oom",[12639],{"type":28,"value":12640},"补发的旧调度把主节点打到 OOM",{"type":23,"tag":24,"props":12642,"children":12643},{},[12644],{"type":23,"tag":65,"props":12645,"children":12648},{"alt":12646,"src":12647},"DS 集群模式起来不到 1 分钟主节点 OOM 的经过：MySQL 元数据库里 2 条 4 月遗留的每日调度状态仍是 ONLINE；Quartz 按 misfire 策略补发，生成 82 条调度命令；Master 并发跑旧的 DataX 全量脚本，拉起 110 个约 300MB 的 JVM，再叠上 DS 默认的 -Xms4g ×2；OOM killer 杀掉 mysqld，NameNode、ZooKeeper、ResourceManager、HiveServer2、Metastore 跟着全倒。右侧是处理办法和教训","\u002Fimages\u002Fblog\u002Fgmall-dw\u002Fds-oom.svg",[],{"type":23,"tag":24,"props":12650,"children":12651},{},[12652],{"type":28,"value":12653},"集群模式起来不到 1 分钟，主节点内存耗尽，内核的 OOM killer 要挑一个进程杀掉腾内存，挑中的是 mysqld。而 Hive 元数据、DS 元数据和业务库都在这个实例上，NameNode、ZooKeeper、ResourceManager、HiveServer2、Metastore 跟着全倒。",{"type":23,"tag":24,"props":12655,"children":12656},{},[12657,12659,12665],{"type":28,"value":12658},"原因是 MySQL 元数据库里还躺着两条 4 月遗留、状态仍是 ONLINE 的每日调度。DS 的定时触发靠 Quartz，Quartz 对\"错过的触发\"（misfire）有补发策略，启动时把错过的触发全补发了，命令表一下生成 82 条调度命令。Master 并发执行旧的 DataX 全量脚本，拉起 110 个 JVM，每个约 300MB，再叠上 DS 默认的 ",{"type":23,"tag":99,"props":12660,"children":12662},{"className":12661},[],[12663],{"type":28,"value":12664},"-Xms4g",{"type":28,"value":12666}," ×2。",{"type":23,"tag":24,"props":12668,"children":12669},{},[12670,12672,12677,12679,12684,12685,12690],{"type":28,"value":12671},"处理是清空 ",{"type":23,"tag":99,"props":12673,"children":12675},{"className":12674},[],[12676],{"type":28,"value":5462},{"type":28,"value":12678},"，把 180 个残留的 RUNNING 实例置成 FAILURE，下线遗留调度；Master\u002FWorker 堆调到 512m–2g，Api 1g，Alert 512m；Hadoop、Hive、ZooKeeper 逐个恢复，HA 状态正常。教训是迁移前一定先清 ",{"type":23,"tag":99,"props":12680,"children":12682},{"className":12681},[],[12683],{"type":28,"value":5462},{"type":28,"value":1148},{"type":23,"tag":99,"props":12686,"children":12688},{"className":12687},[],[12689],{"type":28,"value":5470},{"type":28,"value":287},{"type":23,"tag":76,"props":12692,"children":12694},{"id":12693},"剩下三处环境问题",[12695],{"type":28,"value":12693},{"type":23,"tag":399,"props":12697,"children":12698},{},[12699,12711,12724],{"type":23,"tag":403,"props":12700,"children":12701},{},[12702,12704,12710],{"type":28,"value":12703},"任务以 DS 默认租户执行，读不到只对属主可读的采集配置。新建一个和旧环境一致的租户后，DS 3.2.2 的用户更新接口对管理员账号报错，只好直接改元数据库里的 ",{"type":23,"tag":99,"props":12705,"children":12707},{"className":12706},[],[12708],{"type":28,"value":12709},"tenant_id",{"type":28,"value":287},{"type":23,"tag":403,"props":12712,"children":12713},{},[12714,12716,12722],{"type":28,"value":12715},"有一台 Worker 用 Docker 网桥地址注册，派给它的任务必然超时。DS 3.2 取的是第一块非回环网卡，配 ",{"type":23,"tag":99,"props":12717,"children":12719},{"className":12718},[],[12720],{"type":28,"value":12721},"dolphin.scheduler.network.interface.preferred",{"type":28,"value":12723}," 指定网卡就好了。",{"type":23,"tag":403,"props":12725,"children":12726},{},[12727,12729,12734,12736,12741],{"type":28,"value":12728},"有一台 Worker 上的 SQL 任务全部 ",{"type":23,"tag":99,"props":12730,"children":12732},{"className":12731},[],[12733],{"type":28,"value":5551},{"type":28,"value":12735},"。根子还是 ",{"type":23,"tag":99,"props":12737,"children":12739},{"className":12738},[],[12740],{"type":28,"value":5543},{"type":28,"value":12742},"：env 文件的路径靠它拼，它要么指向不存在的目录、要么没设，DS 自己的 env 从来没生效过，任务一直是靠登录 shell 的 profile 拿到 Hive 的 PATH。这台机器碰巧缺那个文件，从别的 Worker 拷过去才好。",{"type":23,"tag":24,"props":12744,"children":12745},{},[12746],{"type":28,"value":12747},"迁移后 87 个已发布节点 resync 重建，调度基线按 H2 备份恢复。复验处理 do_date=2026-09-04：57\u002F57 成功，54 个子任务分散在 5 台 Worker 上，每台 9 到 13 个；DWD 订单明细当天 310 行，抽查的 4 张报表表最新分区都到了 09-04。迁移期间另有 6 次失败运行，都记进了台账：租户读不到配置 3 次，没有可派发的 Worker 1 次，Worker 缺登录环境 1 次，还有 1 次是执行中误触发的重复运行。",{"type":23,"tag":50,"props":12749,"children":12751},{"id":12750},"问题台账",[12752],{"type":28,"value":12750},{"type":23,"tag":24,"props":12754,"children":12755},{},[12756],{"type":28,"value":12757},"建仓过程的台账一共 30 条，平台代码 18 条，环境与文档偏差 12 条。P0 是挡住目标的，P1 是严重影响效率或正确性的，P2 是不好用的。",{"type":23,"tag":533,"props":12759,"children":12760},{},[12761,12787],{"type":23,"tag":537,"props":12762,"children":12763},{},[12764],{"type":23,"tag":541,"props":12765,"children":12766},{},[12767,12772,12777,12782],{"type":23,"tag":545,"props":12768,"children":12769},{},[12770],{"type":28,"value":12771},"类别",{"type":23,"tag":545,"props":12773,"children":12774},{},[12775],{"type":28,"value":12776},"条数（P0）",{"type":23,"tag":545,"props":12778,"children":12779},{},[12780],{"type":28,"value":12781},"典型问题",{"type":23,"tag":545,"props":12783,"children":12784},{},[12785],{"type":28,"value":12786},"处置",{"type":23,"tag":561,"props":12788,"children":12789},{},[12790,12813,12836,12859,12881,12904,12927],{"type":23,"tag":541,"props":12791,"children":12792},{},[12793,12798,12803,12808],{"type":23,"tag":568,"props":12794,"children":12795},{},[12796],{"type":28,"value":12797},"试跑",{"type":23,"tag":568,"props":12799,"children":12800},{},[12801],{"type":28,"value":12802},"6（2）",{"type":23,"tag":568,"props":12804,"children":12805},{},[12806],{"type":28,"value":12807},"队列与发布不一致、WITH 开头的写入被当成查询、试跑直连生产库、参数不替换",{"type":23,"tag":568,"props":12809,"children":12810},{},[12811],{"type":28,"value":12812},"2 条 P0 已修，其余记录",{"type":23,"tag":541,"props":12814,"children":12815},{},[12816,12821,12826,12831],{"type":23,"tag":568,"props":12817,"children":12818},{},[12819],{"type":28,"value":12820},"发布、编排与审核",{"type":23,"tag":568,"props":12822,"children":12823},{},[12824],{"type":28,"value":12825},"3（1）",{"type":23,"tag":568,"props":12827,"children":12828},{},[12829],{"type":28,"value":12830},"子工作流与 DS 3.2.2 不兼容、画布不能引用已发布节点、标准模式强制审核",{"type":23,"tag":568,"props":12832,"children":12833},{},[12834],{"type":28,"value":12835},"P0 已修，其余记录",{"type":23,"tag":541,"props":12837,"children":12838},{},[12839,12844,12849,12854],{"type":23,"tag":568,"props":12840,"children":12841},{},[12842],{"type":28,"value":12843},"报表",{"type":23,"tag":568,"props":12845,"children":12846},{},[12847],{"type":28,"value":12848},"3（2）",{"type":23,"tag":568,"props":12850,"children":12851},{},[12852],{"type":28,"value":12853},"库表名写死、登录态只有证券域读真实数据、缺参数返回 500",{"type":23,"tag":568,"props":12855,"children":12856},{},[12857],{"type":28,"value":12858},"2 条 P0 已修",{"type":23,"tag":541,"props":12860,"children":12861},{},[12862,12867,12871,12876],{"type":23,"tag":568,"props":12863,"children":12864},{},[12865],{"type":28,"value":12866},"IDE 与节点接口",{"type":23,"tag":568,"props":12868,"children":12869},{},[12870],{"type":28,"value":12825},{"type":23,"tag":568,"props":12872,"children":12873},{},[12874],{"type":28,"value":12875},"调度参数被自动保存覆盖、返回对象缺字段",{"type":23,"tag":568,"props":12877,"children":12878},{},[12879],{"type":28,"value":12880},"2 条已修",{"type":23,"tag":541,"props":12882,"children":12883},{},[12884,12889,12894,12899],{"type":23,"tag":568,"props":12885,"children":12886},{},[12887],{"type":28,"value":12888},"建项目、质量、监控",{"type":23,"tag":568,"props":12890,"children":12891},{},[12892],{"type":28,"value":12893},"3（0）",{"type":23,"tag":568,"props":12895,"children":12896},{},[12897],{"type":28,"value":12898},"dev 与 prod 库 LOCATION 相同、脏数据无拦截、统计卡片与列表口径不一致",{"type":23,"tag":568,"props":12900,"children":12901},{},[12902],{"type":28,"value":12903},"记录",{"type":23,"tag":541,"props":12905,"children":12906},{},[12907,12912,12917,12922],{"type":23,"tag":568,"props":12908,"children":12909},{},[12910],{"type":28,"value":12911},"环境：调度引擎",{"type":23,"tag":568,"props":12913,"children":12914},{},[12915],{"type":28,"value":12916},"7（3）",{"type":23,"tag":568,"props":12918,"children":12919},{},[12920],{"type":28,"value":12921},"H2 内存库、Worker 未部署、classpath、OOM、租户、网卡、PATH",{"type":23,"tag":568,"props":12923,"children":12924},{},[12925],{"type":28,"value":12926},"全部修复",{"type":23,"tag":541,"props":12928,"children":12929},{},[12930,12935,12940,12945],{"type":23,"tag":568,"props":12931,"children":12932},{},[12933],{"type":28,"value":12934},"环境：Hive、采集、脚本、文档",{"type":23,"tag":568,"props":12936,"children":12937},{},[12938],{"type":28,"value":12939},"5（1）",{"type":23,"tag":568,"props":12941,"children":12942},{},[12943],{"type":28,"value":12944},"map-join 端口冲突、输出压缩、binlog 无列名、判活自匹配、文档漂移",{"type":23,"tag":568,"props":12946,"children":12947},{},[12948],{"type":28,"value":12949},"2 条规避、1 条修复、2 条记录",{"type":23,"tag":24,"props":12951,"children":12952},{},[12953],{"type":28,"value":12954},"平台侧 6 条 P0 全修了。代价最大的几条都没有报错：审核返回 200 但发布失败，故障不产生 Incident，NULL 数据一路流到导出，调度参数被悄悄改写。修的时候都是往\"让失败露出来\"这个方向改，比如响应带上发布结果、预检把注定失败的情况判成 ERROR；把质量规则挂到导出之前也是这个思路，还没做完。",{"type":23,"tag":24,"props":12956,"children":12957},{},[12958],{"type":28,"value":12959},"还有一类是写和读两边的口径对不上。F2 是发布会回退、读的那边不会；F4 是映射表只有一种发布方式会写；下面调度面板那条是字段只写不读；执行记录页的统计卡片汇总所有项目，下面的列表却只看当前项目。这类问题单测很难发现，因为每一边单独测都是对的，真实走一遍链路才冒出来。下面挑三条细说。",{"type":23,"tag":76,"props":12961,"children":12963},{"id":12962},"试跑和生产走的是两条路",[12964],{"type":28,"value":12962},{"type":23,"tag":24,"props":12966,"children":12967},{},[12968],{"type":28,"value":12969},"试跑占了 6 条，说的其实是同一件事：试跑和发布后的执行走两套代码，两条 P0 都在这儿。",{"type":23,"tag":24,"props":12971,"children":12972},{},[12973,12975,12981,12983,12989],{"type":28,"value":12974},"一条是需要 MapReduce 的试跑一律报 ",{"type":23,"tag":99,"props":12976,"children":12978},{"className":12977},[],[12979],{"type":28,"value":12980},"Queue root.default is STOPPED",{"type":28,"value":12982},"，同一段 SQL 发布后却能跑。发布时按项目配置注入 ",{"type":23,"tag":99,"props":12984,"children":12986},{"className":12985},[],[12987],{"type":28,"value":12988},"SET mapreduce.job.queuename=",{"type":28,"value":12990},"，试跑不注入，落进了集群已经停用的 default 队列。修法是统一队列解析，试跑和发布用同一个队列。",{"type":23,"tag":24,"props":12992,"children":12993},{},[12994,12996,13002,13004,13010,13012,13018,13020,13026,13028,13034],{"type":28,"value":12995},"另一条是讲义里 ",{"type":23,"tag":99,"props":12997,"children":12999},{"className":12998},[],[13000],{"type":28,"value":13001},"dim_sku_full",{"type":28,"value":13003}," 这类 ",{"type":23,"tag":99,"props":13005,"children":13007},{"className":13006},[],[13008],{"type":28,"value":13009},"WITH ... INSERT OVERWRITE",{"type":28,"value":13011}," 脚本，试跑报 ",{"type":23,"tag":99,"props":13013,"children":13015},{"className":13014},[],[13016],{"type":28,"value":13017},"The query did not generate a result set!",{"type":28,"value":13019},"。数据源服务按第一个关键字猜这是查询还是更新，WITH 开头一律当查询走 ",{"type":23,"tag":99,"props":13021,"children":13023},{"className":13022},[],[13024],{"type":28,"value":13025},"executeQuery",{"type":28,"value":13027},"。修法是不猜了，改用 JDBC 的 ",{"type":23,"tag":99,"props":13029,"children":13031},{"className":13030},[],[13032],{"type":28,"value":13033},"execute()",{"type":28,"value":13035},"，按返回值判断有没有结果集。",{"type":23,"tag":24,"props":13037,"children":13038},{},[13039,13041,13047],{"type":28,"value":13040},"另外几条没修，但同样危险：节点绑了生产数据源时，dev 环境的试跑直接跑在生产库上，没有任何提示；试跑不替换调度参数，",{"type":23,"tag":99,"props":13042,"children":13044},{"className":13043},[],[13045],{"type":28,"value":13046},"select '${do_date}'",{"type":28,"value":13048}," 返回的是字面量；SHELL 节点试跑是在应用容器里本地执行，生产却在 DS Worker 上，环境完全不同。差一个队列、一个数据源路由、一次参数替换，就会出现试跑能过、上线就挂，或者反过来。",{"type":23,"tag":76,"props":13050,"children":13052},{"id":13051},"任务类型映射到了另一个-ds-版本",[13053],{"type":28,"value":13054},"任务类型映射到了另一个 DS 版本",{"type":23,"tag":24,"props":13056,"children":13057},{},[13058,13060,13066,13068,13074,13076,13082,13084,13090,13091,13097],{"type":28,"value":13059},"画布用子工作流引用已发布节点，发布时报 ",{"type":23,"tag":99,"props":13061,"children":13063},{"className":13062},[],[13064],{"type":28,"value":13065},"process node xxx parameter invalid",{"type":28,"value":13067},"。代码按 DS 3.3 映射成 ",{"type":23,"tag":99,"props":13069,"children":13071},{"className":13070},[],[13072],{"type":28,"value":13073},"SUB_WORKFLOW",{"type":28,"value":13075},"，参数用 ",{"type":23,"tag":99,"props":13077,"children":13079},{"className":13078},[],[13080],{"type":28,"value":13081},"workflowDefinitionCode",{"type":28,"value":13083},"；生产的 DS 是 3.2.2，要的是 ",{"type":23,"tag":99,"props":13085,"children":13087},{"className":13086},[],[13088],{"type":28,"value":13089},"SUB_PROCESS",{"type":28,"value":1148},{"type":23,"tag":99,"props":13092,"children":13094},{"className":13093},[],[13095],{"type":28,"value":13096},"processDefinitionCode",{"type":28,"value":13098},"。修法是按 DS 版本切换任务类型和参数名。画布前端也没有引用已发布节点的入口（这条没修），57 个任务的 DAG 是用 API 直接构造画布 JSON 搭出来的。",{"type":23,"tag":76,"props":13100,"children":13102},{"id":13101},"只写不读的字段碰上自动保存",[13103],{"type":28,"value":13104},"只写不读的字段，碰上自动保存",{"type":23,"tag":24,"props":13106,"children":13107},{},[13108,13110,13116,13118,13123,13125,13130,13131,13137,13139,13144],{"type":28,"value":13109},"这条最危险，发生在建完仓之后。已发布节点在 IDE 里打开，调度参数显示的是默认模板 ",{"type":23,"tag":99,"props":13111,"children":13113},{"className":13112},[],[13114],{"type":28,"value":13115},"bizdate=$[yyyyMMdd-1]",{"type":28,"value":13117},"，而 DS 里生效的是 ",{"type":23,"tag":99,"props":13119,"children":13121},{"className":13120},[],[13122],{"type":28,"value":12049},{"type":28,"value":13124},"。面板对调度字段做了 deep watch（字段里任何一层有变化都会触发），500ms 防抖后自动保存，切换节点、回填表单的时候就把默认模板整份写回了库。9 月 4 日 15:25，",{"type":23,"tag":99,"props":13126,"children":13128},{"className":13127},[],[13129],{"type":28,"value":13001},{"type":28,"value":2541},{"type":23,"tag":99,"props":13132,"children":13134},{"className":13133},[],[13135],{"type":28,"value":13136},"dwd_trade_cart_add_inc",{"type":28,"value":13138}," 就这样被改写了，随后 ",{"type":23,"tag":99,"props":13140,"children":13142},{"className":13141},[],[13143],{"type":28,"value":12041},{"type":28,"value":13145}," 画布也被改写，保存人是管理员账号，动作只是在 IDE 里切了一下 tab。",{"type":23,"tag":24,"props":13147,"children":13148},{},[13149,13151,13156,13158,13163],{"type":28,"value":13150},"DS 里的定义没变，运行不受影响；但这些节点只要重新发布，",{"type":23,"tag":99,"props":13152,"children":13154},{"className":13153},[],[13155],{"type":28,"value":1765},{"type":28,"value":13157}," 就替换不了，",{"type":23,"tag":99,"props":13159,"children":13161},{"className":13160},[],[13162],{"type":28,"value":8492},{"type":28,"value":13164}," 会静默读到空分区。",{"type":23,"tag":24,"props":13166,"children":13167},{},[13168,13170,13176],{"type":28,"value":13169},"根因有两层。节点返回对象里没有调度配置字段，更新请求却接收它，字段只写不读，面板拿不到真实值，就沿用默认值或者上一个 tab 的值；deep watch 在回填期间也触发了保存。修了三处：返回对象回显调度配置；回填期间不保存，切换节点时重置表单；预检加一项，代码里的 ",{"type":23,"tag":99,"props":13171,"children":13173},{"className":13172},[],[13174],{"type":28,"value":13175},"${var}",{"type":28,"value":13177}," 必须在调度参数或项目全局参数里有定义，否则 ERROR 阻断。恢复被改写的节点之前，新预检确实报出了\"未定义 ${do_date}\"。另外，已经打开的旧版 IDE 页面刷新前还是会覆盖，得硬刷新。",{"type":23,"tag":50,"props":13179,"children":13181},{"id":13180},"还没修的",[13182],{"type":28,"value":13180},{"type":23,"tag":24,"props":13184,"children":13185},{},[13186],{"type":28,"value":13187},"试跑直连生产库、dev 与 prod 库 LOCATION 相同、画布不能引用已发布节点、调度和报表用两套日期格式，这几条都还挂在台账上。前面那两个 Hive 参数也只是绕过去，根治要改 Hive 的配置文件。",{"type":23,"tag":50,"props":13189,"children":13191},{"id":13190},"后来接上真实数据交付给客户2026-年-11-月补记",[13192],{"type":28,"value":13193},"后来：接上真实数据，交付给客户（2026 年 11 月补记）",{"type":23,"tag":24,"props":13195,"children":13196},{},[13197],{"type":28,"value":13198},"这次是照讲义在平台上把整套数仓走通。之后，同一套模型接入了真实数据源，一路是爬虫采集的数据，一路是客户 ERP（聚水潭）的数据，作为 Genesis 上的电商数仓和主题看板，交付给了一家电商企业。客户的数据和业务细节不在这里展开。",{"type":23,"tag":2730,"props":13200,"children":13201},{},[13202],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":13204},[13205,13206,13212,13213,13218,13223,13224],{"id":11961,"depth":927,"text":11961},{"id":12058,"depth":927,"text":12061,"children":13207},[13208,13209,13210,13211],{"id":12086,"depth":924,"text":12089},{"id":12115,"depth":924,"text":12118},{"id":12134,"depth":924,"text":12137},{"id":12165,"depth":924,"text":12168},{"id":12176,"depth":927,"text":12179},{"id":12499,"depth":927,"text":12499,"children":13214},[13215,13216,13217],{"id":12514,"depth":924,"text":12517},{"id":12637,"depth":924,"text":12640},{"id":12693,"depth":924,"text":12693},{"id":12750,"depth":927,"text":12750,"children":13219},[13220,13221,13222],{"id":12962,"depth":924,"text":12962},{"id":13051,"depth":924,"text":13054},{"id":13101,"depth":924,"text":13104},{"id":13180,"depth":927,"text":13180},{"id":13190,"depth":927,"text":13193},"content:blog:2026-09-06-gmall-dw-on-genesis.md","blog\u002F2026-09-06-gmall-dw-on-genesis.md","blog\u002F2026-09-06-gmall-dw-on-genesis",{"_path":13229,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":13230,"description":13231,"date":13232,"tags":13233,"body":13237,"_type":937,"_id":13934,"_source":939,"_file":13935,"_stem":13936,"_extension":942},"\u002Fblog\u002F2026-08-30-local-ai-cluster-architecture","家里两台 DGX Spark：推理集群现在怎么搭的，之前换过几轮","两台 DGX Spark 现在用 vLLM 跨机 TP=2 跑 DeepSeek-V4-Flash。前面几轮方案为什么换、单机为什么卡在 23 tok\u002Fs，以及 LiteLLM 的别名全指向已经不在的后端那一次。","2026-08-30",[13234,13235,13236],"本地推理","vLLM","LLM",{"type":20,"children":13238,"toc":13926},[13239,13244,13256,13261,13266,13271,13276,13281,13286,13294,13315,13374,13385,13406,13411,13424,13488,13493,13498,13503,13655,13661,13669,13674,13721,13734,13739,13744,13773,13778,13783,13795,13800,13808,13813,13825,13830,13874,13902,13907,13912,13917,13922],{"type":23,"tag":24,"props":13240,"children":13241},{},[13242],{"type":28,"value":13243},"家里这两台 DGX Spark 现在只跑一个模型：DeepSeek-V4-Flash-0731，用 vLLM 跨两台机器做张量并行（TP=2）。Spark-1 是 head，整个集群只有它对外提供 OpenAI 兼容接口，机器上还留着 5 月搭的 Jupyter 微调环境；Spark-2 是 worker，不对外提供 API。",{"type":23,"tag":24,"props":13245,"children":13246},{},[13247,13249,13254],{"type":28,"value":13248},"这个现状是 8 月 22 日我 SSH 上去一台台核对出来的。在那之前，仓库里的集群文档和 LiteLLM 配置各写了一套部署，跟机器上实际跑着的都对不上。集群的最新状态我放在",{"type":23,"tag":41,"props":13250,"children":13252},{"href":13251},"\u002Fprojects\u002Flocal-ai-cluster\u002F",[13253],{"type":28,"value":988},{"type":28,"value":13255},"，这里记的是它怎么变成现在这样的。",{"type":23,"tag":50,"props":13257,"children":13259},{"id":13258},"两台机器和中间那两根线",[13260],{"type":28,"value":13258},{"type":23,"tag":24,"props":13262,"children":13263},{},[13264],{"type":28,"value":13265},"两台都是 GB10（Grace Blackwell），128GB LPDDR5x 统一内存，系统里实际能看到 121GB 左右，CPU 是 20 核 ARM。统一内存的意思是 CPU 和 GPU 共用这一块内存，模型权重、KV cache（模型为已经读过的上下文存下的中间结果，上下文越长占得越多）、系统本身都从这里面分。",{"type":23,"tag":24,"props":13267,"children":13268},{},[13269],{"type":28,"value":13270},"这块内存的带宽是 273 GB\u002Fs。大模型生成文字的阶段叫 decode，一次吐一个 token，每吐一个都要把用到的权重从内存里完整读一遍，所以单机 decode 能跑多快，基本就由这个带宽定了。后面会看到具体的数。",{"type":23,"tag":24,"props":13272,"children":13273},{},[13274],{"type":28,"value":13275},"128GB 听着不少，真挂上模型很快就满。5 月 4 日那版，Spark-1 同时挂着 gpt-oss-120b、Qwen3-Coder-30B 和 BGE-M3，实测用到 119GB，只剩 2GB 左右。同一天上午我把 gpt-oss-120b 的上下文从 32K 砍到 16K，同时加载的模型从 3 个减到 2 个，余量才回到 4–6GB。",{"type":23,"tag":24,"props":13277,"children":13278},{},[13279],{"type":28,"value":13280},"两台之间是两条 200GbE QSFP 直连线，分成管理面和数据面两组网段。早先做跨机 TP 的时候，我在 vLLM 官方镜像上叠了一层 RDMA 用户态库（rdma-core、libmlx5、perftest 这些），NCCL 的 IB 参数也直接写进镜像，想让 NCCL 走 RoCE v2。NCCL 是 NVIDIA 的多 GPU 通信库；RDMA 让网卡直接读写对方机器的内存，不经过 CPU 和内核网络栈；RoCE v2 就是跑在以太网上的 RDMA。",{"type":23,"tag":50,"props":13282,"children":13284},{"id":13283},"现在怎么搭的",[13285],{"type":28,"value":13283},{"type":23,"tag":24,"props":13287,"children":13288},{},[13289],{"type":23,"tag":65,"props":13290,"children":13293},{"alt":13291,"src":13292},"本地推理集群现状：调用方 Claude Code、CC Switch、OpenCode 经 Anthropic 或 OpenAI 协议调用 NAS 上的 LiteLLM，25 条别名全部指向 deepseek-v4-flash；LiteLLM 只转给 Spark-1；Spark-1 是 vLLM head、唯一对外接口，还有 Jupyter 微调环境和 dcgm-exporter；Spark-2 是 worker，不对外，跑 dcgm-exporter；两台同属一个 TP=2 组，中间两条 200GbE QSFP 直连；每台 GB10、128GB 统一内存、系统可见约 121GB、20 核 ARM","\u002Fimages\u002Fblog\u002Flocal-ai-cluster\u002Fcurrent-topology.svg",[],{"type":23,"tag":24,"props":13295,"children":13296},{},[13297,13299,13305,13307,13313],{"type":28,"value":13298},"两台跑的是同一个容器 ",{"type":23,"tag":99,"props":13300,"children":13302},{"className":13301},[],[13303],{"type":28,"value":13304},"deepseek-v4-flash-vllm-dspark-1",{"type":28,"value":13306},"，镜像用的是社区的 ",{"type":23,"tag":99,"props":13308,"children":13310},{"className":13309},[],[13311],{"type":28,"value":13312},"ghcr.io\u002Fanemll\u002Fdspark-vllm-gx10:0.1.1",{"type":28,"value":13314},"。启动命令去掉端口是这样：",{"type":23,"tag":2152,"props":13316,"children":13318},{"className":5795,"code":13317,"language":5797,"meta":8,"style":8},"vllm serve \u002Fcache\u002Fhuggingface\u002Fmodels\u002FDeepSeek-V4-Flash-0731 \\\n  --served-model-name deepseek-v4-flash-0731 \\\n  --tensor-parallel-size 2\n",[13319],{"type":23,"tag":99,"props":13320,"children":13321},{"__ignoreMap":8},[13322,13344,13361],{"type":23,"tag":2161,"props":13323,"children":13324},{"class":2163,"line":2164},[13325,13330,13335,13340],{"type":23,"tag":2161,"props":13326,"children":13327},{"style":5824},[13328],{"type":28,"value":13329},"vllm",{"type":23,"tag":2161,"props":13331,"children":13332},{"style":5855},[13333],{"type":28,"value":13334}," serve",{"type":23,"tag":2161,"props":13336,"children":13337},{"style":5855},[13338],{"type":28,"value":13339}," \u002Fcache\u002Fhuggingface\u002Fmodels\u002FDeepSeek-V4-Flash-0731",{"type":23,"tag":2161,"props":13341,"children":13342},{"style":5844},[13343],{"type":28,"value":5876},{"type":23,"tag":2161,"props":13345,"children":13346},{"class":2163,"line":927},[13347,13352,13357],{"type":23,"tag":2161,"props":13348,"children":13349},{"style":5844},[13350],{"type":28,"value":13351},"  --served-model-name",{"type":23,"tag":2161,"props":13353,"children":13354},{"style":5855},[13355],{"type":28,"value":13356}," deepseek-v4-flash-0731",{"type":23,"tag":2161,"props":13358,"children":13359},{"style":5844},[13360],{"type":28,"value":5876},{"type":23,"tag":2161,"props":13362,"children":13363},{"class":2163,"line":924},[13364,13369],{"type":23,"tag":2161,"props":13365,"children":13366},{"style":5844},[13367],{"type":28,"value":13368},"  --tensor-parallel-size",{"type":23,"tag":2161,"props":13370,"children":13371},{"style":5844},[13372],{"type":28,"value":13373}," 2\n",{"type":23,"tag":24,"props":13375,"children":13376},{},[13377,13383],{"type":23,"tag":99,"props":13378,"children":13380},{"className":13379},[],[13381],{"type":28,"value":13382},"--tensor-parallel-size 2",{"type":28,"value":13384}," 就是 TP=2：把每一层的权重切成两份，两台各算一半，每层算完两台之间要通信一次。一个 token 要过很多层，就要通信很多次，所以跨机 TP 对两机之间那条链路非常敏感。",{"type":23,"tag":24,"props":13386,"children":13387},{},[13388,13390,13396,13398,13404],{"type":28,"value":13389},"对外只有 Spark-1 一个入口，",{"type":23,"tag":99,"props":13391,"children":13393},{"className":13392},[],[13394],{"type":28,"value":13395},"\u002Fv1\u002Fmodels",{"type":28,"value":13397}," 返回 ",{"type":23,"tag":99,"props":13399,"children":13401},{"className":13400},[],[13402],{"type":28,"value":13403},"deepseek-v4-flash-0731",{"type":28,"value":13405},"。Spark-2 上以前那几个服务端口都已经没有响应，它只作为 TP 组里的 worker 存在。",{"type":23,"tag":24,"props":13407,"children":13408},{},[13409],{"type":28,"value":13410},"Spark-1 上的 Jupyter 微调环境和推理容器共存，工具栈是 5 月底装的：PyTorch 2.12.0+cu130、transformers 5.9.0、peft 0.19.1、accelerate 1.13.0、bitsandbytes 0.49.2。两台都跑着 dcgm-exporter，GPU 指标从这里采。",{"type":23,"tag":24,"props":13412,"children":13413},{},[13414,13416,13422],{"type":28,"value":13415},"调用方按设计不直连 Spark-1，统一走 NAS 上的 LiteLLM。LiteLLM 是一个模型网关：对外给一个统一的接口，按请求里的模型名（别名）转给后面真正的模型服务。它同时提供 OpenAI 和 Anthropic 两种协议，所以 Claude Code 把 ",{"type":23,"tag":99,"props":13417,"children":13419},{"className":13418},[],[13420],{"type":28,"value":13421},"ANTHROPIC_BASE_URL",{"type":28,"value":13423}," 指过来就能用本地模型，CC Switch 切换的也是这一层的模型名。",{"type":23,"tag":24,"props":13425,"children":13426},{},[13427,13429,13435,13436,13442,13443,13449,13450,13456,13458,13464,13465,13471,13472,13478,13480,13486],{"type":28,"value":13428},"配置里一共 25 条别名：",{"type":23,"tag":99,"props":13430,"children":13432},{"className":13431},[],[13433],{"type":28,"value":13434},"fast",{"type":28,"value":2541},{"type":23,"tag":99,"props":13437,"children":13439},{"className":13438},[],[13440],{"type":28,"value":13441},"smart",{"type":28,"value":2541},{"type":23,"tag":99,"props":13444,"children":13446},{"className":13445},[],[13447],{"type":28,"value":13448},"reasoning",{"type":28,"value":2541},{"type":23,"tag":99,"props":13451,"children":13453},{"className":13452},[],[13454],{"type":28,"value":13455},"batch",{"type":28,"value":13457}," 四条按用途分的语义路由；12 条给 Claude Code 用的兼容别名，像 ",{"type":23,"tag":99,"props":13459,"children":13461},{"className":13460},[],[13462],{"type":28,"value":13463},"claude-sonnet-4-20250514",{"type":28,"value":2541},{"type":23,"tag":99,"props":13466,"children":13468},{"className":13467},[],[13469],{"type":28,"value":13470},"claude-opus-4.7",{"type":28,"value":2541},{"type":23,"tag":99,"props":13473,"children":13475},{"className":13474},[],[13476],{"type":28,"value":13477},"claude-haiku-4.5",{"type":28,"value":13479}," 这种；剩下的是历史上用过的模型名，比如业务代码里写死的 ",{"type":23,"tag":99,"props":13481,"children":13483},{"className":13482},[],[13484],{"type":28,"value":13485},"qwen3.5-122b-a10b",{"type":28,"value":13487},"。现在这 25 条全部指向同一个后端。",{"type":23,"tag":50,"props":13489,"children":13491},{"id":13490},"之前换过的几轮",[13492],{"type":28,"value":13490},{"type":23,"tag":24,"props":13494,"children":13495},{},[13496],{"type":28,"value":13497},"现在这套之前，两台机器前后换了好几轮。下面按集群文档的版本记录整理，从 5 月初那版跨机 TP=2 开始，更早的 Ollama 多模型阵容就不列了。速度都是当时记下的 decode 数字。",{"type":23,"tag":24,"props":13499,"children":13500},{},[13501],{"type":28,"value":13502},"表里有几种量化格式。量化就是用更少的位数存权重，模型变小、读得也快，代价是精度会掉一点：FP8 每个参数 8 位，Q4_K_M 是 llama.cpp 系的 4 位格式，NVFP4 是 NVIDIA 的 4 位格式。",{"type":23,"tag":533,"props":13504,"children":13505},{},[13506,13526],{"type":23,"tag":537,"props":13507,"children":13508},{},[13509],{"type":23,"tag":541,"props":13510,"children":13511},{},[13512,13516,13521],{"type":23,"tag":545,"props":13513,"children":13514},{},[13515],{"type":28,"value":9671},{"type":23,"tag":545,"props":13517,"children":13518},{},[13519],{"type":28,"value":13520},"怎么搭的",{"type":23,"tag":545,"props":13522,"children":13523},{},[13524],{"type":28,"value":13525},"当时记下的情况",{"type":23,"tag":561,"props":13527,"children":13528},{},[13529,13547,13565,13583,13601,13619,13637],{"type":23,"tag":541,"props":13530,"children":13531},{},[13532,13537,13542],{"type":23,"tag":568,"props":13533,"children":13534},{},[13535],{"type":28,"value":13536},"5 月初",{"type":23,"tag":568,"props":13538,"children":13539},{},[13540],{"type":28,"value":13541},"vLLM + Ray 跨机 TP=2，跑 Qwen3.5-122B-A10B FP8",{"type":23,"tag":568,"props":13543,"children":13544},{},[13545],{"type":28,"value":13546},"decode 约 12 tok\u002Fs；FP8 权重约 120GB，一台放不下",{"type":23,"tag":541,"props":13548,"children":13549},{},[13550,13555,13560],{"type":23,"tag":568,"props":13551,"children":13552},{},[13553],{"type":28,"value":13554},"5 月 3 日",{"type":23,"tag":568,"props":13556,"children":13557},{},[13558],{"type":28,"value":13559},"放弃跨机，改 Ollama 单机：Spark-1 跑 122B 主力，Spark-2 跑编码、推理、兜底三个模型",{"type":23,"tag":568,"props":13561,"children":13562},{},[13563],{"type":28,"value":13564},"想去掉跨机通信开销，预期 25–35 tok\u002Fs",{"type":23,"tag":541,"props":13566,"children":13567},{},[13568,13573,13578],{"type":23,"tag":568,"props":13569,"children":13570},{},[13571],{"type":28,"value":13572},"5 月 4 日",{"type":23,"tag":568,"props":13574,"children":13575},{},[13576],{"type":28,"value":13577},"角色对调成双主力：Spark-2 只留 122B（Q4_K_M），Spark-1 跑 gpt-oss-120b 和 Qwen3-Coder-30B，LiteLLM 里三个模型互为回退",{"type":23,"tag":568,"props":13579,"children":13580},{},[13581],{"type":28,"value":13582},"122B 23.06、gpt-oss-120b 41.88、Coder-30B 54.88 tok\u002Fs",{"type":23,"tag":541,"props":13584,"children":13585},{},[13586,13591,13596],{"type":23,"tag":568,"props":13587,"children":13588},{},[13589],{"type":28,"value":13590},"随后",{"type":23,"tag":568,"props":13592,"children":13593},{},[13594],{"type":28,"value":13595},"TensorRT-LLM 跨机 TP=2 跑 Qwen3-235B-A22B NVFP4",{"type":23,"tag":568,"props":13597,"children":13598},{},[13599],{"type":28,"value":13600},"约 7 tok\u002Fs；EAGLE-3（一种推测解码）内存不够，峰值 116\u002F122GB，没开",{"type":23,"tag":541,"props":13602,"children":13603},{},[13604,13609,13614],{"type":23,"tag":568,"props":13605,"children":13606},{},[13607],{"type":28,"value":13608},"5 月 17 日核对",{"type":23,"tag":568,"props":13610,"children":13611},{},[13612],{"type":28,"value":13613},"Ollama 全停，两台都换成 vLLM Docker：Llama-3.3-70B NVFP4 和 Qwen3.5-35B-A3B FP8",{"type":23,"tag":568,"props":13615,"children":13616},{},[13617],{"type":28,"value":13618},"两台内存分别用到 101GB 和 110GB",{"type":23,"tag":541,"props":13620,"children":13621},{},[13622,13627,13632],{"type":23,"tag":568,"props":13623,"children":13624},{},[13625],{"type":28,"value":13626},"5 月 25 日",{"type":23,"tag":568,"props":13628,"children":13629},{},[13630],{"type":28,"value":13631},"Spark-1 停掉 70B 做微调，Spark-2 单机跑 35B",{"type":23,"tag":568,"props":13633,"children":13634},{},[13635],{"type":28,"value":13636},"Spark-1 腾出约 53GB",{"type":23,"tag":541,"props":13638,"children":13639},{},[13640,13645,13650],{"type":23,"tag":568,"props":13641,"children":13642},{},[13643],{"type":28,"value":13644},"8 月 22 日核对",{"type":23,"tag":568,"props":13646,"children":13647},{},[13648],{"type":28,"value":13649},"DeepSeek-V4-Flash-0731 跨两机 TP=2",{"type":23,"tag":568,"props":13651,"children":13652},{},[13653],{"type":28,"value":13654},"现状",{"type":23,"tag":50,"props":13656,"children":13658},{"id":13657},"单机为什么卡在-23-toks",[13659],{"type":28,"value":13660},"单机为什么卡在 23 tok\u002Fs",{"type":23,"tag":24,"props":13662,"children":13663},{},[13664],{"type":23,"tag":65,"props":13665,"children":13668},{"alt":13666,"src":13667},"几轮方案当时记下的 decode 速度条形图：Qwen3.5-122B FP8 用 vLLM 加 Ray 跨机 TP=2 约 12 tok\u002Fs，Qwen3.5-122B Q4_K_M 用 Ollama 单机 23.06，gpt-oss-120b 单机 41.88，Qwen3-Coder-30B 单机 54.88，Qwen3-235B NVFP4 用 TensorRT-LLM 跨机 TP=2 约 7；下方单独标出 122B 单机这一条：预期 25–35，实测 23，按 273 GB\u002Fs 带宽算的理论上限约 54，实测是理论值的 42%","\u002Fimages\u002Fblog\u002Flocal-ai-cluster\u002Fdecode-speed.svg",[],{"type":23,"tag":24,"props":13670,"children":13671},{},[13672],{"type":28,"value":13673},"5 月 3 日放弃跨机，是嫌 12 tok\u002Fs 太慢。当时判断时间都耗在跨机通信上，单机跑能到 25–35。第二天实测，122B 在 Spark-2 上只有 23 tok\u002Fs 左右。量化也从 FP8 换成了 Q4，两个数字不完全可比，但离预期差得不少。我又换了几组参数，跑同一个 500 token 的散文基准：",{"type":23,"tag":2152,"props":13675,"children":13677},{"className":2154,"code":13676,"language":28,"meta":8,"style":8},"FA=1, KV q8_0       23.07 tok\u002Fs\nKV F16              23.19 tok\u002Fs\nFA=0                22.85 tok\u002Fs\nnum_predict 100     22.96 tok\u002Fs\nnum_predict 1000    22.71 tok\u002Fs\n",[13678],{"type":23,"tag":99,"props":13679,"children":13680},{"__ignoreMap":8},[13681,13689,13697,13705,13713],{"type":23,"tag":2161,"props":13682,"children":13683},{"class":2163,"line":2164},[13684],{"type":23,"tag":2161,"props":13685,"children":13686},{},[13687],{"type":28,"value":13688},"FA=1, KV q8_0       23.07 tok\u002Fs\n",{"type":23,"tag":2161,"props":13690,"children":13691},{"class":2163,"line":927},[13692],{"type":23,"tag":2161,"props":13693,"children":13694},{},[13695],{"type":28,"value":13696},"KV F16              23.19 tok\u002Fs\n",{"type":23,"tag":2161,"props":13698,"children":13699},{"class":2163,"line":924},[13700],{"type":23,"tag":2161,"props":13701,"children":13702},{},[13703],{"type":28,"value":13704},"FA=0                22.85 tok\u002Fs\n",{"type":23,"tag":2161,"props":13706,"children":13707},{"class":2163,"line":2190},[13708],{"type":23,"tag":2161,"props":13709,"children":13710},{},[13711],{"type":28,"value":13712},"num_predict 100     22.96 tok\u002Fs\n",{"type":23,"tag":2161,"props":13714,"children":13715},{"class":2163,"line":2199},[13716],{"type":23,"tag":2161,"props":13717,"children":13718},{},[13719],{"type":28,"value":13720},"num_predict 1000    22.71 tok\u002Fs\n",{"type":23,"tag":24,"props":13722,"children":13723},{},[13724,13726,13732],{"type":28,"value":13725},"FA 是 Flash Attention 开关，KV 那几行是 KV cache 用什么精度存，",{"type":23,"tag":99,"props":13727,"children":13729},{"className":13728},[],[13730],{"type":28,"value":13731},"num_predict",{"type":28,"value":13733}," 是一次生成多少个 token。怎么调都在 23 上下。",{"type":23,"tag":24,"props":13735,"children":13736},{},[13737],{"type":28,"value":13738},"算一笔账就清楚了。122B-A10B 是 MoE 模型，总共 122B 参数，每个 token 只激活其中 10B。Q4 下生成一个 token，大约要从内存读 5GB，273 GB\u002Fs 的带宽，理论上限就是 54 tok\u002Fs，实测是理论值的 42%。同一台机器上 gpt-oss-120b 是 38%，差不多。decode 在这台机器上是被内存带宽卡住的，配置层已经没什么可调的了。调完只留下一个改动：KV cache 从 q8_0 改回默认的 F16，省掉 ARM 上的反量化开销，内存只多占 1GB。",{"type":23,"tag":24,"props":13740,"children":13741},{},[13742],{"type":28,"value":13743},"再往上只能靠算法，比如 speculative decoding（推测解码）：让一个小的草稿模型先猜几个 token，大模型一次把这几个一起验证掉，猜中的越多越快。我给它写了个 spike，事先设好一道决策门：拉完草稿模型（用的是 qwen2.5:0.5b），先确认参数能不能传到最底层，传不进去就停，不跑 benchmark。",{"type":23,"tag":24,"props":13745,"children":13746},{},[13747,13749,13755,13757,13763,13765,13771],{"type":28,"value":13748},"结果就停在了这一步。Ollama 0.22.1 在 ARM64 上默认用它自己的 ",{"type":23,"tag":99,"props":13750,"children":13752},{"className":13751},[],[13753],{"type":28,"value":13754},"--ollama-engine",{"type":28,"value":13756}," runner，而 ",{"type":23,"tag":99,"props":13758,"children":13760},{"className":13759},[],[13761],{"type":28,"value":13762},"OLLAMA_LLAMA_EXTRA_ARGS",{"type":28,"value":13764}," 是给 llama.cpp 后端准备的透传变量。systemd 那边变量确实注进去了，可 runner 进程的命令行里没有 ",{"type":23,"tag":99,"props":13766,"children":13768},{"className":13767},[],[13769],{"type":28,"value":13770},"--model-draft",{"type":28,"value":13772},"，日志里也一个字没提，就是静默忽略。前后 15 分钟，结论归档，这条路没再走。",{"type":23,"tag":24,"props":13774,"children":13775},{},[13776],{"type":28,"value":13777},"至于后来为什么又回到跨机 TP=2、换成 DeepSeek-V4-Flash，这一步当时没写进文档，也就有了下面那次核对。",{"type":23,"tag":50,"props":13779,"children":13781},{"id":13780},"配置里的后端一个都不在了",[13782],{"type":28,"value":13780},{"type":23,"tag":24,"props":13784,"children":13785},{},[13786,13788,13793],{"type":28,"value":13787},"8 月 21 日到 22 日，我在把一批散在工作区里的配置和脚本补进仓库，LiteLLM 的配置也在里面。入库前我挨个 curl 了配置里每个后端的 ",{"type":23,"tag":99,"props":13789,"children":13791},{"className":13790},[],[13792],{"type":28,"value":13395},{"type":28,"value":13794},"，四个后端全部返回 000。000 是 curl 在连接都没建起来、拿不到任何 HTTP 响应时给的状态码。这四个是 Spark-2 上的 GLM-5.2、Qwen3.6-35B 和 Qwen3.5-27B，以及 Spark-1 上的 Qwen3-Coder。",{"type":23,"tag":24,"props":13796,"children":13797},{},[13798],{"type":28,"value":13799},"NAS 上正在跑的 LiteLLM 用的是同一份配置。也就是说，当时经过 LiteLLM 的调用全都失败，Claude Code 那 12 条兼容别名也一样。",{"type":23,"tag":24,"props":13801,"children":13802},{},[13803],{"type":23,"tag":65,"props":13804,"children":13807},{"alt":13805,"src":13806},"核对时的三套说法：集群文档 §3.4 还是 v4.5.1 那版，写 Spark-2 跑 Qwen3.5-35B-A3B-FP8，已过时；LiteLLM 配置文件头写 v7.0，GLM-5.2 用 llama.cpp RPC 跨两机，四个后端 GLM-5.2、Qwen3.6-35B、Qwen3.5-27B、Qwen3-Coder，curl 全部返回 000；机器上实际是两台跑同一个 DeepSeek-V4-Flash-0731 容器、跨机 TP=2，Spark-1 的 \u002Fv1\u002Fmodels 返回 200。下方是修改：LiteLLM 配置升 v8.0，加 deepseek-v4-flash 后端，25 条别名改指过去；四个失效后端标 DISABLED-v8；集群文档加 v4.6.0 校正块。还没收尾的是 NAS 上运行的副本没同步、没重启","\u002Fimages\u002Fblog\u002Flocal-ai-cluster\u002Fthree-versions.svg",[],{"type":23,"tag":24,"props":13809,"children":13810},{},[13811],{"type":28,"value":13812},"配置文件头上写的还是 v7.0：GLM-5.2（744B 的 MoE，IQ1_S 量化，一种极低比特的量化）用 llama.cpp 的 RPC 模式跨两台机器跑，也就是把模型的不同层放到两台机器上，记着 prompt 约 21 tok\u002Fs、生成约 8.4 tok\u002Fs。再往前一段注释写的是，122B 跨机 TP=2 卡在 vLLM 0.20 的 Gloo 跨节点通信问题（Gloo 是 PyTorch 的一种通信后端），退回了 27B。",{"type":23,"tag":24,"props":13814,"children":13815},{},[13816,13818,13823],{"type":28,"value":13817},"SSH 上两台一看，跑的是同一个 DeepSeek-V4-Flash 容器，Spark-1 的 ",{"type":23,"tag":99,"props":13819,"children":13821},{"className":13820},[],[13822],{"type":28,"value":13395},{"type":28,"value":13824}," 返回 200。集群文档也是错的，§3.4 还写着 Spark-2 跑 Qwen3.5-35B-A3B-FP8。文档写一套，配置写另一套，机器上跑的是第三套。",{"type":23,"tag":24,"props":13826,"children":13827},{},[13828],{"type":28,"value":13829},"改的东西不多：",{"type":23,"tag":399,"props":13831,"children":13832},{},[13833,13846,13859,13864,13869],{"type":23,"tag":403,"props":13834,"children":13835},{},[13836,13838,13844],{"type":28,"value":13837},"LiteLLM 配置加一个 ",{"type":23,"tag":99,"props":13839,"children":13841},{"className":13840},[],[13842],{"type":28,"value":13843},"deepseek-v4-flash",{"type":28,"value":13845}," 后端指向 Spark-1，25 条别名全部改指过去；",{"type":23,"tag":403,"props":13847,"children":13848},{},[13849,13851,13857],{"type":28,"value":13850},"四个失效的后端没删，标成 ",{"type":23,"tag":99,"props":13852,"children":13854},{"className":13853},[],[13855],{"type":28,"value":13856},"DISABLED-v8",{"type":28,"value":13858},"，旁边写上 curl 的结论，留着对照；",{"type":23,"tag":403,"props":13860,"children":13861},{},[13862],{"type":28,"value":13863},"文件头补 v8.0 的说明，记下怎么查的、查到了什么，v7.0 那段标成已失效；",{"type":23,"tag":403,"props":13865,"children":13866},{},[13867],{"type":28,"value":13868},"集群文档 §3.4 顶上加一个 v4.6.0 校正块，原来 v4.5.1 的内容留作历史；",{"type":23,"tag":403,"props":13870,"children":13871},{},[13872],{"type":28,"value":13873},"OpenCode 的 provider 从外部的模型服务换成本地 LiteLLM，模型调用不再出网。",{"type":23,"tag":24,"props":13875,"children":13876},{},[13877,13879,13885,13887,13892,13894,13900],{"type":28,"value":13878},"改完在开发机上用 ",{"type":23,"tag":99,"props":13880,"children":13882},{"className":13881},[],[13883],{"type":28,"value":13884},"yaml.safe_load",{"type":28,"value":13886}," 把配置解析了一遍，确认 model_list 里没有重名，25 条别名去重以后只剩 ",{"type":23,"tag":99,"props":13888,"children":13890},{"className":13889},[],[13891],{"type":28,"value":13843},{"type":28,"value":13893}," 一个目标。OpenCode 的配置里还有一个 ",{"type":23,"tag":99,"props":13895,"children":13897},{"className":13896},[],[13898],{"type":28,"value":13899},"bge-m3",{"type":28,"value":13901},"，它在现在的 LiteLLM 里既不是模型名也不是别名，只在历史注释里出现过，调用肯定失败。这次只把它记在了提交说明里，没动。",{"type":23,"tag":50,"props":13903,"children":13905},{"id":13904},"还没收尾的",[13906],{"type":28,"value":13904},{"type":23,"tag":24,"props":13908,"children":13909},{},[13910],{"type":28,"value":13911},"这次改的是仓库里那份配置。NAS 上的 LiteLLM 挂的是它自己目录下的副本，要同步过去、再重启容器才算生效，这一步当时记成了后续事项。在那之前，走 LiteLLM 的调用还是失败的，直接打 Spark-1 接口的不受影响。",{"type":23,"tag":24,"props":13913,"children":13914},{},[13915],{"type":28,"value":13916},"还有个小尾巴：别名虽然都改指到了 DeepSeek，几条语义路由后面的注释还写着 Qwen3.6-35B，整段路由的标题注释还是\"全部路由 → Qwen3.5-122B-A10B TP=2\"。这种注释最容易跟着配置一起漂。",{"type":23,"tag":24,"props":13918,"children":13919},{},[13920],{"type":28,"value":13921},"这次能发现问题，靠的是入库前挨个 curl 了一遍后端。要知道机器上现在跑着什么，上机器看比翻文档靠谱。",{"type":23,"tag":2730,"props":13923,"children":13924},{},[13925],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":13927},[13928,13929,13930,13931,13932,13933],{"id":13258,"depth":927,"text":13258},{"id":13283,"depth":927,"text":13283},{"id":13490,"depth":927,"text":13490},{"id":13657,"depth":927,"text":13660},{"id":13780,"depth":927,"text":13780},{"id":13904,"depth":927,"text":13904},"content:blog:2026-08-30-local-ai-cluster-architecture.md","blog\u002F2026-08-30-local-ai-cluster-architecture.md","blog\u002F2026-08-30-local-ai-cluster-architecture",{"_path":13938,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":13939,"description":13940,"date":13941,"tags":13942,"body":13945,"_type":937,"_id":14630,"_source":939,"_file":14631,"_stem":14632,"_extension":942},"\u002Fblog\u002F2026-08-24-genesis-vite-preload-first-screen","首屏 JS 从 1462KB 降到 523KB：毛病出在一个 200 字节的预加载函数上","Vite 的预加载助手被分进了 monaco chunk，连登录页都得先下载整个 Monaco 编辑器。把它单独分一组，首屏 gzip 降到 523KB。","2026-08-24",[46,13943,13944],"前端性能","Vite",{"type":20,"children":13946,"toc":14622},[13947,13956,13961,13967,13972,14009,14045,14066,14071,14077,14082,14195,14207,14212,14220,14225,14230,14235,14391,14396,14493,14498,14506,14511,14524,14529,14534,14578,14583,14589,14601,14613,14618],{"type":23,"tag":24,"props":13948,"children":13949},{},[13950,13954],{"type":23,"tag":41,"props":13951,"children":13952},{"href":43},[13953],{"type":28,"value":46},{"type":28,"value":13955}," 的前端是 Vue 3 + Vite，路由全是懒加载，照理说打开登录页只该下载登录页自己的代码。8 月 21 号我按 index.html 里 modulepreload 实际列出的文件量了一下（modulepreload 是浏览器一打开页面就会提前下载的 JS 清单），首屏 JS 在 gzip 之后是 1462KB，登录页也一样。原来文档里写的是「首屏 gz ~1.3MB」，那是拿 chunk 体积估出来的，真量出来还要更大。",{"type":23,"tag":24,"props":13957,"children":13958},{},[13959],{"type":28,"value":13960},"下面的过程是根据当时的提交说明和 Phase 1 优化文档整理的。",{"type":23,"tag":50,"props":13962,"children":13964},{"id":13963},"先做的两项首屏一点没少",[13965],{"type":28,"value":13966},"先做的两项，首屏一点没少",{"type":23,"tag":24,"props":13968,"children":13969},{},[13970],{"type":28,"value":13971},"Phase 1 给前端定的目标是首屏 JS gzip 后小于 300KB。一开始的思路很直接：IDE 那几个大组件和 Monaco 编辑器（就是 VS Code 用的那个网页代码编辑器）最重，把它们拆出去就行。这两项是派给 AI 编程会话做的，当天先后做完。",{"type":23,"tag":24,"props":13973,"children":13974},{},[13975,13977,13983,13985,13991,13993,13999,14001,14007],{"type":28,"value":13976},"第一项是把 IDE 组件改成异步加载。计划里是把 IdeLayout 静态导入的 8 个组件逐个改成异步，实际只动了下面一层：EditorPane 里静态导入的 6 个编辑器，加上 BottomPanel 里的 ProblemsPanel，一共 7 个改成 ",{"type":23,"tag":99,"props":13978,"children":13980},{"className":13979},[],[13981],{"type":28,"value":13982},"defineAsyncComponent",{"type":28,"value":13984},"，也就是用到时才去下载这个组件。这 7 个才是真正重的：DataTransferEditor 一个文件就有 5154 行，WorkflowCanvas 静态拖着 756KB 的 @antv\u002Fx6，4 个编辑器各自拖着 Monaco。没包 ",{"type":23,"tag":99,"props":13986,"children":13988},{"className":13987},[],[13989],{"type":28,"value":13990},"\u003CSuspense>",{"type":28,"value":13992},"，用 ",{"type":23,"tag":99,"props":13994,"children":13996},{"className":13995},[],[13997],{"type":28,"value":13998},"loadingComponent",{"type":28,"value":14000}," 加 200ms 的 ",{"type":23,"tag":99,"props":14002,"children":14004},{"className":14003},[],[14005],{"type":28,"value":14006},"delay",{"type":28,"value":14008}," 做占位。改完以后 IdeLayout 这个 chunk 从 815KB 降到 689KB（gzip），少了 126KB。",{"type":23,"tag":24,"props":14010,"children":14011},{},[14012,14014,14020,14022,14028,14030,14035,14037,14043],{"type":28,"value":14013},"第二项是裁剪 Monaco，这一项原来的判断也错了一半。计划里以为是 vite-plugin-monaco-editor 的 ",{"type":23,"tag":99,"props":14015,"children":14017},{"className":14016},[],[14018],{"type":28,"value":14019},"languageWorkers",{"type":28,"value":14021}," 配错了，一查，这个配置从第一个提交起就是 ",{"type":23,"tag":99,"props":14023,"children":14025},{"className":14024},[],[14026],{"type":28,"value":14027},"['editorWorkerService']",{"type":28,"value":14029},"，一直是对的。那几个语言 worker 是 monaco-editor 自己的 workerManager.js 里写了 ",{"type":23,"tag":99,"props":14031,"children":14033},{"className":14032},[],[14034],{"type":28,"value":4152},{"type":28,"value":14036},"，Vite 认得这种写法，自动拆成了 chunk，跟插件配置没关系。真正把它们拉进来的是代码里的 ",{"type":23,"tag":99,"props":14038,"children":14040},{"className":14039},[],[14041],{"type":28,"value":14042},"import * as monaco from 'monaco-editor'",{"type":28,"value":14044},"，它会引入整个 editor.main，里面带着 4 个语言服务和 87 种语法高亮。",{"type":23,"tag":24,"props":14046,"children":14047},{},[14048,14050,14056,14058,14064],{"type":28,"value":14049},"改法是只组合编辑器内核，再加上实际用到的 sql、python、shell 三种语法。改成深路径导入时还踩了个坑：monaco-editor 的 package.json 里，exports 写的是 ",{"type":23,"tag":99,"props":14051,"children":14053},{"className":14052},[],[14054],{"type":28,"value":14055},"\".\u002F*\": \".\u002F*\"",{"type":28,"value":14057},"，不带扩展名的子路径会被原样映射成一个不存在的文件。Vite 运行时会自动补扩展名，所以构建完全没感觉；TypeScript 在 exports 映射下却不补，类型检查报 TS2307（找不到模块）。所以深路径必须写全 ",{"type":23,"tag":99,"props":14059,"children":14061},{"className":14060},[],[14062],{"type":28,"value":14063},".js",{"type":28,"value":14065},"。改完以后产物总量从 20.51M 降到 11.30M，ts、css、html、json 四个 worker 一共 8.71MB 都没了。",{"type":23,"tag":24,"props":14067,"children":14068},{},[14069],{"type":28,"value":14070},"两份结果单看都不错，可首屏还是 1462KB。原因说穿了很简单：IdeLayout 是路由级 chunk，那几个 worker 本来也是用到才加载，它们都不在首屏要下载的那一批里。东西确实变小了，可变小的部分本来就不在首屏。",{"type":23,"tag":50,"props":14072,"children":14074},{"id":14073},"入口-chunk-里的一行-import",[14075],{"type":28,"value":14076},"入口 chunk 里的一行 import",{"type":23,"tag":24,"props":14078,"children":14079},{},[14080],{"type":28,"value":14081},"IdeLayout 拆完以后，我再按 index.html 的口径量了一次，首屏从 1462K 变成 1463K，一点没少。重量既然不在路由 chunk 里，就只能去看入口 chunk 到底静态 import 了什么。翻开构建产物，入口里有这么两行：",{"type":23,"tag":2152,"props":14083,"children":14087},{"className":14084,"code":14085,"language":14086,"meta":8,"style":8},"language-js shiki shiki-themes github-light github-dark","import{_ as R}from\".\u002Fmonaco-*.js\"\ncomponent: () => R(() => import(\".\u002FLoginView-*.js\"), __vite__mapDeps([...]))\n","js",[14088],{"type":23,"tag":99,"props":14089,"children":14090},{"__ignoreMap":8},[14091,14124],{"type":23,"tag":2161,"props":14092,"children":14093},{"class":2163,"line":2164},[14094,14099,14104,14109,14114,14119],{"type":23,"tag":2161,"props":14095,"children":14096},{"style":5948},[14097],{"type":28,"value":14098},"import",{"type":23,"tag":2161,"props":14100,"children":14101},{"style":5830},[14102],{"type":28,"value":14103},"{_ ",{"type":23,"tag":2161,"props":14105,"children":14106},{"style":5948},[14107],{"type":28,"value":14108},"as",{"type":23,"tag":2161,"props":14110,"children":14111},{"style":5830},[14112],{"type":28,"value":14113}," R}",{"type":23,"tag":2161,"props":14115,"children":14116},{"style":5948},[14117],{"type":28,"value":14118},"from",{"type":23,"tag":2161,"props":14120,"children":14121},{"style":5855},[14122],{"type":28,"value":14123},"\".\u002Fmonaco-*.js\"\n",{"type":23,"tag":2161,"props":14125,"children":14126},{"class":2163,"line":927},[14127,14132,14137,14142,14147,14152,14156,14161,14165,14170,14175,14180,14185,14190],{"type":23,"tag":2161,"props":14128,"children":14129},{"style":5824},[14130],{"type":28,"value":14131},"component",{"type":23,"tag":2161,"props":14133,"children":14134},{"style":5830},[14135],{"type":28,"value":14136},": () ",{"type":23,"tag":2161,"props":14138,"children":14139},{"style":5948},[14140],{"type":28,"value":14141},"=>",{"type":23,"tag":2161,"props":14143,"children":14144},{"style":5824},[14145],{"type":28,"value":14146}," R",{"type":23,"tag":2161,"props":14148,"children":14149},{"style":5830},[14150],{"type":28,"value":14151},"(() ",{"type":23,"tag":2161,"props":14153,"children":14154},{"style":5948},[14155],{"type":28,"value":14141},{"type":23,"tag":2161,"props":14157,"children":14158},{"style":5948},[14159],{"type":28,"value":14160}," import",{"type":23,"tag":2161,"props":14162,"children":14163},{"style":5830},[14164],{"type":28,"value":10486},{"type":23,"tag":2161,"props":14166,"children":14167},{"style":5855},[14168],{"type":28,"value":14169},"\".\u002FLoginView-*.js\"",{"type":23,"tag":2161,"props":14171,"children":14172},{"style":5830},[14173],{"type":28,"value":14174},"), ",{"type":23,"tag":2161,"props":14176,"children":14177},{"style":5824},[14178],{"type":28,"value":14179},"__vite__mapDeps",{"type":23,"tag":2161,"props":14181,"children":14182},{"style":5830},[14183],{"type":28,"value":14184},"([",{"type":23,"tag":2161,"props":14186,"children":14187},{"style":5948},[14188],{"type":28,"value":14189},"...",{"type":23,"tag":2161,"props":14191,"children":14192},{"style":5830},[14193],{"type":28,"value":14194},"]))\n",{"type":23,"tag":24,"props":14196,"children":14197},{},[14198,14200,14205],{"type":28,"value":14199},"这个 R 是 Vite 的动态导入预加载助手 ",{"type":23,"tag":99,"props":14201,"children":14203},{"className":14202},[],[14204],{"type":28,"value":4188},{"type":28,"value":14206},"。懒加载一个页面时，Vite 会用它包一层，顺手把这个页面依赖的其他文件也提前下载。路由里每个懒加载组件外面都包了它，一共 87 个路由在调。",{"type":23,"tag":24,"props":14208,"children":14209},{},[14210],{"type":28,"value":14211},"函数本身大概 200 字节，却被打进了 monaco 那个 chunk。入口要用它，就只能静态 import 整个 monaco chunk：3.55MB，gzip 后 941KB。ES 模块的静态 import 要等依赖下载、执行完，入口代码才会开始跑，所以入口哪怕只用了这个 chunk 里的一个函数，整块也得先到位，路由才能工作。index.html 的 modulepreload 里于是就是 antd 和 monaco 两大块，用户哪怕只是打开登录页，也得先把整个 Monaco 下完。",{"type":23,"tag":24,"props":14213,"children":14214},{},[14215],{"type":23,"tag":65,"props":14216,"children":14219},{"alt":14217,"src":14218},"改前改后对比：改前，入口 chunk 静态引入 monaco chunk（3.55MB，gzip 941KB，里面混着 __vitePreload），首屏 JS raw 5.23M、gzip 1462K；改后，入口只静态引入 antd 和 gzip 后 1K 的 vite-runtime，monaco 在打开 SQL 编辑页时才加载，首屏 JS raw 1.68M、gzip 523K","\u002Fimages\u002Fblog\u002Fgenesis-vite-preload\u002Fpreload-chain.svg",[],{"type":23,"tag":24,"props":14221,"children":14222},{},[14223],{"type":28,"value":14224},"为什么会落在 monaco 里：vite.config.ts 用 manualChunks 按模块 id 手动分了几组，monaco、antv-x6、echarts、antd 各一组。这个助手自己没被分进任何一组，结果被一个大 vendor 组收了进去，实测落进的是 monaco。这个问题从项目第一个提交起就在，之前没有任何文档提到过。",{"type":23,"tag":50,"props":14226,"children":14228},{"id":14227},"改法只有一行",[14229],{"type":28,"value":14227},{"type":23,"tag":24,"props":14231,"children":14232},{},[14233],{"type":28,"value":14234},"这个发现本来不在计划里。当晚我先在主线 UX 的设计文档里把它记成计划外发现，打算以后作为分包专项单独做；结果没等专项，从记下来到提交修复不到半小时，事后在 Phase 1 的任务表里补记成 P1-F03b。改动就是在 manualChunks 里给这个助手单独一个组：",{"type":23,"tag":2152,"props":14236,"children":14239},{"className":14237,"code":14238,"language":12012,"meta":8,"style":8},"language-ts shiki shiki-themes github-light github-dark","manualChunks: (id: string) => {\n  \u002F\u002F Vite 的动态导入预加载助手（__vitePreload）必须独立成 chunk\n  if (id.includes('vite\u002Fpreload-helper')) return 'vite-runtime'\n  \u002F\u002F Monaco Editor ~3.7MB → separate chunk\n  if (id.includes('monaco-editor')) return 'monaco'\n  \u002F\u002F antv-x6、echarts、antd 的分组不变\n},\n",[14240],{"type":23,"tag":99,"props":14241,"children":14242},{"__ignoreMap":8},[14243,14281,14289,14330,14338,14375,14383],{"type":23,"tag":2161,"props":14244,"children":14245},{"class":2163,"line":2164},[14246,14250,14255,14260,14264,14269,14273,14277],{"type":23,"tag":2161,"props":14247,"children":14248},{"style":5824},[14249],{"type":28,"value":4196},{"type":23,"tag":2161,"props":14251,"children":14252},{"style":5830},[14253],{"type":28,"value":14254},": (",{"type":23,"tag":2161,"props":14256,"children":14257},{"style":10460},[14258],{"type":28,"value":14259},"id",{"type":23,"tag":2161,"props":14261,"children":14262},{"style":5948},[14263],{"type":28,"value":11054},{"type":23,"tag":2161,"props":14265,"children":14266},{"style":5844},[14267],{"type":28,"value":14268}," string",{"type":23,"tag":2161,"props":14270,"children":14271},{"style":5830},[14272],{"type":28,"value":11049},{"type":23,"tag":2161,"props":14274,"children":14275},{"style":5948},[14276],{"type":28,"value":14141},{"type":23,"tag":2161,"props":14278,"children":14279},{"style":5830},[14280],{"type":28,"value":10403},{"type":23,"tag":2161,"props":14282,"children":14283},{"class":2163,"line":927},[14284],{"type":23,"tag":2161,"props":14285,"children":14286},{"style":5807},[14287],{"type":28,"value":14288},"  \u002F\u002F Vite 的动态导入预加载助手（__vitePreload）必须独立成 chunk\n",{"type":23,"tag":2161,"props":14290,"children":14291},{"class":2163,"line":924},[14292,14297,14302,14307,14311,14316,14321,14325],{"type":23,"tag":2161,"props":14293,"children":14294},{"style":5948},[14295],{"type":28,"value":14296},"  if",{"type":23,"tag":2161,"props":14298,"children":14299},{"style":5830},[14300],{"type":28,"value":14301}," (id.",{"type":23,"tag":2161,"props":14303,"children":14304},{"style":5824},[14305],{"type":28,"value":14306},"includes",{"type":23,"tag":2161,"props":14308,"children":14309},{"style":5830},[14310],{"type":28,"value":10486},{"type":23,"tag":2161,"props":14312,"children":14313},{"style":5855},[14314],{"type":28,"value":14315},"'vite\u002Fpreload-helper'",{"type":23,"tag":2161,"props":14317,"children":14318},{"style":5830},[14319],{"type":28,"value":14320},")) ",{"type":23,"tag":2161,"props":14322,"children":14323},{"style":5948},[14324],{"type":28,"value":11005},{"type":23,"tag":2161,"props":14326,"children":14327},{"style":5855},[14328],{"type":28,"value":14329}," 'vite-runtime'\n",{"type":23,"tag":2161,"props":14331,"children":14332},{"class":2163,"line":2190},[14333],{"type":23,"tag":2161,"props":14334,"children":14335},{"style":5807},[14336],{"type":28,"value":14337},"  \u002F\u002F Monaco Editor ~3.7MB → separate chunk\n",{"type":23,"tag":2161,"props":14339,"children":14340},{"class":2163,"line":2199},[14341,14345,14349,14353,14357,14362,14366,14370],{"type":23,"tag":2161,"props":14342,"children":14343},{"style":5948},[14344],{"type":28,"value":14296},{"type":23,"tag":2161,"props":14346,"children":14347},{"style":5830},[14348],{"type":28,"value":14301},{"type":23,"tag":2161,"props":14350,"children":14351},{"style":5824},[14352],{"type":28,"value":14306},{"type":23,"tag":2161,"props":14354,"children":14355},{"style":5830},[14356],{"type":28,"value":10486},{"type":23,"tag":2161,"props":14358,"children":14359},{"style":5855},[14360],{"type":28,"value":14361},"'monaco-editor'",{"type":23,"tag":2161,"props":14363,"children":14364},{"style":5830},[14365],{"type":28,"value":14320},{"type":23,"tag":2161,"props":14367,"children":14368},{"style":5948},[14369],{"type":28,"value":11005},{"type":23,"tag":2161,"props":14371,"children":14372},{"style":5855},[14373],{"type":28,"value":14374}," 'monaco'\n",{"type":23,"tag":2161,"props":14376,"children":14377},{"class":2163,"line":2208},[14378],{"type":23,"tag":2161,"props":14379,"children":14380},{"style":5807},[14381],{"type":28,"value":14382},"  \u002F\u002F antv-x6、echarts、antd 的分组不变\n",{"type":23,"tag":2161,"props":14384,"children":14385},{"class":2163,"line":2217},[14386],{"type":23,"tag":2161,"props":14387,"children":14388},{"style":5830},[14389],{"type":28,"value":14390},"},\n",{"type":23,"tag":24,"props":14392,"children":14393},{},[14394],{"type":28,"value":14395},"改完再量：",{"type":23,"tag":533,"props":14397,"children":14398},{},[14399,14418],{"type":23,"tag":537,"props":14400,"children":14401},{},[14402],{"type":23,"tag":541,"props":14403,"children":14404},{},[14405,14408,14413],{"type":23,"tag":545,"props":14406,"children":14407},{},[],{"type":23,"tag":545,"props":14409,"children":14410},{},[14411],{"type":28,"value":14412},"改前",{"type":23,"tag":545,"props":14414,"children":14415},{},[14416],{"type":28,"value":14417},"改后",{"type":23,"tag":561,"props":14419,"children":14420},{},[14421,14439,14457,14475],{"type":23,"tag":541,"props":14422,"children":14423},{},[14424,14429,14434],{"type":23,"tag":568,"props":14425,"children":14426},{},[14427],{"type":28,"value":14428},"首屏 JS（raw）",{"type":23,"tag":568,"props":14430,"children":14431},{},[14432],{"type":28,"value":14433},"5.23M",{"type":23,"tag":568,"props":14435,"children":14436},{},[14437],{"type":28,"value":14438},"1.68M",{"type":23,"tag":541,"props":14440,"children":14441},{},[14442,14447,14452],{"type":23,"tag":568,"props":14443,"children":14444},{},[14445],{"type":28,"value":14446},"首屏 JS（gzip）",{"type":23,"tag":568,"props":14448,"children":14449},{},[14450],{"type":28,"value":14451},"1462K",{"type":23,"tag":568,"props":14453,"children":14454},{},[14455],{"type":28,"value":14456},"523K",{"type":23,"tag":541,"props":14458,"children":14459},{},[14460,14465,14470],{"type":23,"tag":568,"props":14461,"children":14462},{},[14463],{"type":28,"value":14464},"modulepreload",{"type":23,"tag":568,"props":14466,"children":14467},{},[14468],{"type":28,"value":14469},"antd + monaco",{"type":23,"tag":568,"props":14471,"children":14472},{},[14473],{"type":28,"value":14474},"antd + vite-runtime（gzip 后 1K）",{"type":23,"tag":541,"props":14476,"children":14477},{},[14478,14483,14488],{"type":23,"tag":568,"props":14479,"children":14480},{},[14481],{"type":28,"value":14482},"monaco chunk",{"type":23,"tag":568,"props":14484,"children":14485},{},[14486],{"type":28,"value":14487},"首屏必下",{"type":23,"tag":568,"props":14489,"children":14490},{},[14491],{"type":28,"value":14492},"打开编辑器时才拉",{"type":23,"tag":24,"props":14494,"children":14495},{},[14496],{"type":28,"value":14497},"gzip 后少了 939K，降了 64%。",{"type":23,"tag":24,"props":14499,"children":14500},{},[14501],{"type":23,"tag":65,"props":14502,"children":14505},{"alt":14503,"src":14504},"首屏 JS gzip 体积变化：最初实测 1462K；IDE 组件异步化之后 1463K，其间 IdeLayout chunk 从 815K 降到 689K；预加载助手单独分组之后 523K，少了 64%；再把图标单独拆一个 chunk 后 516K；Phase 1 目标 300KB 用红色虚线标出","\u002Fimages\u002Fblog\u002Fgenesis-vite-preload\u002Ffirst-screen-numbers.svg",[],{"type":23,"tag":50,"props":14507,"children":14509},{"id":14508},"必须在浏览器里验",[14510],{"type":28,"value":14508},{"type":23,"tag":24,"props":14512,"children":14513},{},[14514,14516,14522],{"type":28,"value":14515},"这一行改动的风险其实不小。助手换了 chunk，要是哪里没接上，87 个懒加载路由会一起挂，而光看构建产物是看不出来的。所以这次验收要求必须做运行时验证：把生产构建产物放到静态服务器上，用无头浏览器去跑。登录页确认没有拉 monaco，LoginView 的懒加载 chunk 正常加载；切到 \u002Fdemo\u002Fsql-workspace，monaco 按需拉下来，",{"type":23,"tag":99,"props":14517,"children":14519},{"className":14518},[],[14520],{"type":28,"value":14521},".monaco-editor",{"type":28,"value":14523}," 挂载成功；全程没有失败请求，也没有页面报错。",{"type":23,"tag":50,"props":14525,"children":14527},{"id":14526},"以后首屏只认两样东西",[14528],{"type":28,"value":14526},{"type":23,"tag":24,"props":14530,"children":14531},{},[14532],{"type":28,"value":14533},"这件事之后，我把首屏的验收口径改了。前两项优化的报告里写的是 chunk 体积、产物总量、worker 数量，这些都只是间接指标，跟首屏可能毫无关系。现在 Phase 1 文档最上面写着：首屏 JS 只看 index.html 里 modulepreload 和 script src 的集合，再加上入口 chunk 的静态 import。后者一行命令就能列出来：",{"type":23,"tag":2152,"props":14535,"children":14537},{"className":5795,"code":14536,"language":5797,"meta":8,"style":8},"grep -oE 'from\"\\.\u002F[^\"]+\\.js\"' \u003C入口chunk>\n",[14538],{"type":23,"tag":99,"props":14539,"children":14540},{"__ignoreMap":8},[14541],{"type":23,"tag":2161,"props":14542,"children":14543},{"class":2163,"line":2164},[14544,14549,14554,14559,14563,14568,14573],{"type":23,"tag":2161,"props":14545,"children":14546},{"style":5824},[14547],{"type":28,"value":14548},"grep",{"type":23,"tag":2161,"props":14550,"children":14551},{"style":5844},[14552],{"type":28,"value":14553}," -oE",{"type":23,"tag":2161,"props":14555,"children":14556},{"style":5855},[14557],{"type":28,"value":14558}," 'from\"\\.\u002F[^\"]+\\.js\"'",{"type":23,"tag":2161,"props":14560,"children":14561},{"style":5948},[14562],{"type":28,"value":6615},{"type":23,"tag":2161,"props":14564,"children":14565},{"style":5855},[14566],{"type":28,"value":14567},"入口chun",{"type":23,"tag":2161,"props":14569,"children":14570},{"style":5830},[14571],{"type":28,"value":14572},"k",{"type":23,"tag":2161,"props":14574,"children":14575},{"style":5948},[14576],{"type":28,"value":14577},">\n",{"type":23,"tag":24,"props":14579,"children":14580},{},[14581],{"type":28,"value":14582},"谁再说做了首屏优化，就得拿出改前改后的 modulepreload 集合对比。",{"type":23,"tag":50,"props":14584,"children":14586},{"id":14585},"还剩-antd",[14587],{"type":28,"value":14588},"还剩 antd",{"type":23,"tag":24,"props":14590,"children":14591},{},[14592,14594,14599],{"type":28,"value":14593},"523KB 离 300KB 还差一截，剩下的基本都是 antd（Ant Design Vue 组件库）。main.ts 里是 ",{"type":23,"tag":99,"props":14595,"children":14597},{"className":14596},[],[14598],{"type":28,"value":3498},{"type":28,"value":14600}," 全量注册，文档里记的是 antd 占 438KB，是首屏 523KB 的 84%。",{"type":23,"tag":24,"props":14602,"children":14603},{},[14604,14606,14611],{"type":28,"value":14605},"我试过一个省事的办法：把 @ant-design\u002Ficons-vue 单独拆成一个 chunk，首屏从 523KB 到 516KB，只少了 7KB。图标是 antd 组件内部引用的，只要 ",{"type":23,"tag":99,"props":14607,"children":14609},{"className":14608},[],[14610],{"type":28,"value":3498},{"type":28,"value":14612}," 还在，整个 antd 就在入口的静态依赖里，怎么拆 chunk 都改变不了这层引用关系。得从 main.ts 的注册方式下手，换成 unplugin-vue-components 加 AntDesignVueResolver 按需引入，也就是模板里用到哪个组件，构建时才引入哪个。",{"type":23,"tag":24,"props":14614,"children":14615},{},[14616],{"type":28,"value":14617},"这一刀也没想象中那么好砍。模板里实际用到了 69 种 antd 组件、155 种图标，真没用上的组件不多，能省下来的主要靠把各个路由专用的组件推迟到路由 chunk 里。项目里目前还没装 unplugin-vue-components，这一项排在 Phase 1 的 P1-F04，还没开始。",{"type":23,"tag":2730,"props":14619,"children":14620},{},[14621],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":14623},[14624,14625,14626,14627,14628,14629],{"id":13963,"depth":927,"text":13966},{"id":14073,"depth":927,"text":14076},{"id":14227,"depth":927,"text":14227},{"id":14508,"depth":927,"text":14508},{"id":14526,"depth":927,"text":14526},{"id":14585,"depth":927,"text":14588},"content:blog:2026-08-24-genesis-vite-preload-first-screen.md","blog\u002F2026-08-24-genesis-vite-preload-first-screen.md","blog\u002F2026-08-24-genesis-vite-preload-first-screen",{"_path":14634,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":14635,"description":14636,"date":14637,"tags":14638,"body":14642,"_type":937,"_id":16019,"_source":939,"_file":16020,"_stem":16021,"_extension":942},"\u002Fblog\u002F2026-08-22-genesis-onedata-standards","数仓命名靠词根管：Genesis 的数据标准和 OneData 建模是怎么设计的","Genesis 用词根把数据域、命名规范、智能命名和表字段设计串起来，所以改一个词根之前，能先查出会动到哪些表和指标。","2026-08-22",[46,14639,14640,14641],"OneData","数据标准","数仓建模",{"type":20,"children":14643,"toc":16010},[14644,14665,14674,14693,14698,14703,14711,14732,14740,14745,14758,14763,14789,14794,14990,15017,15022,15027,15046,15051,15057,15076,15094,15099,15112,15117,15140,15145,15150,15155,15160,15168,15217,15262,15274,15279,15302,15307,15312,15318,15338,15351,15356,15362,15367,15372,15395,15400,15405,15410,15415,15573,15597,15636,15669,15674,15679,15684,15703,15711,15716,15963,15975,15988,16001,16006],{"type":23,"tag":24,"props":14645,"children":14646},{},[14647,14649,14655,14657,14663],{"type":28,"value":14648},"数仓做久了，比慢 SQL 更难收拾的往往是命名。同一个概念在不同表里有好几种英文写法，比如「用户」，有的表写 ",{"type":23,"tag":99,"props":14650,"children":14652},{"className":14651},[],[14653],{"type":28,"value":14654},"user",{"type":28,"value":14656},"，有的写 ",{"type":23,"tag":99,"props":14658,"children":14660},{"className":14659},[],[14661],{"type":28,"value":14662},"usr",{"type":28,"value":14664},"；想改一个缩写，也说不清会影响哪些表。",{"type":23,"tag":24,"props":14666,"children":14667},{},[14668,14672],{"type":23,"tag":41,"props":14669,"children":14670},{"href":43},[14671],{"type":28,"value":46},{"type":28,"value":14673}," 是我在做的数据平台，照着 DataWorks 的路子设计，可以自己部署。里面的「数据标准」和「OneData 建模」两个模块，就是冲着命名这件事做的。OneData 是阿里提出的数仓建模方法，核心是先定统一的数据域、词根和命名规则，再按规则建表。这篇按 Genesis 7 月份的模块技术文档整理，环境和账号信息都去掉了。",{"type":23,"tag":24,"props":14675,"children":14676},{},[14677,14679,14684,14686,14691],{"type":28,"value":14678},"这里说的「词根」，是命名里最小的单位。比如「用户」这个词根，编码是 ",{"type":23,"tag":99,"props":14680,"children":14682},{"className":14681},[],[14683],{"type":28,"value":14662},{"type":28,"value":14685},"，英文全称是 ",{"type":23,"tag":99,"props":14687,"children":14689},{"className":14688},[],[14690],{"type":28,"value":14654},{"type":28,"value":14692},"，所有表名、字段名都由词根拼出来。两个模块就是围绕词根搭起来的。",{"type":23,"tag":50,"props":14694,"children":14696},{"id":14695},"两个模块靠词根连在一起",[14697],{"type":28,"value":14695},{"type":23,"tag":24,"props":14699,"children":14700},{},[14701],{"type":28,"value":14702},"数据标准模块管数据域、命名规范和词根，还负责智能命名和审批流程。OneData 建模模块管模型、表、字段的可视化设计，外加版本管理、DDL 生成和指标管理。",{"type":23,"tag":24,"props":14704,"children":14705},{},[14706],{"type":23,"tag":65,"props":14707,"children":14710},{"alt":14708,"src":14709},"两个模块的关系：左边数据标准模块里有词根 data_root_word、数据域 data_domain、命名规范与智能命名与审批；右边 OneData 建模模块里的字段通过 field_word_root.word_root_id、指标通过 indicator_modifier.word_root_id 指向词根，模型通过 model.domain_id 指向数据域；底部注明三张核心表都带 project_id，为空是全局标准，有值是项目级标准","\u002Fimages\u002Fblog\u002Fgenesis-onedata\u002Fword-root-hub.svg",[],{"type":23,"tag":24,"props":14712,"children":14713},{},[14714,14716,14722,14724,14730],{"type":28,"value":14715},"两个模块共用数据域，但真正把它们绑在一起的是词根。字段设计通过 ",{"type":23,"tag":99,"props":14717,"children":14719},{"className":14718},[],[14720],{"type":28,"value":14721},"field_word_root",{"type":28,"value":14723}," 绑定词根，指标通过 ",{"type":23,"tag":99,"props":14725,"children":14727},{"className":14726},[],[14728],{"type":28,"value":14729},"indicator_modifier",{"type":28,"value":14731}," 把词根当修饰词，智能命名先查词根库，查不到再调 AI 翻译，并把结果自动入库。落到表结构上，关键的外键就这三条：",{"type":23,"tag":2152,"props":14733,"children":14735},{"code":14734},"field_word_root.word_root_id    → data_root_word.id   # 字段绑定的词根\nindicator_modifier.word_root_id → data_root_word.id   # 指标的修饰词\nmodel.domain_id                 → data_domain.id      # 模型所属的数据域\n",[14736],{"type":23,"tag":99,"props":14737,"children":14738},{"__ignoreMap":8},[14739],{"type":28,"value":14734},{"type":23,"tag":24,"props":14741,"children":14742},{},[14743],{"type":28,"value":14744},"有了这几张绑定表，「一个名字由哪些词根组成」「一个词根被谁用了」就不用靠字符串去猜，直接做关系查询就行。后面的影响分析和治理分都靠这一点。代价是绑定关系必须真的存在：字段名要是手敲的、没绑词根，平台就看不见它。",{"type":23,"tag":24,"props":14746,"children":14747},{},[14748,14750,14756],{"type":28,"value":14749},"数据域、命名规范、词根这三张核心表都带 ",{"type":23,"tag":99,"props":14751,"children":14753},{"className":14752},[],[14754],{"type":28,"value":14755},"project_id",{"type":28,"value":14757},"。为空表示系统级的全局标准，有值表示项目级标准；读的时候两者合并，同名的以项目级为准。这样一套全局标准可以给多个项目共用，项目自己的业务词汇不用塞进全局库，也不用为此复制一整套标准。坏处是同一个概念可能在不同项目里被覆盖成不同写法，跨项目复用表时得留意。项目级标准由项目自己负责，这一点在审批规则里也有体现，后面会讲。",{"type":23,"tag":50,"props":14759,"children":14761},{"id":14760},"数据域和命名规范",[14762],{"type":28,"value":14760},{"type":23,"tag":24,"props":14764,"children":14765},{},[14766,14768,14774,14775,14780,14781,14787],{"type":28,"value":14767},"数据域就是数仓的业务分区，比如交易、用户、商品，支持多级树形结构。每个域有唯一编码（比如 ",{"type":23,"tag":99,"props":14769,"children":14771},{"className":14770},[],[14772],{"type":28,"value":14773},"trd",{"type":28,"value":2541},{"type":23,"tag":99,"props":14776,"children":14778},{"className":14777},[],[14779],{"type":28,"value":14662},{"type":28,"value":2541},{"type":23,"tag":99,"props":14782,"children":14784},{"className":14783},[],[14785],{"type":28,"value":14786},"prd",{"type":28,"value":14788},"）、中文名（交易域、用户域这种）、负责人，还有一个专门给命名规范拼接用的缩写字段。编码、中文名、拼接缩写分开存，改展示名不会牵连命名；有了负责人字段，每个域都有明确的 owner。",{"type":23,"tag":24,"props":14790,"children":14791},{},[14792],{"type":28,"value":14793},"命名规范按数仓分层配置，规定表名、字段名由哪几段组成、怎么校验。数仓分层指的是 ODS（贴源层，原样落地业务数据）、DWD（明细层）、DWS（汇总层）、ADS（应用层）这一套。一条规则有这些要素：",{"type":23,"tag":533,"props":14795,"children":14796},{},[14797,14818],{"type":23,"tag":537,"props":14798,"children":14799},{},[14800],{"type":23,"tag":541,"props":14801,"children":14802},{},[14803,14808,14813],{"type":23,"tag":545,"props":14804,"children":14805},{},[14806],{"type":28,"value":14807},"要素",{"type":23,"tag":545,"props":14809,"children":14810},{},[14811],{"type":28,"value":14812},"取值",{"type":23,"tag":545,"props":14814,"children":14815},{},[14816],{"type":28,"value":14817},"说明",{"type":23,"tag":561,"props":14819,"children":14820},{},[14821,14839,14857,14889,14919,14943,14961],{"type":23,"tag":541,"props":14822,"children":14823},{},[14824,14829,14834],{"type":23,"tag":568,"props":14825,"children":14826},{},[14827],{"type":28,"value":14828},"适用分层",{"type":23,"tag":568,"props":14830,"children":14831},{},[14832],{"type":28,"value":14833},"ODS \u002F DWD \u002F DWS \u002F ADS",{"type":23,"tag":568,"props":14835,"children":14836},{},[14837],{"type":28,"value":14838},"可以标成该层的默认规则",{"type":23,"tag":541,"props":14840,"children":14841},{},[14842,14847,14852],{"type":23,"tag":568,"props":14843,"children":14844},{},[14845],{"type":28,"value":14846},"命名模式",{"type":23,"tag":568,"props":14848,"children":14849},{},[14850],{"type":28,"value":14851},"模板",{"type":23,"tag":568,"props":14853,"children":14854},{},[14855],{"type":28,"value":14856},"名字由哪些段组成",{"type":23,"tag":541,"props":14858,"children":14859},{},[14860,14865,14884],{"type":23,"tag":568,"props":14861,"children":14862},{},[14863],{"type":28,"value":14864},"周期后缀",{"type":23,"tag":568,"props":14866,"children":14867},{},[14868,14874,14876,14882],{"type":23,"tag":99,"props":14869,"children":14871},{"className":14870},[],[14872],{"type":28,"value":14873},"df",{"type":28,"value":14875}," 全量 \u002F ",{"type":23,"tag":99,"props":14877,"children":14879},{"className":14878},[],[14880],{"type":28,"value":14881},"di",{"type":28,"value":14883}," 增量",{"type":23,"tag":568,"props":14885,"children":14886},{},[14887],{"type":28,"value":14888},"拼在表名后部",{"type":23,"tag":541,"props":14890,"children":14891},{},[14892,14897,14914],{"type":23,"tag":568,"props":14893,"children":14894},{},[14895],{"type":28,"value":14896},"策略后缀",{"type":23,"tag":568,"props":14898,"children":14899},{},[14900,14906,14907,14913],{"type":23,"tag":99,"props":14901,"children":14903},{"className":14902},[],[14904],{"type":28,"value":14905},"full",{"type":28,"value":14875},{"type":23,"tag":99,"props":14908,"children":14910},{"className":14909},[],[14911],{"type":28,"value":14912},"inc",{"type":28,"value":14883},{"type":23,"tag":568,"props":14915,"children":14916},{},[14917],{"type":28,"value":14918},"和周期后缀分开配",{"type":23,"tag":541,"props":14920,"children":14921},{},[14922,14927,14938],{"type":23,"tag":568,"props":14923,"children":14924},{},[14925],{"type":28,"value":14926},"分隔符",{"type":23,"tag":568,"props":14928,"children":14929},{},[14930,14932],{"type":28,"value":14931},"默认 ",{"type":23,"tag":99,"props":14933,"children":14935},{"className":14934},[],[14936],{"type":28,"value":14937},"_",{"type":23,"tag":568,"props":14939,"children":14940},{},[14941],{"type":28,"value":14942},"各段之间的连接符",{"type":23,"tag":541,"props":14944,"children":14945},{},[14946,14951,14956],{"type":23,"tag":568,"props":14947,"children":14948},{},[14949],{"type":28,"value":14950},"最大长度",{"type":23,"tag":568,"props":14952,"children":14953},{},[14954],{"type":28,"value":14955},"默认 64",{"type":23,"tag":568,"props":14957,"children":14958},{},[14959],{"type":28,"value":14960},"名字的长度上限",{"type":23,"tag":541,"props":14962,"children":14963},{},[14964,14969,14985],{"type":23,"tag":568,"props":14965,"children":14966},{},[14967],{"type":28,"value":14968},"严重度",{"type":23,"tag":568,"props":14970,"children":14971},{},[14972,14978,14979],{"type":23,"tag":99,"props":14973,"children":14975},{"className":14974},[],[14976],{"type":28,"value":14977},"ERROR",{"type":28,"value":639},{"type":23,"tag":99,"props":14980,"children":14982},{"className":14981},[],[14983],{"type":28,"value":14984},"WARNING",{"type":23,"tag":568,"props":14986,"children":14987},{},[14988],{"type":28,"value":14989},"ERROR 阻断发布，WARNING 只提示",{"type":23,"tag":24,"props":14991,"children":14992},{},[14993,14995,15001,15003,15008,15010,15015],{"type":28,"value":14994},"规则引擎干两件事。一是拼名字：表名按分层、数据域、词根、后缀的顺序组合，比如 ",{"type":23,"tag":99,"props":14996,"children":14998},{"className":14997},[],[14999],{"type":28,"value":15000},"dwd_trd_order_detail_di",{"type":28,"value":15002},"，字段名自动带上数据域前缀。二是卡发布：",{"type":23,"tag":99,"props":15004,"children":15006},{"className":15005},[],[15007],{"type":28,"value":14977},{"type":28,"value":15009}," 级规则不过，表名、字段名不合规的任务就发布不到调度系统 DolphinScheduler 上，",{"type":23,"tag":99,"props":15011,"children":15013},{"className":15012},[],[15014],{"type":28,"value":14984},{"type":28,"value":15016}," 级只提示。",{"type":23,"tag":24,"props":15018,"children":15019},{},[15020],{"type":28,"value":15021},"这套规则里我做了三个取舍。",{"type":23,"tag":24,"props":15023,"children":15024},{},[15025],{"type":28,"value":15026},"第一，拦截点放在发布环节。设计阶段不打断人，进调度之前再强制合规。这样问题会暴露得晚一些，所以平台另外做了字段编码校验，编辑器里也缓存了一份已审批的词根编码，尽量在写的时候就把问题找出来。",{"type":23,"tag":24,"props":15028,"children":15029},{},[15030,15032,15037,15039,15044],{"type":28,"value":15031},"第二，严重度分两级。新规则可以先按 ",{"type":23,"tag":99,"props":15033,"children":15035},{"className":15034},[],[15036],{"type":28,"value":14984},{"type":28,"value":15038}," 上线，看清影响面再升成 ",{"type":23,"tag":99,"props":15040,"children":15042},{"className":15041},[],[15043],{"type":28,"value":14977},{"type":28,"value":15045},"，免得一上线就把存量任务全卡住。",{"type":23,"tag":24,"props":15047,"children":15048},{},[15049],{"type":28,"value":15050},"第三，字段名带数据域前缀。在跨域的宽表里，一眼就能看出某个字段来自哪个域。代价是名字更长，64 的上限会更紧。",{"type":23,"tag":50,"props":15052,"children":15054},{"id":15053},"词根从哪来谁来审",[15055],{"type":28,"value":15056},"词根从哪来，谁来审",{"type":23,"tag":24,"props":15058,"children":15059},{},[15060,15062,15067,15069,15074],{"type":28,"value":15061},"一个词根有中文名（比如「用户」，分词以后按它匹配）、编码（",{"type":23,"tag":99,"props":15063,"children":15065},{"className":15064},[],[15066],{"type":28,"value":14662},{"type":28,"value":15068},"，缩写拼接用）和英文全称（",{"type":23,"tag":99,"props":15070,"children":15072},{"className":15071},[],[15073],{"type":28,"value":14654},{"type":28,"value":15075},"，全名拼接用），另外还有三个属性：",{"type":23,"tag":399,"props":15077,"children":15078},{},[15079,15084,15089],{"type":23,"tag":403,"props":15080,"children":15081},{},[15082],{"type":28,"value":15083},"类型：domain、metric、dimension、action，区分它在名字里扮演什么角色；",{"type":23,"tag":403,"props":15085,"children":15086},{},[15087],{"type":28,"value":15088},"状态：DRAFT、PENDING、APPROVED、REJECTED 四种，对应审批的生命周期；",{"type":23,"tag":403,"props":15090,"children":15091},{},[15092],{"type":28,"value":15093},"来源：MANUAL、IMPORT 还是 AI。",{"type":23,"tag":24,"props":15095,"children":15096},{},[15097],{"type":28,"value":15098},"缩写和全称都存，是因为表名受长度限制，适合用缩写，全称可读性更好，智能命名的结果里两种拼法都会给。",{"type":23,"tag":24,"props":15100,"children":15101},{},[15102,15104,15110],{"type":28,"value":15103},"词根有三个来源：手工录入；Excel 批量导入，有模板，导完返回成功、跳过、出错各多少条；还有智能命名时词库没命中，由 AI 翻译后自动入库。AI 补的词根标成 ",{"type":23,"tag":99,"props":15105,"children":15107},{"className":15106},[],[15108],{"type":28,"value":15109},"source=AI",{"type":28,"value":15111},"、状态 PENDING，并自动提交审批。记来源，是为了审批和追溯时分得清哪些是人定的、哪些是机器补的。",{"type":23,"tag":24,"props":15113,"children":15114},{},[15115],{"type":28,"value":15116},"审批用的是通用的「模板加实例」结构：一个流程模板下挂几个有序的节点模板，每个节点指定由哪个角色审批；每次提交生成一个审批实例和一串节点实例，再通知审批人。现在审批的对象有词根和模型两类，规则是这几条：",{"type":23,"tag":399,"props":15118,"children":15119},{},[15120,15125,15130,15135],{"type":23,"tag":403,"props":15121,"children":15122},{},[15123],{"type":28,"value":15124},"系统级词根按模板里定义的角色审（ADMIN \u002F REVIEWER）；项目级词根的审批人自动换成项目管理员（PROJECT_ADMIN）。",{"type":23,"tag":403,"props":15126,"children":15127},{},[15128],{"type":28,"value":15129},"同一个对象同时只能有一个进行中的审批，免得两条审批给出互相矛盾的结论。",{"type":23,"tag":403,"props":15131,"children":15132},{},[15133],{"type":28,"value":15134},"支持批量审批、统一填审批意见。AI 补出来的词根往往成批出现，一条条点太慢。",{"type":23,"tag":403,"props":15136,"children":15137},{},[15138],{"type":28,"value":15139},"审批通过后发一个事件，智能命名那边收到后清掉词根缓存，新状态马上生效。",{"type":23,"tag":24,"props":15141,"children":15142},{},[15143],{"type":28,"value":15144},"审批时还会调 AI 给词根做一次质量分析，给出建议（APPROVE \u002F REJECT \u002F MANUAL）、0 到 100 的分数，以及缩写质量、命名格式、语义匹配、类型分类四个维度的评分和改进建议。这份分析只作参考，过不过由审批人定。翻译和质检走的是同一个 AI 服务，让它给自己的产出打分，独立性本来就有限。",{"type":23,"tag":50,"props":15146,"children":15148},{"id":15147},"智能命名一次是怎么跑的",[15149],{"type":28,"value":15147},{"type":23,"tag":24,"props":15151,"children":15152},{},[15153],{"type":28,"value":15154},"智能命名就是输入一句中文描述，返回规范的英文表名。主链路是：用 HanLP（一个中文分词库）把描述切成词，逐个查词根库，没命中的词交给 AI 翻译并以 PENDING 状态入库，最后按命名规范拼起来。调用时要带上命名上下文（分层、数据域、同步方式），支持单条和批量输入，批量时用逗号或换行分隔。",{"type":23,"tag":24,"props":15156,"children":15157},{},[15158],{"type":28,"value":15159},"拿「交易订单明细表」走一遍：",{"type":23,"tag":24,"props":15161,"children":15162},{},[15163],{"type":23,"tag":65,"props":15164,"children":15167},{"alt":15165,"src":15166},"智能命名流程：「交易订单明细表」经 HanLP 分词切成交易、订单、明细三段；交易和订单在词根库命中，状态 APPROVED；明细没命中，交给 AI 翻译得到 detail，以 PENDING、source=AI 写进词根库并自动提交审批；最后按分层前缀 dwd、数据域 trd、词根 order 和 detail、周期后缀 di 拼成 dwd_trd_order_detail_di","\u002Fimages\u002Fblog\u002Fgenesis-onedata\u002Fname-generation.svg",[],{"type":23,"tag":890,"props":15169,"children":15170},{},[15171,15176,15181,15201,15212],{"type":23,"tag":403,"props":15172,"children":15173},{},[15174],{"type":28,"value":15175},"HanLP 把描述切成「交易 \u002F 订单 \u002F 明细」。",{"type":23,"tag":403,"props":15177,"children":15178},{},[15179],{"type":28,"value":15180},"「交易」「订单」在词根库里命中，状态都是 APPROVED；「明细」没命中。",{"type":23,"tag":403,"props":15182,"children":15183},{},[15184,15186,15192,15194,15199],{"type":28,"value":15185},"「明细」交给 AI 翻译，得到 ",{"type":23,"tag":99,"props":15187,"children":15189},{"className":15188},[],[15190],{"type":28,"value":15191},"detail",{"type":28,"value":15193},"，以 PENDING、",{"type":23,"tag":99,"props":15195,"children":15197},{"className":15196},[],[15198],{"type":28,"value":15109},{"type":28,"value":15200}," 写进词根库，并自动提交审批。",{"type":23,"tag":403,"props":15202,"children":15203},{},[15204,15206,15211],{"type":28,"value":15205},"按分层前缀、数据域、词根、周期后缀拼出 ",{"type":23,"tag":99,"props":15207,"children":15209},{"className":15208},[],[15210],{"type":28,"value":15000},{"type":28,"value":287},{"type":23,"tag":403,"props":15213,"children":15214},{},[15215],{"type":28,"value":15216},"结果返回前端，用户确认后写进表设计的表编码。",{"type":23,"tag":24,"props":15218,"children":15219},{},[15220,15222,15228,15230,15236,15238,15244,15246,15252,15254,15260],{"type":28,"value":15221},"返回结果里有缩写拼接的 ",{"type":23,"tag":99,"props":15223,"children":15225},{"className":15224},[],[15226],{"type":28,"value":15227},"name",{"type":28,"value":15229}," 和全名拼接的 ",{"type":23,"tag":99,"props":15231,"children":15233},{"className":15232},[],[15234],{"type":28,"value":15235},"fullName",{"type":28,"value":15237},"，还有每个分词片段的明细：原始中文、标准化后的中文、英文全名和缩写、来源（词库还是 AI）、审批状态，以及中文有没有被改写过（",{"type":23,"tag":99,"props":15239,"children":15241},{"className":15240},[],[15242],{"type":28,"value":15243},"chineseChanged",{"type":28,"value":15245},"）。汇总的部分有这次 AI 翻译了几个词（",{"type":23,"tag":99,"props":15247,"children":15249},{"className":15248},[],[15250],{"type":28,"value":15251},"aiGeneratedCount",{"type":28,"value":15253},"）、是否全部已审批（",{"type":23,"tag":99,"props":15255,"children":15257},{"className":15256},[],[15258],{"type":28,"value":15259},"allApproved",{"type":28,"value":15261},"）、警告信息，还有 AI 识别出的建议数据域。片段明细全部返回，是因为生成结果只是建议，用户得看到哪一段是 AI 临时翻的、还没人审过，才能决定用不用。",{"type":23,"tag":24,"props":15263,"children":15264},{},[15265,15267,15272],{"type":28,"value":15266},"AI 翻译是一次调用干三件事：中文标准化、英文全名、英文缩写，顺带返回词根类型和置信度。先做中文标准化，是因为同一个概念常有好几种中文说法，先归一到标准中文再翻，一个词根才能盖住这些说法。被改写的片段用 ",{"type":23,"tag":99,"props":15268,"children":15270},{"className":15269},[],[15271],{"type":28,"value":15243},{"type":28,"value":15273}," 标出来，用户的原词不会被悄悄换掉。",{"type":23,"tag":24,"props":15275,"children":15276},{},[15277],{"type":28,"value":15278},"实现上还有几个选择：",{"type":23,"tag":399,"props":15280,"children":15281},{},[15282,15287,15292,15297],{"type":23,"tag":403,"props":15283,"children":15284},{},[15285],{"type":28,"value":15286},"AI 后端可插拔，支持 DashScope、OpenAI 和自定义后端。自部署环境能用哪家模型差别很大，不能写死。",{"type":23,"tag":403,"props":15288,"children":15289},{},[15290],{"type":28,"value":15291},"端点、模型名、密钥这些配置从系统参数表动态读，运行时能改。",{"type":23,"tag":403,"props":15293,"children":15294},{},[15295],{"type":28,"value":15296},"内置了业务场景匹配：按关键词识别领域（零售、金融、游戏等），带着场景去翻，因为同一个词在不同行业的标准译法可能不一样。",{"type":23,"tag":403,"props":15298,"children":15299},{},[15300],{"type":28,"value":15301},"请求超时 60 秒、连接超时 10 秒，另外有个接口可以查 AI 服务当前能不能用。",{"type":23,"tag":24,"props":15303,"children":15304},{},[15305],{"type":28,"value":15306},"每个分词片段都要查一次词根库，批量生成时查询量会成倍放大，所以词根库和数据域都做了进程内缓存：词根缓存 1 分钟，只装 APPROVED 和 PENDING 两种状态；数据域变化少，缓存 5 分钟。",{"type":23,"tag":24,"props":15308,"children":15309},{},[15310],{"type":28,"value":15311},"缓存里放 PENDING 是故意的。AI 刚补进来的词还没审，如果不参与匹配，下次碰到同一个词会再翻一次、再入库一条，同一批名字还可能拼出不一致的结果。代价是没审过的词根会马上被复用，所以结果里必须把状态标清楚。审批通过时事件会主动清缓存；就算有改动没触发清理，滞后也不会超过一个缓存周期。",{"type":23,"tag":50,"props":15313,"children":15315},{"id":15314},"和-2024-年那套接口比",[15316],{"type":28,"value":15317},"和 2024 年那套接口比",{"type":23,"tag":24,"props":15319,"children":15320},{},[15321,15323,15329,15331,15337],{"type":28,"value":15322},"从中文描述分词、再拼词根，这条路我以前走过。2024 年我写过一篇",{"type":23,"tag":41,"props":15324,"children":15326},{"href":15325},"\u002Fblog\u002F2024-05-08-data-modeling-api\u002F",[15327],{"type":28,"value":15328},"建模工具的 API 说明",{"type":28,"value":15330},"，里面的「标准字段生成」接口干的就是这个：输入标准化后的中文字段注释，返回英文字段名。带分词的版本还会列出每个词根，比如「是否评审」拆成「是否」+「评审」，拼出 ",{"type":23,"tag":99,"props":15332,"children":15334},{"className":15333},[],[15335],{"type":28,"value":15336},"is_review",{"type":28,"value":287},{"type":23,"tag":24,"props":15339,"children":15340},{},[15341,15343,15349],{"type":28,"value":15342},"当时文档里写了几条短板：分词翻译准确率大约 75%，得积累大量行业词根；中文注释要先由人手工标准化；新词根的英文名按默认规则生成，「是否评审」作为整词时得到 ",{"type":23,"tag":99,"props":15344,"children":15346},{"className":15345},[],[15347],{"type":28,"value":15348},"whthr_rvw",{"type":28,"value":15350},"，要评审后再手工改。",{"type":23,"tag":24,"props":15352,"children":15353},{},[15354],{"type":28,"value":15355},"Genesis 换了做法。中文标准化合并进 AI 翻译这一步，改写过的会标出来；新词由 AI 同时给出全名和缩写，但一律以 PENDING 入库、进审批队列。翻译照样会错，区别在于错了有固定的地方拦住。",{"type":23,"tag":50,"props":15357,"children":15359},{"id":15358},"模型表字段",[15360],{"type":28,"value":15361},"模型、表、字段",{"type":23,"tag":24,"props":15363,"children":15364},{},[15365],{"type":28,"value":15366},"OneData 建模的设计单元是模型。一个模型装一组表和它们之间的关系，分逻辑模型和物理模型，归属某个数仓分层和数据域，在 AntV X6（一个前端画图库）的画布上编辑，画布布局跟着模型一起存。",{"type":23,"tag":24,"props":15368,"children":15369},{},[15370],{"type":28,"value":15371},"表设计的关键属性有这些：",{"type":23,"tag":399,"props":15373,"children":15374},{},[15375,15380,15385,15390],{"type":23,"tag":403,"props":15376,"children":15377},{},[15378],{"type":28,"value":15379},"表编码（规范化命名，可以直接用智能命名的结果）和中文名；",{"type":23,"tag":403,"props":15381,"children":15382},{},[15383],{"type":28,"value":15384},"表类型：事实表（FACT）、维表（DIMENSION）、汇总表（AGGREGATE）；",{"type":23,"tag":403,"props":15386,"children":15387},{},[15388],{"type":28,"value":15389},"分层、数据域和业务过程，业务过程会被指标血缘用到，后面会说；",{"type":23,"tag":403,"props":15391,"children":15392},{},[15393],{"type":28,"value":15394},"分区键、生命周期（天）、存储格式（ORC \u002F PARQUET \u002F TEXTFILE \u002F AVRO）。",{"type":23,"tag":24,"props":15396,"children":15397},{},[15398],{"type":28,"value":15399},"字段除了常规的 Hive 数据类型、长度精度、主键 \u002F 分区键 \u002F 可空标记和默认值，还有两项跟标准有关。一是字段类别，分度量（MEASURE）、维度（DIMENSION）、属性（ATTRIBUTE）。二是词根绑定：一个字段可以绑多个词根，绑定带排序号，记录的是有序的词根组合。",{"type":23,"tag":24,"props":15401,"children":15402},{},[15403],{"type":28,"value":15404},"表之间的关系单独建模：一对一、一对多、多对多，落到具体的源字段和目标字段，并记录 JOIN 类型（INNER \u002F LEFT \u002F RIGHT）。删除是级联的，删表连带字段和关系，删字段连带它的词根绑定，不会留下悬空的绑定干扰影响分析。",{"type":23,"tag":24,"props":15406,"children":15407},{},[15408],{"type":28,"value":15409},"模型每发布一次生成一个版本，除了变更摘要和变更明细，还存一份完整快照（表 + 字段）。任何一个版本单独拿出来都是完整的，不用从头重放变更；代价是存储冗余，模型越大越明显。",{"type":23,"tag":24,"props":15411,"children":15412},{},[15413],{"type":28,"value":15414},"表和字段设计好以后，可以直接生成 Hive 的建表语句（DDL）。生成器会按分层自动追加标准的审计字段，已经有的不重复加：",{"type":23,"tag":533,"props":15416,"children":15417},{},[15418,15439],{"type":23,"tag":537,"props":15419,"children":15420},{},[15421],{"type":23,"tag":541,"props":15422,"children":15423},{},[15424,15429,15434],{"type":23,"tag":545,"props":15425,"children":15426},{},[15427],{"type":28,"value":15428},"分层",{"type":23,"tag":545,"props":15430,"children":15431},{},[15432],{"type":28,"value":15433},"自动追加的字段",{"type":23,"tag":545,"props":15435,"children":15436},{},[15437],{"type":28,"value":15438},"用途",{"type":23,"tag":561,"props":15440,"children":15441},{},[15442,15485,15519],{"type":23,"tag":541,"props":15443,"children":15444},{},[15445,15450,15480],{"type":23,"tag":568,"props":15446,"children":15447},{},[15448],{"type":28,"value":15449},"ODS \u002F DWD",{"type":23,"tag":568,"props":15451,"children":15452},{},[15453,15459,15460,15466,15467,15473,15474],{"type":23,"tag":99,"props":15454,"children":15456},{"className":15455},[],[15457],{"type":28,"value":15458},"ds",{"type":28,"value":2541},{"type":23,"tag":99,"props":15461,"children":15463},{"className":15462},[],[15464],{"type":28,"value":15465},"etl_date",{"type":28,"value":2541},{"type":23,"tag":99,"props":15468,"children":15470},{"className":15469},[],[15471],{"type":28,"value":15472},"create_time",{"type":28,"value":2541},{"type":23,"tag":99,"props":15475,"children":15477},{"className":15476},[],[15478],{"type":28,"value":15479},"update_time",{"type":23,"tag":568,"props":15481,"children":15482},{},[15483],{"type":28,"value":15484},"分区日期 + ETL 时间 + 记录审计",{"type":23,"tag":541,"props":15486,"children":15487},{},[15488,15493,15514],{"type":23,"tag":568,"props":15489,"children":15490},{},[15491],{"type":28,"value":15492},"DWS \u002F ADS",{"type":23,"tag":568,"props":15494,"children":15495},{},[15496,15502,15503,15508,15509],{"type":23,"tag":99,"props":15497,"children":15499},{"className":15498},[],[15500],{"type":28,"value":15501},"dt",{"type":28,"value":2541},{"type":23,"tag":99,"props":15504,"children":15506},{"className":15505},[],[15507],{"type":28,"value":15465},{"type":28,"value":2541},{"type":23,"tag":99,"props":15510,"children":15512},{"className":15511},[],[15513],{"type":28,"value":15472},{"type":23,"tag":568,"props":15515,"children":15516},{},[15517],{"type":28,"value":15518},"统计日期 + ETL 时间",{"type":23,"tag":541,"props":15520,"children":15521},{},[15522,15527,15568],{"type":23,"tag":568,"props":15523,"children":15524},{},[15525],{"type":28,"value":15526},"DIM",{"type":23,"tag":568,"props":15528,"children":15529},{},[15530,15536,15537,15543,15544,15550,15551,15556,15557,15562,15563],{"type":23,"tag":99,"props":15531,"children":15533},{"className":15532},[],[15534],{"type":28,"value":15535},"start_date",{"type":28,"value":2541},{"type":23,"tag":99,"props":15538,"children":15540},{"className":15539},[],[15541],{"type":28,"value":15542},"end_date",{"type":28,"value":2541},{"type":23,"tag":99,"props":15545,"children":15547},{"className":15546},[],[15548],{"type":28,"value":15549},"is_current",{"type":28,"value":2541},{"type":23,"tag":99,"props":15552,"children":15554},{"className":15553},[],[15555],{"type":28,"value":15465},{"type":28,"value":2541},{"type":23,"tag":99,"props":15558,"children":15560},{"className":15559},[],[15561],{"type":28,"value":15472},{"type":28,"value":2541},{"type":23,"tag":99,"props":15564,"children":15566},{"className":15565},[],[15567],{"type":28,"value":15479},{"type":23,"tag":568,"props":15569,"children":15570},{},[15571],{"type":28,"value":15572},"拉链有效期 + 审计",{"type":23,"tag":24,"props":15574,"children":15575},{},[15576,15578,15583,15584,15589,15590,15595],{"type":28,"value":15577},"DIM 那一行的 ",{"type":23,"tag":99,"props":15579,"children":15581},{"className":15580},[],[15582],{"type":28,"value":15535},{"type":28,"value":2541},{"type":23,"tag":99,"props":15585,"children":15587},{"className":15586},[],[15588],{"type":28,"value":15542},{"type":28,"value":2541},{"type":23,"tag":99,"props":15591,"children":15593},{"className":15592},[],[15594],{"type":28,"value":15549},{"type":28,"value":15596}," 是拉链表的三个字段：维度的每个历史版本存一行，记下生效起止日期和是不是当前版本。",{"type":23,"tag":24,"props":15598,"children":15599},{},[15600,15602,15607,15608,15613,15615,15621,15622,15628,15629,15635],{"type":28,"value":15601},"另外几条规则：审计字段里有 ",{"type":23,"tag":99,"props":15603,"children":15605},{"className":15604},[],[15606],{"type":28,"value":15458},{"type":28,"value":2597},{"type":23,"tag":99,"props":15609,"children":15611},{"className":15610},[],[15612],{"type":28,"value":15501},{"type":28,"value":15614}," 时默认按它分区，用户显式设置的分区键优先；默认存储格式 ORC、压缩 SNAPPY；生成的语句支持 ",{"type":23,"tag":99,"props":15616,"children":15618},{"className":15617},[],[15619],{"type":28,"value":15620},"PARTITIONED BY",{"type":28,"value":2541},{"type":23,"tag":99,"props":15623,"children":15625},{"className":15624},[],[15626],{"type":28,"value":15627},"STORED AS",{"type":28,"value":1148},{"type":23,"tag":99,"props":15630,"children":15632},{"className":15631},[],[15633],{"type":28,"value":15634},"TBLPROPERTIES",{"type":28,"value":287},{"type":23,"tag":24,"props":15637,"children":15638},{},[15639,15641,15646,15648,15653,15655,15660,15662,15667],{"type":28,"value":15640},"审计字段交给生成器补，没有写进规范文档靠人记，因为这类字段最容易漏，漏了以后排查和回溯都麻烦。明细层用 ",{"type":23,"tag":99,"props":15642,"children":15644},{"className":15643},[],[15645],{"type":28,"value":15458},{"type":28,"value":15647},"（分区日期），汇总层用 ",{"type":23,"tag":99,"props":15649,"children":15651},{"className":15650},[],[15652],{"type":28,"value":15501},{"type":28,"value":15654},"（统计日期），看字段名就能分清两种日期口径。汇总层只留 ",{"type":23,"tag":99,"props":15656,"children":15658},{"className":15657},[],[15659],{"type":28,"value":15472},{"type":28,"value":15661},"、不加 ",{"type":23,"tag":99,"props":15663,"children":15665},{"className":15664},[],[15666],{"type":28,"value":15479},{"type":28,"value":15668},"，因为汇总数据一般按分区整体重算，记录级的更新时间用处不大。",{"type":23,"tag":24,"props":15670,"children":15671},{},[15672],{"type":28,"value":15673},"模型设计完可以直接发布到 IDE：生成的 DDL 写进一个数据库类型的开发节点，IDE 文件树自动刷新，建模和开发之间不用再复制粘贴。",{"type":23,"tag":50,"props":15675,"children":15677},{"id":15676},"改词根之前先查影响面",[15678],{"type":28,"value":15676},{"type":23,"tag":24,"props":15680,"children":15681},{},[15682],{"type":28,"value":15683},"词根定下来以后迟早要改，缩写不合适要换，类型分错要调。改之前得先知道会动到谁。",{"type":23,"tag":24,"props":15685,"children":15686},{},[15687,15689,15694,15696,15701],{"type":28,"value":15688},"因为字段和指标都通过绑定表关联词根，这件事可以直接查：从 ",{"type":23,"tag":99,"props":15690,"children":15692},{"className":15691},[],[15693],{"type":28,"value":14721},{"type":28,"value":15695}," 找到绑了这个词根的字段，再沿字段、表、模型一级级往上；从 ",{"type":23,"tag":99,"props":15697,"children":15699},{"className":15698},[],[15700],{"type":28,"value":14729},{"type":28,"value":15702}," 找到用它当修饰词的指标。",{"type":23,"tag":24,"props":15704,"children":15705},{},[15706],{"type":23,"tag":65,"props":15707,"children":15710},{"alt":15708,"src":15709},"影响分析和治理分：词根 usr 经 field_word_root 找到字段 usr_id、表 dwd_usr_order_di、模型 user_order_model，经 indicator_modifier 找到指标 usr_active_cnt（活跃用户数），totalCount 为 2；下半部分是治理分，按 boundFields \u002F totalFields × 100 计算，≥80% 绿、≥50% 黄、\u003C50% 红、没有字段时灰","\u002Fimages\u002Fblog\u002Fgenesis-onedata\u002Fimpact-and-score.svg",[],{"type":23,"tag":24,"props":15712,"children":15713},{},[15714],{"type":28,"value":15715},"接口返回的结构是这样的：",{"type":23,"tag":2152,"props":15717,"children":15719},{"code":15718,"language":10799,"meta":8,"className":10797,"style":8},"{\n  \"wordRootId\": 1,\n  \"rootCode\": \"usr\",\n  \"rootName\": \"用户\",\n  \"fields\": [\n    { \"fieldCode\": \"usr_id\", \"tableCode\": \"dwd_usr_order_di\", \"modelCode\": \"user_order_model\" }\n  ],\n  \"indicators\": [\n    { \"indicatorCode\": \"usr_active_cnt\", \"indicatorName\": \"活跃用户数\" }\n  ],\n  \"totalCount\": 2\n}\n",[15720],{"type":23,"tag":99,"props":15721,"children":15722},{"__ignoreMap":8},[15723,15731,15752,15773,15794,15807,15869,15877,15889,15932,15939,15956],{"type":23,"tag":2161,"props":15724,"children":15725},{"class":2163,"line":2164},[15726],{"type":23,"tag":2161,"props":15727,"children":15728},{"style":5830},[15729],{"type":28,"value":15730},"{\n",{"type":23,"tag":2161,"props":15732,"children":15733},{"class":2163,"line":927},[15734,15739,15743,15747],{"type":23,"tag":2161,"props":15735,"children":15736},{"style":5844},[15737],{"type":28,"value":15738},"  \"wordRootId\"",{"type":23,"tag":2161,"props":15740,"children":15741},{"style":5830},[15742],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15744,"children":15745},{"style":5844},[15746],{"type":28,"value":3641},{"type":23,"tag":2161,"props":15748,"children":15749},{"style":5830},[15750],{"type":28,"value":15751},",\n",{"type":23,"tag":2161,"props":15753,"children":15754},{"class":2163,"line":924},[15755,15760,15764,15769],{"type":23,"tag":2161,"props":15756,"children":15757},{"style":5844},[15758],{"type":28,"value":15759},"  \"rootCode\"",{"type":23,"tag":2161,"props":15761,"children":15762},{"style":5830},[15763],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15765,"children":15766},{"style":5855},[15767],{"type":28,"value":15768},"\"usr\"",{"type":23,"tag":2161,"props":15770,"children":15771},{"style":5830},[15772],{"type":28,"value":15751},{"type":23,"tag":2161,"props":15774,"children":15775},{"class":2163,"line":2190},[15776,15781,15785,15790],{"type":23,"tag":2161,"props":15777,"children":15778},{"style":5844},[15779],{"type":28,"value":15780},"  \"rootName\"",{"type":23,"tag":2161,"props":15782,"children":15783},{"style":5830},[15784],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15786,"children":15787},{"style":5855},[15788],{"type":28,"value":15789},"\"用户\"",{"type":23,"tag":2161,"props":15791,"children":15792},{"style":5830},[15793],{"type":28,"value":15751},{"type":23,"tag":2161,"props":15795,"children":15796},{"class":2163,"line":2199},[15797,15802],{"type":23,"tag":2161,"props":15798,"children":15799},{"style":5844},[15800],{"type":28,"value":15801},"  \"fields\"",{"type":23,"tag":2161,"props":15803,"children":15804},{"style":5830},[15805],{"type":28,"value":15806},": [\n",{"type":23,"tag":2161,"props":15808,"children":15809},{"class":2163,"line":2208},[15810,15815,15820,15824,15829,15833,15838,15842,15847,15851,15856,15860,15865],{"type":23,"tag":2161,"props":15811,"children":15812},{"style":5830},[15813],{"type":28,"value":15814},"    { ",{"type":23,"tag":2161,"props":15816,"children":15817},{"style":5844},[15818],{"type":28,"value":15819},"\"fieldCode\"",{"type":23,"tag":2161,"props":15821,"children":15822},{"style":5830},[15823],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15825,"children":15826},{"style":5855},[15827],{"type":28,"value":15828},"\"usr_id\"",{"type":23,"tag":2161,"props":15830,"children":15831},{"style":5830},[15832],{"type":28,"value":10616},{"type":23,"tag":2161,"props":15834,"children":15835},{"style":5844},[15836],{"type":28,"value":15837},"\"tableCode\"",{"type":23,"tag":2161,"props":15839,"children":15840},{"style":5830},[15841],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15843,"children":15844},{"style":5855},[15845],{"type":28,"value":15846},"\"dwd_usr_order_di\"",{"type":23,"tag":2161,"props":15848,"children":15849},{"style":5830},[15850],{"type":28,"value":10616},{"type":23,"tag":2161,"props":15852,"children":15853},{"style":5844},[15854],{"type":28,"value":15855},"\"modelCode\"",{"type":23,"tag":2161,"props":15857,"children":15858},{"style":5830},[15859],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15861,"children":15862},{"style":5855},[15863],{"type":28,"value":15864},"\"user_order_model\"",{"type":23,"tag":2161,"props":15866,"children":15867},{"style":5830},[15868],{"type":28,"value":10871},{"type":23,"tag":2161,"props":15870,"children":15871},{"class":2163,"line":2217},[15872],{"type":23,"tag":2161,"props":15873,"children":15874},{"style":5830},[15875],{"type":28,"value":15876},"  ],\n",{"type":23,"tag":2161,"props":15878,"children":15879},{"class":2163,"line":2226},[15880,15885],{"type":23,"tag":2161,"props":15881,"children":15882},{"style":5844},[15883],{"type":28,"value":15884},"  \"indicators\"",{"type":23,"tag":2161,"props":15886,"children":15887},{"style":5830},[15888],{"type":28,"value":15806},{"type":23,"tag":2161,"props":15890,"children":15891},{"class":2163,"line":2235},[15892,15896,15901,15905,15910,15914,15919,15923,15928],{"type":23,"tag":2161,"props":15893,"children":15894},{"style":5830},[15895],{"type":28,"value":15814},{"type":23,"tag":2161,"props":15897,"children":15898},{"style":5844},[15899],{"type":28,"value":15900},"\"indicatorCode\"",{"type":23,"tag":2161,"props":15902,"children":15903},{"style":5830},[15904],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15906,"children":15907},{"style":5855},[15908],{"type":28,"value":15909},"\"usr_active_cnt\"",{"type":23,"tag":2161,"props":15911,"children":15912},{"style":5830},[15913],{"type":28,"value":10616},{"type":23,"tag":2161,"props":15915,"children":15916},{"style":5844},[15917],{"type":28,"value":15918},"\"indicatorName\"",{"type":23,"tag":2161,"props":15920,"children":15921},{"style":5830},[15922],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15924,"children":15925},{"style":5855},[15926],{"type":28,"value":15927},"\"活跃用户数\"",{"type":23,"tag":2161,"props":15929,"children":15930},{"style":5830},[15931],{"type":28,"value":10871},{"type":23,"tag":2161,"props":15933,"children":15934},{"class":2163,"line":2244},[15935],{"type":23,"tag":2161,"props":15936,"children":15937},{"style":5830},[15938],{"type":28,"value":15876},{"type":23,"tag":2161,"props":15940,"children":15941},{"class":2163,"line":2253},[15942,15947,15951],{"type":23,"tag":2161,"props":15943,"children":15944},{"style":5844},[15945],{"type":28,"value":15946},"  \"totalCount\"",{"type":23,"tag":2161,"props":15948,"children":15949},{"style":5830},[15950],{"type":28,"value":10826},{"type":23,"tag":2161,"props":15952,"children":15953},{"style":5844},[15954],{"type":28,"value":15955},"2\n",{"type":23,"tag":2161,"props":15957,"children":15958},{"class":2163,"line":6337},[15959],{"type":23,"tag":2161,"props":15960,"children":15961},{"style":5830},[15962],{"type":28,"value":5964},{"type":23,"tag":24,"props":15964,"children":15965},{},[15966,15968,15973],{"type":28,"value":15967},"这里故意没按字符串去搜字段名。",{"type":23,"tag":99,"props":15969,"children":15971},{"className":15970},[],[15972],{"type":28,"value":14662},{"type":28,"value":15974}," 这种短缩写做子串匹配，误报会很多，字段改过名还会跟丢，显式绑定没有这两个问题。",{"type":23,"tag":24,"props":15976,"children":15977},{},[15978,15980,15986],{"type":28,"value":15979},"前提是字段真的绑了词根，手敲的、没走绑定的字段在影响分析里看不到。为了把这块盲区摆到明面上，每张表算一个治理分，也就是词根绑定率（",{"type":23,"tag":99,"props":15981,"children":15983},{"className":15982},[],[15984],{"type":28,"value":15985},"boundFields \u002F totalFields * 100",{"type":28,"value":15987},"），在模型画布上作为表的徽章显示：≥80% 绿色，≥50% 黄色，\u003C50% 红色，表里没有字段时灰色。治理分只衡量绑定覆盖率，名字起得好不好它管不着；分数低，说明这张表的字段在影响分析里大片不可见。",{"type":23,"tag":24,"props":15989,"children":15990},{},[15991,15993,15999],{"type":28,"value":15992},"平台之外，词根可以同步到 Apache Atlas（一个元数据和血缘管理系统）的业务术语表，模型、表、指标同步成自定义实体，指标通过 ",{"type":23,"tag":99,"props":15994,"children":15996},{"className":15995},[],[15997],{"type":28,"value":15998},"inputs",{"type":28,"value":16000}," 关系连到源表。源表这样定：先找和指标同一业务过程的表，找不到再退到同一数据域。所以这条血缘是按归属推断出来的，没解析 SQL，粒度比较粗，准不准取决于表和指标的归属信息填得对不对。",{"type":23,"tag":24,"props":16002,"children":16003},{},[16004],{"type":28,"value":16005},"还有一点和 2024 年时一样：这套东西最费劲的是攒词根库，代码反倒是小头。AI 翻译能减轻一些，替代不了。",{"type":23,"tag":2730,"props":16007,"children":16008},{},[16009],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":16011},[16012,16013,16014,16015,16016,16017,16018],{"id":14695,"depth":927,"text":14695},{"id":14760,"depth":927,"text":14760},{"id":15053,"depth":927,"text":15056},{"id":15147,"depth":927,"text":15147},{"id":15314,"depth":927,"text":15317},{"id":15358,"depth":927,"text":15361},{"id":15676,"depth":927,"text":15676},"content:blog:2026-08-22-genesis-onedata-standards.md","blog\u002F2026-08-22-genesis-onedata-standards.md","blog\u002F2026-08-22-genesis-onedata-standards",{"_path":16023,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":16024,"description":16025,"date":16026,"tags":16027,"body":16031,"_type":937,"_id":16708,"_source":939,"_file":16709,"_stem":16710,"_extension":942},"\u002Fblog\u002F2026-05-18-hello-world","Hello, World：这个站是怎么搭起来的","这个站用 Nuxt 3 静态生成，文件放在家里 NAS 的 nginx 容器里，经 Cloudflare Tunnel 对外，没有放 Vercel。记一下选型和整条部署链路。","2026-05-18",[16028,16029,16030],"nuxt","个人站","cloudflare-tunnel",{"type":20,"children":16032,"toc":16702},[16033,16038,16043,16049,16054,16180,16206,16319,16340,16345,16353,16390,16395,16409,16421,16426,16431,16439,16468,16504,16617,16660,16665,16670,16693,16698],{"type":23,"tag":24,"props":16034,"children":16035},{},[16036],{"type":28,"value":16037},"工作里造过不少系统，代码、想法和踩过的坑散在各处。我一直想要一个地方把它们串起来，不为引流，也不为简历，就是给自己留一个能反复回看的归档。",{"type":23,"tag":24,"props":16039,"children":16040},{},[16041],{"type":28,"value":16042},"开博客之前，我拿一句话说服过自己：「好的工程师把项目交付掉就完了，会写作的工程师把项目变成可复利的资产。」这句不是名言，是我自己编的。",{"type":23,"tag":50,"props":16044,"children":16046},{"id":16045},"为什么选-nuxt-3",[16047],{"type":28,"value":16048},"为什么选 Nuxt 3",{"type":23,"tag":24,"props":16050,"children":16051},{},[16052],{"type":28,"value":16053},"候选有三个：Astro、Next.js、Nuxt 3。我要的是静态生成（SSG）：构建的时候把每个页面提前渲染成 HTML 文件，线上只要一个能发文件的 web 服务器，不用常驻一个 Node 进程。",{"type":23,"tag":533,"props":16055,"children":16056},{},[16057,16084],{"type":23,"tag":537,"props":16058,"children":16059},{},[16060],{"type":23,"tag":541,"props":16061,"children":16062},{},[16063,16068,16074,16079],{"type":23,"tag":545,"props":16064,"children":16065},{},[16066],{"type":28,"value":16067},"维度",{"type":23,"tag":545,"props":16069,"children":16071},{"align":16070},"center",[16072],{"type":28,"value":16073},"Astro",{"type":23,"tag":545,"props":16075,"children":16076},{"align":16070},[16077],{"type":28,"value":16078},"Next.js",{"type":23,"tag":545,"props":16080,"children":16081},{"align":16070},[16082],{"type":28,"value":16083},"Nuxt 3",{"type":23,"tag":561,"props":16085,"children":16086},{},[16087,16109,16136,16158],{"type":23,"tag":541,"props":16088,"children":16089},{},[16090,16095,16100,16105],{"type":23,"tag":568,"props":16091,"children":16092},{},[16093],{"type":28,"value":16094},"SSG 能力",{"type":23,"tag":568,"props":16096,"children":16097},{"align":16070},[16098],{"type":28,"value":16099},"强",{"type":23,"tag":568,"props":16101,"children":16102},{"align":16070},[16103],{"type":28,"value":16104},"一般",{"type":23,"tag":568,"props":16106,"children":16107},{"align":16070},[16108],{"type":28,"value":16099},{"type":23,"tag":541,"props":16110,"children":16111},{},[16112,16117,16122,16127],{"type":23,"tag":568,"props":16113,"children":16114},{},[16115],{"type":28,"value":16116},"内容生态",{"type":23,"tag":568,"props":16118,"children":16119},{"align":16070},[16120],{"type":28,"value":16121},"Content Collections",{"type":23,"tag":568,"props":16123,"children":16124},{"align":16070},[16125],{"type":28,"value":16126},"MDX",{"type":23,"tag":568,"props":16128,"children":16129},{"align":16070},[16130],{"type":23,"tag":99,"props":16131,"children":16133},{"className":16132},[],[16134],{"type":28,"value":16135},"@nuxt\u002Fcontent",{"type":23,"tag":541,"props":16137,"children":16138},{},[16139,16144,16149,16153],{"type":23,"tag":568,"props":16140,"children":16141},{},[16142],{"type":28,"value":16143},"与现有 Vue 项目栈一致",{"type":23,"tag":568,"props":16145,"children":16146},{"align":16070},[16147],{"type":28,"value":16148},"否",{"type":23,"tag":568,"props":16150,"children":16151},{"align":16070},[16152],{"type":28,"value":16148},{"type":23,"tag":568,"props":16154,"children":16155},{"align":16070},[16156],{"type":28,"value":16157},"是",{"type":23,"tag":541,"props":16159,"children":16160},{},[16161,16166,16171,16176],{"type":23,"tag":568,"props":16162,"children":16163},{},[16164],{"type":28,"value":16165},"部署到 NAS 静态目录",{"type":23,"tag":568,"props":16167,"children":16168},{"align":16070},[16169],{"type":28,"value":16170},"可以",{"type":23,"tag":568,"props":16172,"children":16173},{"align":16070},[16174],{"type":28,"value":16175},"需额外适配",{"type":23,"tag":568,"props":16177,"children":16178},{"align":16070},[16179],{"type":28,"value":16170},{"type":23,"tag":24,"props":16181,"children":16182},{},[16183,16185,16190,16192,16197,16199,16205],{"type":28,"value":16184},"最后选了 Nuxt 3，理由就三条。我平时在做的 ",{"type":23,"tag":41,"props":16186,"children":16188},{"href":1518,"rel":16187},[963],[16189],{"type":28,"value":46},{"type":28,"value":16191}," 平台，前端就是 Vue，两边用同一套东西，脑子不用来回切。",{"type":23,"tag":99,"props":16193,"children":16195},{"className":16194},[],[16196],{"type":28,"value":16135},{"type":28,"value":16198}," 能把 Markdown 当数据库查，博客列表页就是一句 ",{"type":23,"tag":99,"props":16200,"children":16202},{"className":16201},[],[16203],{"type":28,"value":16204},"queryContent",{"type":28,"value":445},{"type":23,"tag":2152,"props":16207,"children":16209},{"className":14237,"code":16208,"language":12012,"meta":8,"style":8},"queryContent\u003CPost>('\u002Fblog')\n  .where({ _draft: { $ne: true } })\n  .sort({ date: -1 })\n  .find()\n",[16210],{"type":23,"tag":99,"props":16211,"children":16212},{"__ignoreMap":8},[16213,16244,16272,16302],{"type":23,"tag":2161,"props":16214,"children":16215},{"class":2163,"line":2164},[16216,16220,16225,16230,16235,16240],{"type":23,"tag":2161,"props":16217,"children":16218},{"style":5824},[16219],{"type":28,"value":16204},{"type":23,"tag":2161,"props":16221,"children":16222},{"style":5830},[16223],{"type":28,"value":16224},"\u003C",{"type":23,"tag":2161,"props":16226,"children":16227},{"style":5824},[16228],{"type":28,"value":16229},"Post",{"type":23,"tag":2161,"props":16231,"children":16232},{"style":5830},[16233],{"type":28,"value":16234},">(",{"type":23,"tag":2161,"props":16236,"children":16237},{"style":5855},[16238],{"type":28,"value":16239},"'\u002Fblog'",{"type":23,"tag":2161,"props":16241,"children":16242},{"style":5830},[16243],{"type":28,"value":11451},{"type":23,"tag":2161,"props":16245,"children":16246},{"class":2163,"line":927},[16247,16252,16257,16262,16267],{"type":23,"tag":2161,"props":16248,"children":16249},{"style":5830},[16250],{"type":28,"value":16251},"  .",{"type":23,"tag":2161,"props":16253,"children":16254},{"style":5824},[16255],{"type":28,"value":16256},"where",{"type":23,"tag":2161,"props":16258,"children":16259},{"style":5830},[16260],{"type":28,"value":16261},"({ _draft: { $ne: ",{"type":23,"tag":2161,"props":16263,"children":16264},{"style":5844},[16265],{"type":28,"value":16266},"true",{"type":23,"tag":2161,"props":16268,"children":16269},{"style":5830},[16270],{"type":28,"value":16271}," } })\n",{"type":23,"tag":2161,"props":16273,"children":16274},{"class":2163,"line":924},[16275,16279,16284,16289,16293,16297],{"type":23,"tag":2161,"props":16276,"children":16277},{"style":5830},[16278],{"type":28,"value":16251},{"type":23,"tag":2161,"props":16280,"children":16281},{"style":5824},[16282],{"type":28,"value":16283},"sort",{"type":23,"tag":2161,"props":16285,"children":16286},{"style":5830},[16287],{"type":28,"value":16288},"({ date: ",{"type":23,"tag":2161,"props":16290,"children":16291},{"style":5948},[16292],{"type":28,"value":11512},{"type":23,"tag":2161,"props":16294,"children":16295},{"style":5844},[16296],{"type":28,"value":3641},{"type":23,"tag":2161,"props":16298,"children":16299},{"style":5830},[16300],{"type":28,"value":16301}," })\n",{"type":23,"tag":2161,"props":16303,"children":16304},{"class":2163,"line":2190},[16305,16309,16314],{"type":23,"tag":2161,"props":16306,"children":16307},{"style":5830},[16308],{"type":28,"value":16251},{"type":23,"tag":2161,"props":16310,"children":16311},{"style":5824},[16312],{"type":28,"value":16313},"find",{"type":23,"tag":2161,"props":16315,"children":16316},{"style":5830},[16317],{"type":28,"value":16318},"()\n",{"type":23,"tag":24,"props":16320,"children":16321},{},[16322,16324,16330,16332,16338],{"type":28,"value":16323},"意思是：取 ",{"type":23,"tag":99,"props":16325,"children":16327},{"className":16326},[],[16328],{"type":28,"value":16329},"content\u002Fblog\u002F",{"type":28,"value":16331}," 下所有文章，去掉标了草稿的，按日期倒序。还有 ",{"type":23,"tag":99,"props":16333,"children":16335},{"className":16334},[],[16336],{"type":28,"value":16337},"nuxt generate",{"type":28,"value":16339}," 一条命令出纯静态产物，扔进 nginx 就能用。",{"type":23,"tag":50,"props":16341,"children":16343},{"id":16342},"一个请求怎么走到这个站",[16344],{"type":28,"value":16342},{"type":23,"tag":24,"props":16346,"children":16347},{},[16348],{"type":23,"tag":65,"props":16349,"children":16352},{"alt":16350,"src":16351},"这个站的访问链路：浏览器经 HTTPS 到 Cloudflare 边缘，再经 Cloudflare Tunnel（复用已有的 tunnel1）进到家里 NAS 上的 cloudflared 容器，转给 personal-site 这个 nginx:alpine 容器，它读的是挂载进来的 NAS 上 personal-site\u002Fdist 目录","\u002Fimages\u002Fblog\u002Fhello-world\u002Fdeploy-topology.svg",[],{"type":23,"tag":24,"props":16354,"children":16355},{},[16356,16358,16364,16366,16372,16374,16380,16382,16388],{"type":28,"value":16357},"站点的文件放在家里的 NAS 上。NAS 上跑着一个 ",{"type":23,"tag":99,"props":16359,"children":16361},{"className":16360},[],[16362],{"type":28,"value":16363},"nginx:alpine",{"type":28,"value":16365}," 容器，名字叫 ",{"type":23,"tag":99,"props":16367,"children":16369},{"className":16368},[],[16370],{"type":28,"value":16371},"personal-site",{"type":28,"value":16373},"，NAS 上的 ",{"type":23,"tag":99,"props":16375,"children":16377},{"className":16376},[],[16378],{"type":28,"value":16379},"personal-site\u002Fdist",{"type":28,"value":16381}," 目录挂到容器里的 ",{"type":23,"tag":99,"props":16383,"children":16385},{"className":16384},[],[16386],{"type":28,"value":16387},"\u002Fusr\u002Fshare\u002Fnginx\u002Fhtml",{"type":28,"value":16389},"，nginx 就把这个目录里的文件原样发出去。",{"type":23,"tag":24,"props":16391,"children":16392},{},[16393],{"type":28,"value":16394},"家里没有对外开端口，外面的请求是靠 Cloudflare Tunnel 进来的。它的做法是在内网跑一个 cloudflared，由它主动连到 Cloudflare，外面的请求再顺着这条连接转进来。隧道我没有新建，复用了已有的 tunnel1，只加了一条 ingress 规则：",{"type":23,"tag":2152,"props":16396,"children":16398},{"className":2154,"code":16397,"language":28,"meta":8,"style":8},"resume.genesis-platform.cn → http:\u002F\u002Fpersonal-site\n",[16399],{"type":23,"tag":99,"props":16400,"children":16401},{"__ignoreMap":8},[16402],{"type":23,"tag":2161,"props":16403,"children":16404},{"class":2163,"line":2164},[16405],{"type":23,"tag":2161,"props":16406,"children":16407},{},[16408],{"type":28,"value":16397},{"type":23,"tag":24,"props":16410,"children":16411},{},[16412,16414,16419],{"type":28,"value":16413},"箭头后面的 ",{"type":23,"tag":99,"props":16415,"children":16417},{"className":16416},[],[16418],{"type":28,"value":16371},{"type":28,"value":16420}," 就是那个 nginx 容器的名字，cloudflared 也跑在 NAS 的 Docker 里，按容器名就能找到它。",{"type":23,"tag":24,"props":16422,"children":16423},{},[16424],{"type":28,"value":16425},"整条链路里没有一行「服务器代码」。HTTPS 由 Cloudflare 边缘负责，页面被 CDN 缓存住以后，请求不会回到家里，NAS 的 CPU 占用接近 0。",{"type":23,"tag":50,"props":16427,"children":16429},{"id":16428},"写完一篇怎么上线",[16430],{"type":28,"value":16428},{"type":23,"tag":24,"props":16432,"children":16433},{},[16434],{"type":23,"tag":65,"props":16435,"children":16438},{"alt":16436,"src":16437},"发布流程：本地写 Markdown，npm run generate 生成 .output\u002Fpublic；NAS 上先把 dist 备份成 dist.bak.时间戳、只留最近 5 份，再用 tar 管道经 SSH 写入 dist，docker exec 进容器 nginx -s reload；最后 curl 公网地址看到 200 算完成","\u002Fimages\u002Fblog\u002Fhello-world\u002Fpublish-flow.svg",[],{"type":23,"tag":24,"props":16440,"children":16441},{},[16442,16444,16450,16452,16458,16460,16466],{"type":28,"value":16443},"本地跑 ",{"type":23,"tag":99,"props":16445,"children":16447},{"className":16446},[],[16448],{"type":28,"value":16449},"npm run generate",{"type":28,"value":16451},"，产物在 ",{"type":23,"tag":99,"props":16453,"children":16455},{"className":16454},[],[16456],{"type":28,"value":16457},".output\u002Fpublic\u002F",{"type":28,"value":16459},"，全是 HTML、CSS、JS 和图片。把它同步到 NAS 的 ",{"type":23,"tag":99,"props":16461,"children":16463},{"className":16462},[],[16464],{"type":28,"value":16465},"dist\u002F",{"type":28,"value":16467}," 目录，nginx 直接发新文件，Cloudflare Tunnel 照常转发，别的什么都不用动。",{"type":23,"tag":24,"props":16469,"children":16470},{},[16471,16473,16479,16481,16487,16488,16494,16496,16502],{"type":28,"value":16472},"最早的打算是 ",{"type":23,"tag":99,"props":16474,"children":16476},{"className":16475},[],[16477],{"type":28,"value":16478},"pnpm generate",{"type":28,"value":16480}," 加 rsync，上线当天两样都换掉了。pnpm 卡在 corepack 上：",{"type":23,"tag":99,"props":16482,"children":16484},{"className":16483},[],[16485],{"type":28,"value":16486},"package.json",{"type":28,"value":173},{"type":23,"tag":99,"props":16489,"children":16491},{"className":16490},[],[16492],{"type":28,"value":16493},"packageManager",{"type":28,"value":16495}," 字段锁了版本，corepack 拉不到对应的 pnpm，我就删了这个字段，改回 npm。rsync 是绿联 NAS 那边不让用：它的 rsync daemon 要以 root 身份切换用户，我的登录账号做不到，一直报 ",{"type":23,"tag":99,"props":16497,"children":16499},{"className":16498},[],[16500],{"type":28,"value":16501},"cannot set euid as root",{"type":28,"value":16503},"。最后改成本地用 tar 打包，经 SSH 管道到 NAS 上解包：",{"type":23,"tag":2152,"props":16505,"children":16507},{"className":5795,"code":16506,"language":5797,"meta":8,"style":8},"tar --exclude '.DS_Store' -cf - -C .output\u002Fpublic . \\\n  | ssh \"$NAS_HOST\" \"rm -rf '$NAS_DIST'\u002F* '$NAS_DIST'\u002F.[!.]* 2>\u002Fdev\u002Fnull; tar -xf - -C '$NAS_DIST\u002F'\"\n",[16508],{"type":23,"tag":99,"props":16509,"children":16510},{"__ignoreMap":8},[16511,16558],{"type":23,"tag":2161,"props":16512,"children":16513},{"class":2163,"line":2164},[16514,16519,16524,16529,16534,16539,16544,16549,16554],{"type":23,"tag":2161,"props":16515,"children":16516},{"style":5824},[16517],{"type":28,"value":16518},"tar",{"type":23,"tag":2161,"props":16520,"children":16521},{"style":5844},[16522],{"type":28,"value":16523}," --exclude",{"type":23,"tag":2161,"props":16525,"children":16526},{"style":5855},[16527],{"type":28,"value":16528}," '.DS_Store'",{"type":23,"tag":2161,"props":16530,"children":16531},{"style":5844},[16532],{"type":28,"value":16533}," -cf",{"type":23,"tag":2161,"props":16535,"children":16536},{"style":5855},[16537],{"type":28,"value":16538}," -",{"type":23,"tag":2161,"props":16540,"children":16541},{"style":5844},[16542],{"type":28,"value":16543}," -C",{"type":23,"tag":2161,"props":16545,"children":16546},{"style":5855},[16547],{"type":28,"value":16548}," .output\u002Fpublic",{"type":23,"tag":2161,"props":16550,"children":16551},{"style":5855},[16552],{"type":28,"value":16553}," .",{"type":23,"tag":2161,"props":16555,"children":16556},{"style":5844},[16557],{"type":28,"value":5876},{"type":23,"tag":2161,"props":16559,"children":16560},{"class":2163,"line":927},[16561,16566,16571,16575,16580,16584,16589,16594,16599,16603,16608,16612],{"type":23,"tag":2161,"props":16562,"children":16563},{"style":5948},[16564],{"type":28,"value":16565},"  |",{"type":23,"tag":2161,"props":16567,"children":16568},{"style":5824},[16569],{"type":28,"value":16570}," ssh",{"type":23,"tag":2161,"props":16572,"children":16573},{"style":5855},[16574],{"type":28,"value":6126},{"type":23,"tag":2161,"props":16576,"children":16577},{"style":5830},[16578],{"type":28,"value":16579},"$NAS_HOST",{"type":23,"tag":2161,"props":16581,"children":16582},{"style":5855},[16583],{"type":28,"value":6136},{"type":23,"tag":2161,"props":16585,"children":16586},{"style":5855},[16587],{"type":28,"value":16588}," \"rm -rf '",{"type":23,"tag":2161,"props":16590,"children":16591},{"style":5830},[16592],{"type":28,"value":16593},"$NAS_DIST",{"type":23,"tag":2161,"props":16595,"children":16596},{"style":5855},[16597],{"type":28,"value":16598},"'\u002F* '",{"type":23,"tag":2161,"props":16600,"children":16601},{"style":5830},[16602],{"type":28,"value":16593},{"type":23,"tag":2161,"props":16604,"children":16605},{"style":5855},[16606],{"type":28,"value":16607},"'\u002F.[!.]* 2>\u002Fdev\u002Fnull; tar -xf - -C '",{"type":23,"tag":2161,"props":16609,"children":16610},{"style":5830},[16611],{"type":28,"value":16593},{"type":23,"tag":2161,"props":16613,"children":16614},{"style":5855},[16615],{"type":28,"value":16616},"\u002F'\"\n",{"type":23,"tag":24,"props":16618,"children":16619},{},[16620,16622,16627,16629,16635,16637,16643,16645,16651,16653,16659],{"type":28,"value":16621},"这些步骤都写进了仓库里的 ",{"type":23,"tag":99,"props":16623,"children":16625},{"className":16624},[],[16626],{"type":28,"value":9001},{"type":28,"value":16628},"：先构建，再把 NAS 上的 ",{"type":23,"tag":99,"props":16630,"children":16632},{"className":16631},[],[16633],{"type":28,"value":16634},"dist",{"type":28,"value":16636}," 复制一份 ",{"type":23,"tag":99,"props":16638,"children":16640},{"className":16639},[],[16641],{"type":28,"value":16642},"dist.bak.时间戳",{"type":28,"value":16644},"（只留最近 5 份，出问题能直接换回去），然后 tar 同步、",{"type":23,"tag":99,"props":16646,"children":16648},{"className":16647},[],[16649],{"type":28,"value":16650},"docker exec personal-site nginx -s reload",{"type":28,"value":16652},"，最后 curl 一下公网地址。平时发布就是一条 ",{"type":23,"tag":99,"props":16654,"children":16656},{"className":16655},[],[16657],{"type":28,"value":16658},"bash deploy.sh prod up",{"type":28,"value":287},{"type":23,"tag":50,"props":16661,"children":16663},{"id":16662},"接下来想写的",[16664],{"type":28,"value":16662},{"type":23,"tag":24,"props":16666,"children":16667},{},[16668],{"type":28,"value":16669},"慢慢补：",{"type":23,"tag":399,"props":16671,"children":16672},{},[16673,16678,16683,16688],{"type":23,"tag":403,"props":16674,"children":16675},{},[16676],{"type":28,"value":16677},"大数据平台从 0 到 1 的设计踩坑",{"type":23,"tag":403,"props":16679,"children":16680},{},[16681],{"type":28,"value":16682},"本地 122B 大模型双机 TP 部署的整个排错过程",{"type":23,"tag":403,"props":16684,"children":16685},{},[16686],{"type":28,"value":16687},"DolphinScheduler 与自研调度引擎的取舍",{"type":23,"tag":403,"props":16689,"children":16690},{},[16691],{"type":28,"value":16692},"Cloudflare Tunnel 在家用 NAS 上的实战配置",{"type":23,"tag":24,"props":16694,"children":16695},{},[16696],{"type":28,"value":16697},"不定时更新，写一篇是一篇。",{"type":23,"tag":2730,"props":16699,"children":16700},{},[16701],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":16703},[16704,16705,16706,16707],{"id":16045,"depth":927,"text":16048},{"id":16342,"depth":927,"text":16342},{"id":16428,"depth":927,"text":16428},{"id":16662,"depth":927,"text":16662},"content:blog:2026-05-18-hello-world.md","blog\u002F2026-05-18-hello-world.md","blog\u002F2026-05-18-hello-world",{"_path":16712,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":16713,"description":16714,"date":16715,"tags":16716,"cover":16720,"source":16721,"body":16722,"_type":937,"_id":17683,"_source":939,"_file":17684,"_stem":17685,"_extension":942},"\u002Fblog\u002F2024-05-08-data-modeling-api","数据建模 API 功能说明","基于 Swagger 的建模工具 API 使用指南——标准字段生成、模型 DDL\u002FDML、词根管理、自定义数据元的接口位置与调用示例。","2024-05-08",[16717,16718,16719,11933],"简书","历史归档","数据建模","https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b0d22fa0de4f58d5.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Fc3695a0847e4",{"type":20,"children":16723,"toc":17618},[16724,16729,16734,16739,16772,16777,16795,16800,16805,16810,16816,16821,16826,16831,16838,16856,16863,16871,16878,16884,16889,16894,16899,16904,16909,16916,16928,16934,16939,16946,16951,16958,16963,16970,16975,16982,17001,17006,17011,17016,17021,17028,17036,17049,17062,17067,17073,17078,17085,17090,17095,17100,17107,17125,17135,17141,17146,17151,17156,17172,17177,17183,17188,17193,17198,17203,17221,17231,17237,17242,17247,17252,17293,17299,17304,17309,17314,17343,17349,17354,17359,17364,17369,17374,17379,17384,17443,17448,17454,17459,17464,17469,17485,17491,17496,17501,17506,17523,17529,17534,17539,17544,17570,17576,17581,17586,17591,17614],{"type":23,"tag":50,"props":16725,"children":16727},{"id":16726},"优劣势分析",[16728],{"type":28,"value":16726},{"type":23,"tag":24,"props":16730,"children":16731},{},[16732],{"type":28,"value":16733},"链接：原演示服务（Swagger 文档）已下线，本文保留接口说明作为记录。\n使用建模工具API\n能够帮助我们做什么？",{"type":23,"tag":50,"props":16735,"children":16737},{"id":16736},"优势",[16738],{"type":28,"value":16736},{"type":23,"tag":399,"props":16740,"children":16741},{},[16742,16747,16752,16757,16762,16767],{"type":23,"tag":403,"props":16743,"children":16744},{},[16745],{"type":28,"value":16746},"统一整个数仓的字段命名",{"type":23,"tag":403,"props":16748,"children":16749},{},[16750],{"type":28,"value":16751},"沉淀行业常用字段名称&标准词根",{"type":23,"tag":403,"props":16753,"children":16754},{},[16755],{"type":28,"value":16756},"结合在线mapping文档快速生成可执行的DDL(建表)语句，帮助我们在创建模型表时提升我们的效率",{"type":23,"tag":403,"props":16758,"children":16759},{},[16760],{"type":28,"value":16761},"结合在线mapping文档快速生成可执行的DML()语句，帮助我们在使用SQL开发模型时编码规范，同样能够帮助我们在日常模型开发工作中进行效率提升(目前功能还需要完善)",{"type":23,"tag":403,"props":16763,"children":16764},{},[16765],{"type":28,"value":16766},"结合在线mapping文档快速生成DQC()可执行SQL语句，帮助我们提效(研发中)",{"type":23,"tag":403,"props":16768,"children":16769},{},[16770],{"type":28,"value":16771},"管理日常设计开发的数据模型，便于后期数据治理(研发中)",{"type":23,"tag":50,"props":16773,"children":16775},{"id":16774},"劣势",[16776],{"type":28,"value":16774},{"type":23,"tag":399,"props":16778,"children":16779},{},[16780,16785,16790],{"type":23,"tag":403,"props":16781,"children":16782},{},[16783],{"type":28,"value":16784},"分词翻译准确率达不到100%，能够达到75%左右",{"type":23,"tag":403,"props":16786,"children":16787},{},[16788],{"type":28,"value":16789},"需要沉淀大量的各行业标准词根",{"type":23,"tag":403,"props":16791,"children":16792},{},[16793],{"type":28,"value":16794},"DML自动生成不能覆盖100%场景的SQL和引擎",{"type":23,"tag":50,"props":16796,"children":16798},{"id":16797},"标准字段相关接口",[16799],{"type":28,"value":16797},{"type":23,"tag":76,"props":16801,"children":16803},{"id":16802},"标准字段生成",[16804],{"type":28,"value":16802},{"type":23,"tag":24,"props":16806,"children":16807},{},[16808],{"type":28,"value":16809},"输入 标准化字段中文注释，服务端返回标准字段英文字段名称，该接口支持批量生成。",{"type":23,"tag":16811,"props":16812,"children":16814},"h4",{"id":16813},"接口位置",[16815],{"type":28,"value":16813},{"type":23,"tag":24,"props":16817,"children":16818},{},[16819],{"type":28,"value":16820},"标准字段相关接口 ----> 标准字段生成",{"type":23,"tag":16811,"props":16822,"children":16824},{"id":16823},"调用示例",[16825],{"type":28,"value":16823},{"type":23,"tag":24,"props":16827,"children":16828},{},[16829],{"type":28,"value":16830},"假设你拿到一张表的数据字典，应该先对这张表的字段中文注释进行标准化以至于翻译出来的结果更加的准确，比如，我现在有一张表的数据字典，如下：",{"type":23,"tag":24,"props":16832,"children":16833},{},[16834],{"type":23,"tag":65,"props":16835,"children":16837},{"alt":8,"src":16836},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b0d22fa0de4f58d5.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":16839,"children":16840},{},[16841,16846,16851],{"type":23,"tag":403,"props":16842,"children":16843},{},[16844],{"type":28,"value":16845},"第一步先将源表的字段中文注释进行标准化，如上图左侧",{"type":23,"tag":403,"props":16847,"children":16848},{},[16849],{"type":28,"value":16850},"批量复制标准化后的字段中文注释",{"type":23,"tag":403,"props":16852,"children":16853},{},[16854],{"type":28,"value":16855},"找到 \"标准字段相关接口 ----> 标准字段生成\" 接口进行调试，然后将复制的需要生成的字段中文注释粘贴到 text 对应的参数值 input框中，然后发送请求到服务端，稍等片刻等待服务端返回结果",{"type":23,"tag":24,"props":16857,"children":16858},{},[16859],{"type":23,"tag":65,"props":16860,"children":16862},{"alt":8,"src":16861},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-90e15a0484143e8d.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":16864,"children":16865},{"start":2190},[16866],{"type":23,"tag":403,"props":16867,"children":16868},{},[16869],{"type":28,"value":16870},"将相应内容中的数据复制到 excel 通过预先写好的公式进行字符串按照 \"|\" 切割，取第三列值即可",{"type":23,"tag":24,"props":16872,"children":16873},{},[16874],{"type":23,"tag":65,"props":16875,"children":16877},{"alt":8,"src":16876},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-6447ef33bf2c8669.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":76,"props":16879,"children":16881},{"id":16880},"标准字段生成包含分词",[16882],{"type":28,"value":16883},"标准字段生成(包含分词)",{"type":23,"tag":24,"props":16885,"children":16886},{},[16887],{"type":28,"value":16888},"输入 标准化字段中文注释，服务端返回分词结果以及每个词根对应的英文名称&顺序拼接后的字段英文名称，该接口支持批量生成。",{"type":23,"tag":16811,"props":16890,"children":16892},{"id":16891},"接口位置-1",[16893],{"type":28,"value":16813},{"type":23,"tag":24,"props":16895,"children":16896},{},[16897],{"type":28,"value":16898},"标准字段相关接口 ----> 标准字段生成(包含分词)",{"type":23,"tag":16811,"props":16900,"children":16902},{"id":16901},"调用示例-1",[16903],{"type":28,"value":16823},{"type":23,"tag":24,"props":16905,"children":16906},{},[16907],{"type":28,"value":16908},"假设我们现在需要对 \"是否评审\" 这个字段生成标准的英文名称，那么我们只需要调用如下接口即可：",{"type":23,"tag":24,"props":16910,"children":16911},{},[16912],{"type":23,"tag":65,"props":16913,"children":16915},{"alt":8,"src":16914},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-3638fb2e2b269767.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":16917,"children":16918},{},[16919,16921,16926],{"type":28,"value":16920},"如上图所示，\"是否评审\" 这个中文注释被分成了两个词，\"是否\" + \"评审\" ，这两个词我们将它称为 \"标准词根\"，然后会将这两个词根对应的英文名称进行顺序拼接，如需要查询标准词根请使用 ",{"type":23,"tag":86,"props":16922,"children":16923},{},[16924],{"type":28,"value":16925},"标准词根查询接口",{"type":28,"value":16927}," 。",{"type":23,"tag":16929,"props":16930,"children":16932},"h5",{"id":16931},"自定义分词演示",[16933],{"type":28,"value":16931},{"type":23,"tag":24,"props":16935,"children":16936},{},[16937],{"type":28,"value":16938},"基于上述案例，如果我们需要自定义分词方式，比如：\"是否评审\" 这个字段默认分成了 \"是否\" + \"评审\"，现在我们需要自定义让程序分成一个词 \"是否评审\" 的话，这时候我们需要结合 \"自定义数据元 ----> 用户词典插入\" 接口完成，具体操作方式如下：",{"type":23,"tag":24,"props":16940,"children":16941},{},[16942],{"type":23,"tag":65,"props":16943,"children":16945},{"alt":8,"src":16944},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-de5c6dd91c276df2.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":16947,"children":16948},{},[16949],{"type":28,"value":16950},"插入成功数据元之后，我们再调用一次 \"标准字段生成(包含分词)\" 接口，看\"是否评审\" 这个数据元是否生效，如下图：",{"type":23,"tag":24,"props":16952,"children":16953},{},[16954],{"type":23,"tag":65,"props":16955,"children":16957},{"alt":8,"src":16956},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-8bb786543fba6f11.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":16959,"children":16960},{},[16961],{"type":28,"value":16962},"如上图我们发现已经生效了，这时候分成了一个词，但是英文字段名称不一致，之前两个词时结果是 \"is_review\"，而分成一个词时结果是 \"whthr_rvw\" 是因为 \"是否评审\" 这个词根的英文名称是按照程序默认规则生成的，不是那么的准确，所以我们需要对这个词根进行评审，评审过后对该词根进行修改，这时候需要调用 \"标准词根相关接口 ----> 修改词根\" 接口对 \"是否评审\" 词根进行修改，修改步骤如下：",{"type":23,"tag":24,"props":16964,"children":16965},{},[16966],{"type":23,"tag":65,"props":16967,"children":16969},{"alt":8,"src":16968},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b0156f553e9836e8.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":16971,"children":16972},{},[16973],{"type":28,"value":16974},"修改完成之后，我们再调用一次 \"标准字段生成(包含分词)\" 接口，结果如下：",{"type":23,"tag":24,"props":16976,"children":16977},{},[16978],{"type":23,"tag":65,"props":16979,"children":16981},{"alt":8,"src":16980},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b39b20b18ed13b86.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":16983,"children":16984},{},[16985,16987,16992,16994,16999],{"type":28,"value":16986},"如上图所示就成功了，这样我们就完成了一次 ",{"type":23,"tag":86,"props":16988,"children":16989},{},[16990],{"type":28,"value":16991},"自定义分词",{"type":28,"value":16993}," 以及 ",{"type":23,"tag":86,"props":16995,"children":16996},{},[16997],{"type":28,"value":16998},"词根评审",{"type":28,"value":17000}," 流程。",{"type":23,"tag":76,"props":17002,"children":17004},{"id":17003},"修改标准字段",[17005],{"type":28,"value":17003},{"type":23,"tag":16811,"props":17007,"children":17009},{"id":17008},"接口位置-2",[17010],{"type":28,"value":16813},{"type":23,"tag":24,"props":17012,"children":17013},{},[17014],{"type":28,"value":17015},"标准字段相关接口 ----> 修改标准字段",{"type":23,"tag":16811,"props":17017,"children":17019},{"id":17018},"调用示例-2",[17020],{"type":28,"value":16823},{"type":23,"tag":24,"props":17022,"children":17023},{},[17024],{"type":23,"tag":65,"props":17025,"children":17027},{"alt":8,"src":17026},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-16c376f9e5d1f77b.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":17029,"children":17030},{},[17031],{"type":23,"tag":403,"props":17032,"children":17033},{},[17034],{"type":28,"value":17035},"按照要求填写接口入参",{"type":23,"tag":399,"props":17037,"children":17038},{},[17039,17044],{"type":23,"tag":403,"props":17040,"children":17041},{},[17042],{"type":28,"value":17043},"chnsName：标准字段中文注释",{"type":23,"tag":403,"props":17045,"children":17046},{},[17047],{"type":28,"value":17048},"engName：标准字段英文名称(评审过后)",{"type":23,"tag":890,"props":17050,"children":17051},{"start":927},[17052,17057],{"type":23,"tag":403,"props":17053,"children":17054},{},[17055],{"type":28,"value":17056},"发送请求至服务端",{"type":23,"tag":403,"props":17058,"children":17059},{},[17060],{"type":28,"value":17061},"等待服务端返回结果，200代表更新成功，再次调用 \"标准字段生成\" 接口就是更新过后的英文名称了。",{"type":23,"tag":50,"props":17063,"children":17065},{"id":17064},"模型表相关接口",[17066],{"type":28,"value":17064},{"type":23,"tag":76,"props":17068,"children":17070},{"id":17069},"模型ddl",[17071],{"type":28,"value":17072},"模型DDL",{"type":23,"tag":24,"props":17074,"children":17075},{},[17076],{"type":28,"value":17077},"该接口需要结合飞书在线文档，输入文档URL链接和文档sheet页名称，指定表引擎(目前支持gp、pg、hive引擎)",{"type":23,"tag":24,"props":17079,"children":17080},{},[17081],{"type":23,"tag":65,"props":17082,"children":17084},{"alt":8,"src":17083},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-e8749cfedff573da.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":16811,"props":17086,"children":17088},{"id":17087},"接口位置-3",[17089],{"type":28,"value":16813},{"type":23,"tag":24,"props":17091,"children":17092},{},[17093],{"type":28,"value":17094},"模型表相关接口 ----> 模型DDL",{"type":23,"tag":16811,"props":17096,"children":17098},{"id":17097},"调用示例-3",[17099],{"type":28,"value":16823},{"type":23,"tag":24,"props":17101,"children":17102},{},[17103],{"type":23,"tag":65,"props":17104,"children":17106},{"alt":8,"src":17105},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-29863390643336e6.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":17108,"children":17109},{},[17110,17115,17120],{"type":23,"tag":403,"props":17111,"children":17112},{},[17113],{"type":28,"value":17114},"填写飞书在线excel文档的URL链接，以及模型表对应的sheet页名称，并且指定表引擎",{"type":23,"tag":403,"props":17116,"children":17117},{},[17118],{"type":28,"value":17119},"发送请求到服务端，这里注意有时候会因为飞书接口导致超时的错误，重新发送请求即可",{"type":23,"tag":403,"props":17121,"children":17122},{},[17123],{"type":28,"value":17124},"等待片刻即可返回DDL语句",{"type":23,"tag":24,"props":17126,"children":17127},{},[17128,17133],{"type":23,"tag":86,"props":17129,"children":17130},{},[17131],{"type":28,"value":17132},"注意：",{"type":28,"value":17134}," 这里的飞书excel都是标准化过的，必须按照模版格式才能正确生成DDL",{"type":23,"tag":76,"props":17136,"children":17138},{"id":17137},"模型dml仅支持hive引擎",[17139],{"type":28,"value":17140},"模型DML(仅支持Hive引擎)",{"type":23,"tag":16811,"props":17142,"children":17144},{"id":17143},"接口位置-4",[17145],{"type":28,"value":16813},{"type":23,"tag":24,"props":17147,"children":17148},{},[17149],{"type":28,"value":17150},"模型表相关接口 ----> 模型DML",{"type":23,"tag":16811,"props":17152,"children":17154},{"id":17153},"调用示例-4",[17155],{"type":28,"value":16823},{"type":23,"tag":890,"props":17157,"children":17158},{},[17159,17163,17167],{"type":23,"tag":403,"props":17160,"children":17161},{},[17162],{"type":28,"value":17114},{"type":23,"tag":403,"props":17164,"children":17165},{},[17166],{"type":28,"value":17119},{"type":23,"tag":403,"props":17168,"children":17169},{},[17170],{"type":28,"value":17171},"等待片刻即可返回DML语句，全选复制至数开平台执行即可",{"type":23,"tag":50,"props":17173,"children":17175},{"id":17174},"标准词根相关接口",[17176],{"type":28,"value":17174},{"type":23,"tag":76,"props":17178,"children":17180},{"id":17179},"标准词根查询经常使用",[17181],{"type":28,"value":17182},"标准词根查询(经常使用)",{"type":23,"tag":24,"props":17184,"children":17185},{},[17186],{"type":28,"value":17187},"支持批量查询，多个词根之间使用 \"空格符号\" 进行分割。",{"type":23,"tag":16811,"props":17189,"children":17191},{"id":17190},"接口位置-5",[17192],{"type":28,"value":16813},{"type":23,"tag":24,"props":17194,"children":17195},{},[17196],{"type":28,"value":17197},"标准词根相关接口 ----> 查询词根",{"type":23,"tag":16811,"props":17199,"children":17201},{"id":17200},"调用示例-5",[17202],{"type":28,"value":16823},{"type":23,"tag":890,"props":17204,"children":17205},{},[17206,17211,17216],{"type":23,"tag":403,"props":17207,"children":17208},{},[17209],{"type":28,"value":17210},"在调式参数rootName对应的参数值输入框输入你想要生成的标准字段中文注释，如果需要生成多个标准字段可以使用空格符进行隔开即可，举例：\"是否 评审\"",{"type":23,"tag":403,"props":17212,"children":17213},{},[17214],{"type":28,"value":17215},"点击发送请求按钮",{"type":23,"tag":403,"props":17217,"children":17218},{},[17219],{"type":28,"value":17220},"等待服务端返回结果即可，如遇到报错请跟作者进行反馈",{"type":23,"tag":24,"props":17222,"children":17223},{},[17224,17226],{"type":28,"value":17225},"如上图所示，接口返回结果的格式是 ",{"type":23,"tag":86,"props":17227,"children":17228},{},[17229],{"type":28,"value":17230},"词根中文名称,词根翻译参考(多个参考|分隔),词频,词根英文名称",{"type":23,"tag":76,"props":17232,"children":17234},{"id":17233},"标准词根更新偶尔使用",[17235],{"type":28,"value":17236},"标准词根更新(偶尔使用)",{"type":23,"tag":16811,"props":17238,"children":17240},{"id":17239},"接口位置-6",[17241],{"type":28,"value":16813},{"type":23,"tag":24,"props":17243,"children":17244},{},[17245],{"type":28,"value":17246},"标准词根相关接口 ----> 修改词根",{"type":23,"tag":16811,"props":17248,"children":17250},{"id":17249},"调用示例-6",[17251],{"type":28,"value":16823},{"type":23,"tag":890,"props":17253,"children":17254},{},[17255,17283,17288],{"type":23,"tag":403,"props":17256,"children":17257},{},[17258,17260],{"type":28,"value":17259},"按照要求填写接口入参\n",{"type":23,"tag":399,"props":17261,"children":17262},{},[17263,17268,17273,17278],{"type":23,"tag":403,"props":17264,"children":17265},{},[17266],{"type":28,"value":17267},"bsinssPlate：词根所属业务板块",{"type":23,"tag":403,"props":17269,"children":17270},{},[17271],{"type":28,"value":17272},"rootChnsNm：词根中文名称",{"type":23,"tag":403,"props":17274,"children":17275},{},[17276],{"type":28,"value":17277},"rootNm：词根英文名称",{"type":23,"tag":403,"props":17279,"children":17280},{},[17281],{"type":28,"value":17282},"translt：词根翻译参考",{"type":23,"tag":403,"props":17284,"children":17285},{},[17286],{"type":28,"value":17287},"发送请求到服务端",{"type":23,"tag":403,"props":17289,"children":17290},{},[17291],{"type":28,"value":17292},"等待服务端响应，200表示更新成功",{"type":23,"tag":76,"props":17294,"children":17296},{"id":17295},"词根分页查询基本不用",[17297],{"type":28,"value":17298},"词根分页查询(基本不用)",{"type":23,"tag":16811,"props":17300,"children":17302},{"id":17301},"接口位置-7",[17303],{"type":28,"value":16813},{"type":23,"tag":24,"props":17305,"children":17306},{},[17307],{"type":28,"value":17308},"标准词根相关接口 ----> 词根分页查询",{"type":23,"tag":16811,"props":17310,"children":17312},{"id":17311},"调用示例-7",[17313],{"type":28,"value":16823},{"type":23,"tag":890,"props":17315,"children":17316},{},[17317,17334,17338],{"type":23,"tag":403,"props":17318,"children":17319},{},[17320,17321],{"type":28,"value":17259},{"type":23,"tag":399,"props":17322,"children":17323},{},[17324,17329],{"type":23,"tag":403,"props":17325,"children":17326},{},[17327],{"type":28,"value":17328},"page：第几页",{"type":23,"tag":403,"props":17330,"children":17331},{},[17332],{"type":28,"value":17333},"pageSize：每一页多少条数据",{"type":23,"tag":403,"props":17335,"children":17336},{},[17337],{"type":28,"value":17287},{"type":23,"tag":403,"props":17339,"children":17340},{},[17341],{"type":28,"value":17342},"等待服务端返回结果",{"type":23,"tag":76,"props":17344,"children":17346},{"id":17345},"词根批量更新新增偶尔使用",[17347],{"type":28,"value":17348},"词根批量更新&新增(偶尔使用)",{"type":23,"tag":24,"props":17350,"children":17351},{},[17352],{"type":28,"value":17353},"数据格式：词根中文名称,评审后的词根英文名称\n数据文件格式：CSV",{"type":23,"tag":16811,"props":17355,"children":17357},{"id":17356},"接口位置-8",[17358],{"type":28,"value":16813},{"type":23,"tag":24,"props":17360,"children":17361},{},[17362],{"type":28,"value":17363},"标准词根相关接口 ----> 词根批量更新&新增",{"type":23,"tag":16811,"props":17365,"children":17367},{"id":17366},"调用示例-8",[17368],{"type":28,"value":16823},{"type":23,"tag":24,"props":17370,"children":17371},{},[17372],{"type":28,"value":17373},"需要使用PostMan或者curl方式调用",{"type":23,"tag":16929,"props":17375,"children":17377},{"id":17376},"curl方式",[17378],{"type":28,"value":17376},{"type":23,"tag":24,"props":17380,"children":17381},{},[17382],{"type":28,"value":17383},"命令如下：",{"type":23,"tag":2152,"props":17385,"children":17387},{"className":5795,"code":17386,"language":5797,"meta":8,"style":8},"curl --location 'http:\u002F\u002F\u003Chost>\u002Froot\u002FbatchUpdate' \\\n--header 'Cookie: JSESSIONID=\u003Csession-id>' \\\n--form 'csvFile=@\".\u002F词根批量上传测试.csv\"'\n",[17388],{"type":23,"tag":99,"props":17389,"children":17390},{"__ignoreMap":8},[17391,17413,17430],{"type":23,"tag":2161,"props":17392,"children":17393},{"class":2163,"line":2164},[17394,17399,17404,17409],{"type":23,"tag":2161,"props":17395,"children":17396},{"style":5824},[17397],{"type":28,"value":17398},"curl",{"type":23,"tag":2161,"props":17400,"children":17401},{"style":5844},[17402],{"type":28,"value":17403}," --location",{"type":23,"tag":2161,"props":17405,"children":17406},{"style":5855},[17407],{"type":28,"value":17408}," 'http:\u002F\u002F\u003Chost>\u002Froot\u002FbatchUpdate'",{"type":23,"tag":2161,"props":17410,"children":17411},{"style":5844},[17412],{"type":28,"value":5876},{"type":23,"tag":2161,"props":17414,"children":17415},{"class":2163,"line":927},[17416,17421,17426],{"type":23,"tag":2161,"props":17417,"children":17418},{"style":5830},[17419],{"type":28,"value":17420},"--header ",{"type":23,"tag":2161,"props":17422,"children":17423},{"style":5855},[17424],{"type":28,"value":17425},"'Cookie: JSESSIONID=\u003Csession-id>'",{"type":23,"tag":2161,"props":17427,"children":17428},{"style":5844},[17429],{"type":28,"value":5876},{"type":23,"tag":2161,"props":17431,"children":17432},{"class":2163,"line":924},[17433,17438],{"type":23,"tag":2161,"props":17434,"children":17435},{"style":5830},[17436],{"type":28,"value":17437},"--form ",{"type":23,"tag":2161,"props":17439,"children":17440},{"style":5855},[17441],{"type":28,"value":17442},"'csvFile=@\".\u002F词根批量上传测试.csv\"'\n",{"type":23,"tag":50,"props":17444,"children":17446},{"id":17445},"自定义数据元相关接口",[17447],{"type":28,"value":17445},{"type":23,"tag":76,"props":17449,"children":17451},{"id":17450},"用户词典插入偶尔使用",[17452],{"type":28,"value":17453},"用户词典插入(偶尔使用)",{"type":23,"tag":16811,"props":17455,"children":17457},{"id":17456},"接口位置-9",[17458],{"type":28,"value":16813},{"type":23,"tag":24,"props":17460,"children":17461},{},[17462],{"type":28,"value":17463},"自定义数据元相关接口 ----> 用户词典插入",{"type":23,"tag":16811,"props":17465,"children":17467},{"id":17466},"调用示例-9",[17468],{"type":28,"value":16823},{"type":23,"tag":890,"props":17470,"children":17471},{},[17472,17476,17480],{"type":23,"tag":403,"props":17473,"children":17474},{},[17475],{"type":28,"value":17035},{"type":23,"tag":403,"props":17477,"children":17478},{},[17479],{"type":28,"value":17287},{"type":23,"tag":403,"props":17481,"children":17482},{},[17483],{"type":28,"value":17484},"等待服务端响应，msg = \"OK\" 说明插入成功了",{"type":23,"tag":76,"props":17486,"children":17488},{"id":17487},"用户词典更新偶尔使用",[17489],{"type":28,"value":17490},"用户词典更新(偶尔使用)",{"type":23,"tag":16811,"props":17492,"children":17494},{"id":17493},"接口位置-10",[17495],{"type":28,"value":16813},{"type":23,"tag":24,"props":17497,"children":17498},{},[17499],{"type":28,"value":17500},"自定义数据元相关接口 ----> 用户词典更新",{"type":23,"tag":16811,"props":17502,"children":17504},{"id":17503},"调用示例-10",[17505],{"type":28,"value":16823},{"type":23,"tag":890,"props":17507,"children":17508},{},[17509,17514,17518],{"type":23,"tag":403,"props":17510,"children":17511},{},[17512],{"type":28,"value":17513},"按照要求填写入参",{"type":23,"tag":403,"props":17515,"children":17516},{},[17517],{"type":28,"value":17287},{"type":23,"tag":403,"props":17519,"children":17520},{},[17521],{"type":28,"value":17522},"等待服务端返回结果，状态 200 说明更新成功了",{"type":23,"tag":76,"props":17524,"children":17526},{"id":17525},"用户词典分页查询基本不使用",[17527],{"type":28,"value":17528},"用户词典分页查询(基本不使用)",{"type":23,"tag":16811,"props":17530,"children":17532},{"id":17531},"接口位置-11",[17533],{"type":28,"value":16813},{"type":23,"tag":24,"props":17535,"children":17536},{},[17537],{"type":28,"value":17538},"自定义数据元相关接口 ----> 用户词典分页查询",{"type":23,"tag":16811,"props":17540,"children":17542},{"id":17541},"调用示例-11",[17543],{"type":28,"value":16823},{"type":23,"tag":890,"props":17545,"children":17546},{},[17547,17562,17566],{"type":23,"tag":403,"props":17548,"children":17549},{},[17550,17551],{"type":28,"value":17259},{"type":23,"tag":399,"props":17552,"children":17553},{},[17554,17558],{"type":23,"tag":403,"props":17555,"children":17556},{},[17557],{"type":28,"value":17328},{"type":23,"tag":403,"props":17559,"children":17560},{},[17561],{"type":28,"value":17333},{"type":23,"tag":403,"props":17563,"children":17564},{},[17565],{"type":28,"value":17287},{"type":23,"tag":403,"props":17567,"children":17568},{},[17569],{"type":28,"value":17342},{"type":23,"tag":76,"props":17571,"children":17573},{"id":17572},"单条用户词典查询偶尔使用",[17574],{"type":28,"value":17575},"单条用户词典查询(偶尔使用)",{"type":23,"tag":16811,"props":17577,"children":17579},{"id":17578},"接口位置-12",[17580],{"type":28,"value":16813},{"type":23,"tag":24,"props":17582,"children":17583},{},[17584],{"type":28,"value":17585},"自定义数据元相关接口 ----> 单条用户词典查询",{"type":23,"tag":16811,"props":17587,"children":17589},{"id":17588},"调用示例-12",[17590],{"type":28,"value":16823},{"type":23,"tag":890,"props":17592,"children":17593},{},[17594,17606,17610],{"type":23,"tag":403,"props":17595,"children":17596},{},[17597,17598],{"type":28,"value":17259},{"type":23,"tag":399,"props":17599,"children":17600},{},[17601],{"type":23,"tag":403,"props":17602,"children":17603},{},[17604],{"type":28,"value":17605},"cstmDataElmnt：自定义数据元",{"type":23,"tag":403,"props":17607,"children":17608},{},[17609],{"type":28,"value":17287},{"type":23,"tag":403,"props":17611,"children":17612},{},[17613],{"type":28,"value":17342},{"type":23,"tag":2730,"props":17615,"children":17616},{},[17617],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":17619},[17620,17621,17622,17623,17637,17647,17665],{"id":16726,"depth":927,"text":16726},{"id":16736,"depth":927,"text":16736},{"id":16774,"depth":927,"text":16774},{"id":16797,"depth":927,"text":16797,"children":17624},[17625,17629,17633],{"id":16802,"depth":924,"text":16802,"children":17626},[17627,17628],{"id":16813,"depth":2190,"text":16813},{"id":16823,"depth":2190,"text":16823},{"id":16880,"depth":924,"text":16883,"children":17630},[17631,17632],{"id":16891,"depth":2190,"text":16813},{"id":16901,"depth":2190,"text":16823},{"id":17003,"depth":924,"text":17003,"children":17634},[17635,17636],{"id":17008,"depth":2190,"text":16813},{"id":17018,"depth":2190,"text":16823},{"id":17064,"depth":927,"text":17064,"children":17638},[17639,17643],{"id":17069,"depth":924,"text":17072,"children":17640},[17641,17642],{"id":17087,"depth":2190,"text":16813},{"id":17097,"depth":2190,"text":16823},{"id":17137,"depth":924,"text":17140,"children":17644},[17645,17646],{"id":17143,"depth":2190,"text":16813},{"id":17153,"depth":2190,"text":16823},{"id":17174,"depth":927,"text":17174,"children":17648},[17649,17653,17657,17661],{"id":17179,"depth":924,"text":17182,"children":17650},[17651,17652],{"id":17190,"depth":2190,"text":16813},{"id":17200,"depth":2190,"text":16823},{"id":17233,"depth":924,"text":17236,"children":17654},[17655,17656],{"id":17239,"depth":2190,"text":16813},{"id":17249,"depth":2190,"text":16823},{"id":17295,"depth":924,"text":17298,"children":17658},[17659,17660],{"id":17301,"depth":2190,"text":16813},{"id":17311,"depth":2190,"text":16823},{"id":17345,"depth":924,"text":17348,"children":17662},[17663,17664],{"id":17356,"depth":2190,"text":16813},{"id":17366,"depth":2190,"text":16823},{"id":17445,"depth":927,"text":17445,"children":17666},[17667,17671,17675,17679],{"id":17450,"depth":924,"text":17453,"children":17668},[17669,17670],{"id":17456,"depth":2190,"text":16813},{"id":17466,"depth":2190,"text":16823},{"id":17487,"depth":924,"text":17490,"children":17672},[17673,17674],{"id":17493,"depth":2190,"text":16813},{"id":17503,"depth":2190,"text":16823},{"id":17525,"depth":924,"text":17528,"children":17676},[17677,17678],{"id":17531,"depth":2190,"text":16813},{"id":17541,"depth":2190,"text":16823},{"id":17572,"depth":924,"text":17575,"children":17680},[17681,17682],{"id":17578,"depth":2190,"text":16813},{"id":17588,"depth":2190,"text":16823},"content:blog:2024-05-08-data-modeling-api.md","blog\u002F2024-05-08-data-modeling-api.md","blog\u002F2024-05-08-data-modeling-api",{"_path":17687,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":17688,"description":17689,"date":17690,"tags":17691,"cover":17692,"source":17693,"body":17694,"_type":937,"_id":17893,"_source":939,"_file":17894,"_stem":17895,"_extension":942},"\u002Fblog\u002F2022-09-26-flink-memory-settings","Flink内存设置思考","通过分析 Flink TaskManager 内存模型，深入讲解 Task Heap 和 Managed 内存的设置思路，帮助开发者根据任务特点合理配置内存。","2022-09-26",[16717,16718,597,15],"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-68a9f02d426eac38.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002F7c89e7c48836",{"type":20,"children":17695,"toc":17888},[17696,17701,17707,17771,17776,17802,17823,17852,17868,17873,17878,17883],{"type":23,"tag":24,"props":17697,"children":17698},{},[17699],{"type":28,"value":17700},"通过上一章节我们可以得到，flink把container内存分成了8块，一般来说我们只需要关注其中的两块内存(task heap和managed)，由内存计算公式可以看出，这两部分是此消彼长的。",{"type":23,"tag":50,"props":17702,"children":17704},{"id":17703},"task-heap",[17705],{"type":28,"value":17706},"Task heap",{"type":23,"tag":399,"props":17708,"children":17709},{},[17710,17715],{"type":23,"tag":403,"props":17711,"children":17712},{},[17713],{"type":28,"value":17714},"默认4g的一个TM，其中大概只有35%分配给了heap内存，一般来说对于简单的任务足够了，我们通过GC的情况来观测heap内存是否充足",{"type":23,"tag":403,"props":17716,"children":17717},{},[17718,17720],{"type":28,"value":17719},"如果我们SQL任务的计算逻辑比较复杂，比如有较多算子情况下，或者有一些维表关联需要缓存数据，那我们就需要增大heap内存的分配。\n",{"type":23,"tag":890,"props":17721,"children":17722},{},[17723,17752],{"type":23,"tag":403,"props":17724,"children":17725},{},[17726,17728,17734,17736,17742,17744,17750],{"type":28,"value":17727},"如果任务没有 ",{"type":23,"tag":99,"props":17729,"children":17731},{"className":17730},[],[17732],{"type":28,"value":17733},"join",{"type":28,"value":17735}," ，没有 ",{"type":23,"tag":99,"props":17737,"children":17739},{"className":17738},[],[17740],{"type":28,"value":17741},"group by",{"type":28,"value":17743}," 等聚合算子，我们可以调小 ",{"type":23,"tag":99,"props":17745,"children":17747},{"className":17746},[],[17748],{"type":28,"value":17749},"managed",{"type":28,"value":17751}," 内存分配的比例，以此来增大heap内存的分配量(taskmanager.memory.freaction=0.4 默认)，如果内存还是不足可以通过增加TM的总内存",{"type":23,"tag":403,"props":17753,"children":17754},{},[17755,17757,17762,17764,17769],{"type":28,"value":17756},"如果任务需要聚合算子，调小 ",{"type":23,"tag":99,"props":17758,"children":17760},{"className":17759},[],[17761],{"type":28,"value":17749},{"type":28,"value":17763}," 内存可以导致 ",{"type":23,"tag":99,"props":17765,"children":17767},{"className":17766},[],[17768],{"type":28,"value":17749},{"type":28,"value":17770}," 内存的OOM，应该直接增加TM总内存",{"type":23,"tag":50,"props":17772,"children":17773},{"id":17749},[17774],{"type":28,"value":17775},"Managed",{"type":23,"tag":24,"props":17777,"children":17778},{},[17779,17781,17786,17788,17793,17795,17800],{"type":28,"value":17780},"Flink是有状态的计算，对于我们目前线上的使用方式，所谓的状态使用全都依赖于 ",{"type":23,"tag":99,"props":17782,"children":17784},{"className":17783},[],[17785],{"type":28,"value":17775},{"type":28,"value":17787}," 内存，用来保存我们的一些数据和结果(例如双流 ",{"type":23,"tag":99,"props":17789,"children":17791},{"className":17790},[],[17792],{"type":28,"value":17733},{"type":28,"value":17794}," 时两张表的缓存数据， ",{"type":23,"tag":99,"props":17796,"children":17798},{"className":17797},[],[17799],{"type":28,"value":17741},{"type":28,"value":17801}," 时使用的缓存中间结果值等)",{"type":23,"tag":24,"props":17803,"children":17804},{},[17805,17807,17813,17815,17821],{"type":28,"value":17806},"对于有时间窗口的任务来说，状态数据会随着窗口的销毁而清楚，释放空间，但是对于没有时间窗口的任务，我们使用TTL来进行任务状态的清除(在sql中使用 ",{"type":23,"tag":99,"props":17808,"children":17810},{"className":17809},[],[17811],{"type":28,"value":17812},"set",{"type":28,"value":17814}," table.exec.state.ttl ",{"type":23,"tag":99,"props":17816,"children":17818},{"className":17817},[],[17819],{"type":28,"value":17820},"= ${time}ms)",{"type":28,"value":17822}," 。ttl不应设置的过大，且ttl只保证数据在设置的时间内不会被删除，但是何时执行删除动作是不确定的",{"type":23,"tag":24,"props":17824,"children":17825},{},[17826,17828,17834,17836,17842,17844,17850],{"type":28,"value":17827},"由于Managed内存是堆外内存，flink任务本身无法很准确的进行观测和控制，容易造成堆外内存的使用超限。对于目前线上的运行模式(flink on yarn)，yarn会对container进程的资源消耗进行监控，如果总内存使用量超过申请上线，则会kill container。如果我们遇到，flink任务运行一段时间，出现 ",{"type":23,"tag":99,"props":17829,"children":17831},{"className":17830},[],[17832],{"type":28,"value":17833},"failover",{"type":28,"value":17835}," ，查看运行信息，报错信息类似于 ",{"type":23,"tag":99,"props":17837,"children":17839},{"className":17838},[],[17840],{"type":28,"value":17841},"\" Connection unexpectedly closed by remote task manager 'xxx.com\u002Fxxx:'. This might indicate that the remote task manager was lost.\"",{"type":28,"value":17843}," 一个Taskmanager丢失，很大概率是由于这个container的managed内存用量超限被yarn kill导致，则我们应该增大内存。通常我们使用直接增大总内存的方式来增加managed内存分配，当然在heap内存充足的情况下，也可以适当调大managed比例(",{"type":23,"tag":99,"props":17845,"children":17847},{"className":17846},[],[17848],{"type":28,"value":17849},"taskmanager.memory.managed.fraction=0.4",{"type":28,"value":17851},")的值",{"type":23,"tag":399,"props":17853,"children":17854},{},[17855],{"type":23,"tag":403,"props":17856,"children":17857},{},[17858,17860,17864],{"type":28,"value":17859},"TaskManager中运行多个slot和task\nslot是flink中的最小执行资源，我们目前线上的配置为1个container设置占用1个VCORE(1个container就是1个Taskmanager)，通常情况下，为了提供cpu的利用率，默认设置1个taskmanager设为2个slot。\n如果一个任务里面有多个算子需要使用状态存储,比如多次group by，存在一个tm上运行多个tsdb实例,如下图：",{"type":23,"tag":17861,"props":17862,"children":17863},"br",{},[],{"type":23,"tag":65,"props":17865,"children":17867},{"alt":8,"src":17866},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-68a9f02d426eac38.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":17869,"children":17870},{},[17871],{"type":28,"value":17872},"这个任务的配置是1个tm2个slot，并且graph中包含了3个agg算子，这表示了一个tm中会包含2*3=6个rocksdb的实例，因此此处也需要根据agg算子的类型来判定是否需要增加，常用的max，sum一般默认值足够，如果是自定义的udaf可能需要增大managed内存的分配",{"type":23,"tag":24,"props":17874,"children":17875},{},[17876],{"type":28,"value":17877},"双流的无时间窗口的join一般也需要存储大量的数据，因此也应该适当调大managed内存的分配。",{"type":23,"tag":50,"props":17879,"children":17881},{"id":17880},"总结",[17882],{"type":28,"value":17880},{"type":23,"tag":24,"props":17884,"children":17885},{},[17886],{"type":28,"value":17887},"通过以上的说明，大家应该对如何配置flink tm的内存有了一些思路。内存是任务运行的重要资源，在任务稳定运行，gc正常的情况下，过多的内存分配不会增加任务的运行效率，我们在探查任务运行效率时，磁盘的IO wait，CPU的利用率，算子的执行速度等都是需要考虑的重要因素",{"title":8,"searchDepth":924,"depth":924,"links":17889},[17890,17891,17892],{"id":17703,"depth":927,"text":17706},{"id":17749,"depth":927,"text":17775},{"id":17880,"depth":927,"text":17880},"content:blog:2022-09-26-flink-memory-settings.md","blog\u002F2022-09-26-flink-memory-settings.md","blog\u002F2022-09-26-flink-memory-settings",{"_path":17897,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":17898,"description":17899,"date":17900,"tags":17901,"cover":17902,"source":17903,"body":17904,"_type":937,"_id":18415,"_source":939,"_file":18416,"_stem":18417,"_extension":942},"\u002Fblog\u002F2022-09-25-flink-memory-model","Flink内存模型的思考","从线上 Flink 任务延时告警出发，定位问题并深入分析 Flink 内存模型，包括内存划分、各模块作用及内存计算公式。","2022-09-25",[16717,16718,597,15],"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b69c692e653feeb3.jpg","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Fab4e81986ad9",{"type":20,"children":17905,"toc":18402},[17906,17911,17918,17923,17928,17933,17975,17984,17991,17996,18003,18008,18013,18020,18025,18058,18063,18070,18083,18091,18096,18101,18127,18133,18168,18175,18180,18187,18193,18234,18239,18245,18297,18303,18326,18331,18338,18343,18350,18361,18366,18371,18375,18398],{"type":23,"tag":50,"props":17907,"children":17909},{"id":17908},"背景",[17910],{"type":28,"value":17908},{"type":23,"tag":24,"props":17912,"children":17913},{},[17914],{"type":23,"tag":65,"props":17915,"children":17917},{"alt":8,"src":17916},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b69c692e653feeb3.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F853\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":17919,"children":17920},{},[17921],{"type":28,"value":17922},"从2022-08-07晚上开始该任务触发延时告警，此处省略几十条。",{"type":23,"tag":50,"props":17924,"children":17926},{"id":17925},"定位问题",[17927],{"type":28,"value":17925},{"type":23,"tag":24,"props":17929,"children":17930},{},[17931],{"type":28,"value":17932},"该线上Flink提交参数如下，其余参数均是1.0版本的默认值",{"type":23,"tag":2152,"props":17934,"children":17936},{"className":5795,"code":17935,"language":5797,"meta":8,"style":8},"-D state.backend.incremental=true\n--taskManagerMemory=10240\n",[17937],{"type":23,"tag":99,"props":17938,"children":17939},{"__ignoreMap":8},[17940,17958],{"type":23,"tag":2161,"props":17941,"children":17942},{"class":2163,"line":2164},[17943,17948,17953],{"type":23,"tag":2161,"props":17944,"children":17945},{"style":5824},[17946],{"type":28,"value":17947},"-D",{"type":23,"tag":2161,"props":17949,"children":17950},{"style":5855},[17951],{"type":28,"value":17952}," state.backend.incremental=",{"type":23,"tag":2161,"props":17954,"children":17955},{"style":5844},[17956],{"type":28,"value":17957},"true\n",{"type":23,"tag":2161,"props":17959,"children":17960},{"class":2163,"line":927},[17961,17966,17970],{"type":23,"tag":2161,"props":17962,"children":17963},{"style":5830},[17964],{"type":28,"value":17965},"--taskManagerMemory",{"type":23,"tag":2161,"props":17967,"children":17968},{"style":5948},[17969],{"type":28,"value":6258},{"type":23,"tag":2161,"props":17971,"children":17972},{"style":5855},[17973],{"type":28,"value":17974},"10240\n",{"type":23,"tag":17976,"props":17977,"children":17978},"blockquote",{},[17979],{"type":23,"tag":24,"props":17980,"children":17981},{},[17982],{"type":28,"value":17983},"--taskManagerMemory=10240 等价于 taskmanager.memory.process.size=10gb",{"type":23,"tag":24,"props":17985,"children":17986},{},[17987],{"type":23,"tag":65,"props":17988,"children":17990},{"alt":8,"src":17989},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-fc708e5eb1159dcb.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":17992,"children":17993},{},[17994],{"type":28,"value":17995},"从上图能够看出数据流入变的特别小(kafka topic流入数据一直是稳定的10MB\u002Fs)，Flink任务数据延时一直是上升趋势，那么一定是程序遇到了性能瓶颈。",{"type":23,"tag":24,"props":17997,"children":17998},{},[17999],{"type":23,"tag":65,"props":18000,"children":18002},{"alt":8,"src":18001},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-08218773b292b539.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18004,"children":18005},{},[18006],{"type":28,"value":18007},"从上图能够看到源kafka topic 每个分区的消息滞后几十万条",{"type":23,"tag":24,"props":18009,"children":18010},{},[18011],{"type":28,"value":18012},"从grafana监控并不能定位Flink程序哪个调用栈出现了性能瓶颈，打个火焰图看看，如下图：",{"type":23,"tag":24,"props":18014,"children":18015},{},[18016],{"type":23,"tag":65,"props":18017,"children":18019},{"alt":8,"src":18018},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-c59e20adfd274816.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18021,"children":18022},{},[18023],{"type":28,"value":18024},"从上面的火焰图可以分析该程序大部分时间都是 rocksdb 在进行写数据与压缩数据，由于subtask子任务较多也占用了很多网络资源进行shuffle，由此得出结论rocksdb内存不够导致磁盘的IO增多，网络传输也是一个性能瓶颈点，我们如何在不增加总体内存的背景下增加rocksdb内存以及网络内存?通过以下配置参数调整内存比例：",{"type":23,"tag":2152,"props":18026,"children":18030},{"className":18027,"code":18028,"language":18029,"meta":8,"style":8},"language-csharp shiki shiki-themes github-light github-dark","-D state.backend.rocksdb.memory.fixed-per-slot=1gb\n-D taskmanager.memory.network.max=2gb\n-D taskmanager.memory.network.fraction=0.2\n","csharp",[18031],{"type":23,"tag":99,"props":18032,"children":18033},{"__ignoreMap":8},[18034,18042,18050],{"type":23,"tag":2161,"props":18035,"children":18036},{"class":2163,"line":2164},[18037],{"type":23,"tag":2161,"props":18038,"children":18039},{},[18040],{"type":28,"value":18041},"-D state.backend.rocksdb.memory.fixed-per-slot=1gb\n",{"type":23,"tag":2161,"props":18043,"children":18044},{"class":2163,"line":927},[18045],{"type":23,"tag":2161,"props":18046,"children":18047},{},[18048],{"type":28,"value":18049},"-D taskmanager.memory.network.max=2gb\n",{"type":23,"tag":2161,"props":18051,"children":18052},{"class":2163,"line":924},[18053],{"type":23,"tag":2161,"props":18054,"children":18055},{},[18056],{"type":28,"value":18057},"-D taskmanager.memory.network.fraction=0.2\n",{"type":23,"tag":24,"props":18059,"children":18060},{},[18061],{"type":28,"value":18062},"运行一段时间后发现该任务还是会有数据延迟，继续定位问题发现该任务的主要瓶颈在于window算子的数据倾斜，如下图所示：",{"type":23,"tag":24,"props":18064,"children":18065},{},[18066],{"type":23,"tag":65,"props":18067,"children":18069},{"alt":8,"src":18068},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-d25df7f94dda9731.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1190\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18071,"children":18072},{},[18073,18075,18081],{"type":28,"value":18074},"数据倾斜问题一直是分布式计算的难点，如果不处理的话一味的 ",{"type":23,"tag":99,"props":18076,"children":18078},{"className":18077},[],[18079],{"type":28,"value":18080},"加资源",{"type":28,"value":18082}," 起不到任何的效果，反而是对资源的浪费。",{"type":23,"tag":17976,"props":18084,"children":18085},{},[18086],{"type":23,"tag":24,"props":18087,"children":18088},{},[18089],{"type":28,"value":18090},"数据倾斜由于不是本篇文章分享的重点，如何解决数据倾斜放在下一篇文章分享。",{"type":23,"tag":50,"props":18092,"children":18094},{"id":18093},"疑问",[18095],{"type":28,"value":18093},{"type":23,"tag":24,"props":18097,"children":18098},{},[18099],{"type":28,"value":18100},"观测线上Flink 1.10任务带来的思考：",{"type":23,"tag":890,"props":18102,"children":18103},{},[18104,18117,18122],{"type":23,"tag":403,"props":18105,"children":18106},{},[18107,18109,18115],{"type":28,"value":18108},"通过 ",{"type":23,"tag":99,"props":18110,"children":18112},{"className":18111},[],[18113],{"type":28,"value":18114},"taskmanager.memory.process.size=10gb",{"type":28,"value":18116}," 该参数设置Container内存为10GB，通过Web UI监控发现tm内存远远达不到10GB到底其他的内存哪里去了呢？",{"type":23,"tag":403,"props":18118,"children":18119},{},[18120],{"type":28,"value":18121},"Flink的内存是如何划分的呢？",{"type":23,"tag":403,"props":18123,"children":18124},{},[18125],{"type":28,"value":18126},"Flink每一块内存到底有什么作用呢？",{"type":23,"tag":50,"props":18128,"children":18130},{"id":18129},"flink内存模型",[18131],{"type":28,"value":18132},"Flink内存模型",{"type":23,"tag":24,"props":18134,"children":18135},{},[18136,18138,18144,18146,18151,18153,18159,18161,18166],{"type":28,"value":18137},"要想深入了解上面几个问题不得不从Flink的内存模型入手，首先得提一下Flink框架源码所使用的开发语言 ",{"type":23,"tag":99,"props":18139,"children":18141},{"className":18140},[],[18142],{"type":28,"value":18143},"Java",{"type":28,"value":18145}," ，说到 ",{"type":23,"tag":99,"props":18147,"children":18149},{"className":18148},[],[18150],{"type":28,"value":18143},{"type":28,"value":18152}," 首先会联想到 ",{"type":23,"tag":99,"props":18154,"children":18156},{"className":18155},[],[18157],{"type":28,"value":18158},"JVM",{"type":28,"value":18160}," ，相比于 ",{"type":23,"tag":99,"props":18162,"children":18164},{"className":18163},[],[18165],{"type":28,"value":18158},{"type":28,"value":18167}," 内存控制Flink框架对于内存的管理更加的丰富，并且让开发者更加精细化的控制Flink程序的每个模块内存，首先我们来看下官放给出的Flink内存模型如下图：",{"type":23,"tag":24,"props":18169,"children":18170},{},[18171],{"type":23,"tag":65,"props":18172,"children":18174},{"alt":8,"src":18173},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-f0c11b2bb4e27fb2.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F588\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18176,"children":18177},{},[18178],{"type":28,"value":18179},"Flink内存主要分为两部分：container内存、flink内存，其中内存类型和Spark内存类型一样分为堆内(heap)和堆外(off-heap)，各模块内存使用场景及配置参数说明如下：",{"type":23,"tag":24,"props":18181,"children":18182},{},[18183],{"type":23,"tag":65,"props":18184,"children":18186},{"alt":8,"src":18185},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-37fd5b12f1bf021e.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1067\u002Fformat\u002Fwebp",[],{"type":23,"tag":50,"props":18188,"children":18190},{"id":18189},"内存计算公式如下",[18191],{"type":28,"value":18192},"内存计算公式如下：",{"type":23,"tag":399,"props":18194,"children":18195},{},[18196,18201,18214,18219,18224,18229],{"type":23,"tag":403,"props":18197,"children":18198},{},[18199],{"type":28,"value":18200},"JVM Metaspace Memory：默认256MB",{"type":23,"tag":403,"props":18202,"children":18203},{},[18204,18206,18212],{"type":28,"value":18205},"JVM Overhead Memory：默认整个container内存的0.1\n实际计算：1024M ",{"type":23,"tag":18207,"props":18208,"children":18209},"em",{},[18210],{"type":28,"value":18211},"0.1 \u003C 192 M? 192 M: (1024M",{"type":28,"value":18213}," 0.1 > 1Gb? 1Gb: 1024M * 0.1) = 192 M\n因此默认内存为192MB",{"type":23,"tag":403,"props":18215,"children":18216},{},[18217],{"type":28,"value":18218},"Flink Memory：Container Memory - JVM Metaspace - JVM Overhead",{"type":23,"tag":403,"props":18220,"children":18221},{},[18222],{"type":28,"value":18223},"Network Memory： Flink Memory * 0.1",{"type":23,"tag":403,"props":18225,"children":18226},{},[18227],{"type":28,"value":18228},"Manager Memory：Flink Memory * 0.4",{"type":23,"tag":403,"props":18230,"children":18231},{},[18232],{"type":28,"value":18233},"堆内内存：Flink Memory - Network Memory - Manager Memory",{"type":23,"tag":50,"props":18235,"children":18237},{"id":18236},"示例",[18238],{"type":28,"value":18236},{"type":23,"tag":76,"props":18240,"children":18242},{"id":18241},"线上-lbs-任务配置如下",[18243],{"type":28,"value":18244},"线上 LBS 任务配置如下：",{"type":23,"tag":2152,"props":18246,"children":18248},{"className":18027,"code":18247,"language":18029,"meta":8,"style":8},"-D state.backend.rocksdb.memory.fixed-per-slot=1gb\n-D state.backend.incremental=true\n--taskManagerMemory=10240\n-D taskmanager.memory.network.max=2gb\n-D taskmanager.memory.network.fraction=0.2\n-D taskmanager.numberOfTaskSlots=2\n",[18249],{"type":23,"tag":99,"props":18250,"children":18251},{"__ignoreMap":8},[18252,18259,18267,18275,18282,18289],{"type":23,"tag":2161,"props":18253,"children":18254},{"class":2163,"line":2164},[18255],{"type":23,"tag":2161,"props":18256,"children":18257},{},[18258],{"type":28,"value":18041},{"type":23,"tag":2161,"props":18260,"children":18261},{"class":2163,"line":927},[18262],{"type":23,"tag":2161,"props":18263,"children":18264},{},[18265],{"type":28,"value":18266},"-D state.backend.incremental=true\n",{"type":23,"tag":2161,"props":18268,"children":18269},{"class":2163,"line":924},[18270],{"type":23,"tag":2161,"props":18271,"children":18272},{},[18273],{"type":28,"value":18274},"--taskManagerMemory=10240\n",{"type":23,"tag":2161,"props":18276,"children":18277},{"class":2163,"line":2190},[18278],{"type":23,"tag":2161,"props":18279,"children":18280},{},[18281],{"type":28,"value":18049},{"type":23,"tag":2161,"props":18283,"children":18284},{"class":2163,"line":2199},[18285],{"type":23,"tag":2161,"props":18286,"children":18287},{},[18288],{"type":28,"value":18057},{"type":23,"tag":2161,"props":18290,"children":18291},{"class":2163,"line":2208},[18292],{"type":23,"tag":2161,"props":18293,"children":18294},{},[18295],{"type":28,"value":18296},"-D taskmanager.numberOfTaskSlots=2\n",{"type":23,"tag":76,"props":18298,"children":18300},{"id":18299},"实际内存计算如下",[18301],{"type":28,"value":18302},"实际内存计算如下：",{"type":23,"tag":890,"props":18304,"children":18305},{},[18306,18311,18316,18321],{"type":23,"tag":403,"props":18307,"children":18308},{},[18309],{"type":28,"value":18310},"Flink Memory = 10240 - 256 - 1024 = 8960MB",{"type":23,"tag":403,"props":18312,"children":18313},{},[18314],{"type":28,"value":18315},"Network Memory = 8960 * 0.2 = 1792MB",{"type":23,"tag":403,"props":18317,"children":18318},{},[18319],{"type":28,"value":18320},"Manager Memory = 8960 * 0.4 = 3584MB",{"type":23,"tag":403,"props":18322,"children":18323},{},[18324],{"type":28,"value":18325},"Task Heap Memory = 8960 - 1792 - 3584 - 128 - 128 = 3328MB\u002F3.25GB",{"type":23,"tag":24,"props":18327,"children":18328},{},[18329],{"type":28,"value":18330},"每个模块内存如下图：",{"type":23,"tag":24,"props":18332,"children":18333},{},[18334],{"type":23,"tag":65,"props":18335,"children":18337},{"alt":8,"src":18336},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-deb308dee4edf7b3.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1061\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18339,"children":18340},{},[18341],{"type":28,"value":18342},"Flink Web UI如下图：",{"type":23,"tag":24,"props":18344,"children":18345},{},[18346],{"type":23,"tag":65,"props":18347,"children":18349},{"alt":8,"src":18348},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-fda21dbb73c20a3a.jpg?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18351,"children":18352},{},[18353,18359],{"type":23,"tag":99,"props":18354,"children":18356},{"className":18355},[],[18357],{"type":28,"value":18358},"JVM Heap Memory",{"type":28,"value":18360}," 实际分配比公式计算出来的结果要多10MB左右，大差不差的能够计算出Flink内存的分布方便开发者根据自身任务的情况调整每一个模块的内存比例以及总体内存。至于差距的这部分内存我也会继续找原因，有知道的大佬评论区可以告诉我哪里计算的有问题。",{"type":23,"tag":50,"props":18362,"children":18364},{"id":18363},"成果",[18365],{"type":28,"value":18363},{"type":23,"tag":24,"props":18367,"children":18368},{},[18369],{"type":28,"value":18370},"该任务优化后一直处于较为稳定的状态，再没有收到过延时告警",{"type":23,"tag":50,"props":18372,"children":18373},{"id":17880},[18374],{"type":28,"value":17880},{"type":23,"tag":890,"props":18376,"children":18377},{},[18378,18383,18388,18393],{"type":23,"tag":403,"props":18379,"children":18380},{},[18381],{"type":28,"value":18382},"该篇文章能够让我们清楚线上Flink问题的定位流程是什么样的",{"type":23,"tag":403,"props":18384,"children":18385},{},[18386],{"type":28,"value":18387},"基于Flink内存模型能够清楚Flink每一块内存的分配",{"type":23,"tag":403,"props":18389,"children":18390},{},[18391],{"type":28,"value":18392},"Flink每一块内存的作用。",{"type":23,"tag":403,"props":18394,"children":18395},{},[18396],{"type":28,"value":18397},"加资源并不能解决所有任务的性能问题",{"type":23,"tag":2730,"props":18399,"children":18400},{},[18401],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":18403},[18404,18405,18406,18407,18408,18409,18413,18414],{"id":17908,"depth":927,"text":17908},{"id":17925,"depth":927,"text":17925},{"id":18093,"depth":927,"text":18093},{"id":18129,"depth":927,"text":18132},{"id":18189,"depth":927,"text":18192},{"id":18236,"depth":927,"text":18236,"children":18410},[18411,18412],{"id":18241,"depth":924,"text":18244},{"id":18299,"depth":924,"text":18302},{"id":18363,"depth":927,"text":18363},{"id":17880,"depth":927,"text":17880},"content:blog:2022-09-25-flink-memory-model.md","blog\u002F2022-09-25-flink-memory-model.md","blog\u002F2022-09-25-flink-memory-model",{"_path":18419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":18420,"description":18421,"date":18422,"tags":18423,"cover":18426,"source":18427,"body":18428,"_type":937,"_id":20566,"_source":939,"_file":20567,"_stem":20568,"_extension":942},"\u002Fblog\u002F2020-05-12-canal-kafka-mysql","Canal + Kafka 实现 MySQL 的 binlog 近实时同步","基于 Alibaba 开源中间件 Canal 实现 MySQL binlog 近实时同步至 Kafka，搭建完整的 Canal 相关组件。","2020-05-12",[16717,16718,18424,5285,18425],"Canal","MySQL","https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-fb09aa1da4d8ec7a.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Fd03ef9e8f204",{"type":20,"children":18429,"toc":20551},[18430,18434,18439,18446,18451,18457,18462,18473,18480,18485,18513,18518,18523,18530,18591,18596,18614,18619,18651,18657,18663,18668,18674,18679,18685,18690,18696,18701,18707,18719,18789,18794,18960,18995,19090,19116,19133,19282,19294,19364,19369,19376,19388,20435,20442,20489,20493,20520,20525,20547],{"type":23,"tag":50,"props":18431,"children":18432},{"id":17908},[18433],{"type":28,"value":17908},{"type":23,"tag":24,"props":18435,"children":18436},{},[18437],{"type":28,"value":18438},"经过上篇文章的测试 Kafka Connect For MySQL 实现增量数据同步，因为研究时间较短，网上资源较少，只能自己一步一步去探索，在理论层面上是可以实现业务需求，但是实践过程中遇到一些原因，导致实际效果没有达到业务需求。所以将基于业务需求重新进行技术调研。因为笔者目前工作重心在于搭建一个小型的实时数仓。优先级比较高的一个任务就是需要近实时同步业务系统的数据（包括保存、更新或者软删除）到一个另一个数据源，持久化之前需要清洗数据并且构建一个相对合理的便于后续业务数据指标统计、数据指标计算等扩展功能的业务模型。基于当前团队的资源和能力，优先调研了Alibaba开源中间件Canal的使用。",{"type":23,"tag":24,"props":18440,"children":18441},{},[18442],{"type":23,"tag":65,"props":18443,"children":18445},{"alt":8,"src":18444},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-fb09aa1da4d8ec7a.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F950\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18447,"children":18448},{},[18449],{"type":28,"value":18450},"这篇文章将测试一下如何快速地搭建一套Canal相关的组件。",{"type":23,"tag":50,"props":18452,"children":18454},{"id":18453},"关于-canal",[18455],{"type":28,"value":18456},"关于 Canal",{"type":23,"tag":50,"props":18458,"children":18460},{"id":18459},"简介",[18461],{"type":28,"value":18459},{"type":23,"tag":24,"props":18463,"children":18464},{},[18465,18471],{"type":23,"tag":99,"props":18466,"children":18468},{"className":18467},[],[18469],{"type":28,"value":18470},"canal[kə'næl]",{"type":28,"value":18472}," ，译意为水道\u002F管道\u002F沟渠，主要用途是基于MySQL数据库增量日志解析，提供增量数据订阅和消费。早期阿里巴巴因为杭州和美国双机房部署，存在跨机房同步的业务需求，实现方式主要是基于业务trigger获取增量变更。从 2010 年开始，业务逐步尝试数据库日志解析获取增量变更进行同步，由此衍生出了大量的数据库增量订阅和消费业务。",{"type":23,"tag":24,"props":18474,"children":18475},{},[18476],{"type":23,"tag":65,"props":18477,"children":18479},{"alt":8,"src":18478},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-94d458394bdc7ab9.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":18481,"children":18482},{},[18483],{"type":28,"value":18484},"基于日志增量订阅和消费的业务包括：",{"type":23,"tag":399,"props":18486,"children":18487},{},[18488,18493,18498,18503,18508],{"type":23,"tag":403,"props":18489,"children":18490},{},[18491],{"type":28,"value":18492},"数据库镜像",{"type":23,"tag":403,"props":18494,"children":18495},{},[18496],{"type":28,"value":18497},"数据库实时备份",{"type":23,"tag":403,"props":18499,"children":18500},{},[18501],{"type":28,"value":18502},"索引构建和实时维护（拆分异构索引、倒排索引等）",{"type":23,"tag":403,"props":18504,"children":18505},{},[18506],{"type":28,"value":18507},"业务Cache刷新",{"type":23,"tag":403,"props":18509,"children":18510},{},[18511],{"type":28,"value":18512},"带业务逻辑的增量数据处理",{"type":23,"tag":50,"props":18514,"children":18516},{"id":18515},"工作原理",[18517],{"type":28,"value":18515},{"type":23,"tag":24,"props":18519,"children":18520},{},[18521],{"type":28,"value":18522},"MySQL主备复制原理：",{"type":23,"tag":24,"props":18524,"children":18525},{},[18526],{"type":23,"tag":65,"props":18527,"children":18529},{"alt":8,"src":18528},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-304d42d58596fd93.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F497\u002Fformat\u002Fwebp",[],{"type":23,"tag":399,"props":18531,"children":18532},{},[18533,18550,18575],{"type":23,"tag":403,"props":18534,"children":18535},{},[18536,18541,18542,18548],{"type":23,"tag":99,"props":18537,"children":18539},{"className":18538},[],[18540],{"type":28,"value":18425},{"type":28,"value":9348},{"type":23,"tag":99,"props":18543,"children":18545},{"className":18544},[],[18546],{"type":28,"value":18547},"Master",{"type":28,"value":18549}," 实例将数据变更写入二进制日志（binary log，其中记录叫做二进制日志事件binary log events，可以通过show binlog events进行查看）",{"type":23,"tag":403,"props":18551,"children":18552},{},[18553,18558,18559,18565,18567,18573],{"type":23,"tag":99,"props":18554,"children":18556},{"className":18555},[],[18557],{"type":28,"value":18425},{"type":28,"value":9348},{"type":23,"tag":99,"props":18560,"children":18562},{"className":18561},[],[18563],{"type":28,"value":18564},"Slave",{"type":28,"value":18566}," 实例将master的 ",{"type":23,"tag":99,"props":18568,"children":18570},{"className":18569},[],[18571],{"type":28,"value":18572},"binary log events",{"type":28,"value":18574}," 拷贝到它的中继日志（relay log）",{"type":23,"tag":403,"props":18576,"children":18577},{},[18578,18583,18584,18589],{"type":23,"tag":99,"props":18579,"children":18581},{"className":18580},[],[18582],{"type":28,"value":18425},{"type":28,"value":9348},{"type":23,"tag":99,"props":18585,"children":18587},{"className":18586},[],[18588],{"type":28,"value":18564},{"type":28,"value":18590}," 实例重放relay log中的事件，将数据变更反映它到自身的数据",{"type":23,"tag":24,"props":18592,"children":18593},{},[18594],{"type":28,"value":18595},"Canal 的工作原理如下：",{"type":23,"tag":399,"props":18597,"children":18598},{},[18599,18604,18609],{"type":23,"tag":403,"props":18600,"children":18601},{},[18602],{"type":28,"value":18603},"Canal模拟MySQL Slave的交互协议，伪装自己为MySQL Slave，向MySQL Master发送dump协议",{"type":23,"tag":403,"props":18605,"children":18606},{},[18607],{"type":28,"value":18608},"MySQL Master收到dump请求，开始推送binary log给Slave（即Canal）",{"type":23,"tag":403,"props":18610,"children":18611},{},[18612],{"type":28,"value":18613},"Canal解析binary log对象（原始为byte流），并且可以通过连接器发送到对应的消息队列等中间件中",{"type":23,"tag":50,"props":18615,"children":18617},{"id":18616},"部署所需的中间件",[18618],{"type":28,"value":18616},{"type":23,"tag":24,"props":18620,"children":18621},{},[18622,18624,18629,18631,18637,18638,18643,18644,18649],{"type":28,"value":18623},"搭建一套可以用的组件需要部署 ",{"type":23,"tag":99,"props":18625,"children":18627},{"className":18626},[],[18628],{"type":28,"value":18425},{"type":28,"value":18630}," 、 ",{"type":23,"tag":99,"props":18632,"children":18634},{"className":18633},[],[18635],{"type":28,"value":18636},"Zookeeper",{"type":28,"value":18630},{"type":23,"tag":99,"props":18639,"children":18641},{"className":18640},[],[18642],{"type":28,"value":5285},{"type":28,"value":1148},{"type":23,"tag":99,"props":18645,"children":18647},{"className":18646},[],[18648],{"type":28,"value":18424},{"type":28,"value":18650}," 四个中间件的实例，下面简单分析一下部署过程。选用的服务器系统是CentOS7。",{"type":23,"tag":50,"props":18652,"children":18654},{"id":18653},"mysql-环境搭建",[18655],{"type":28,"value":18656},"MySQL 环境搭建",{"type":23,"tag":76,"props":18658,"children":18660},{"id":18659},"mysql-安装",[18661],{"type":28,"value":18662},"MySQL 安装",{"type":23,"tag":24,"props":18664,"children":18665},{},[18666],{"type":28,"value":18667},"MySQL-5.7 的安装参考文章 Centos 7.3 安装 MySQL 5.7\nMySQL-8.0 的安装参考文章 Centos 7.3 安装 MySQL 8.0",{"type":23,"tag":76,"props":18669,"children":18671},{"id":18670},"mysql-开启-binlog",[18672],{"type":28,"value":18673},"Mysql 开启 binlog",{"type":23,"tag":24,"props":18675,"children":18676},{},[18677],{"type":28,"value":18678},"参考文章 MySQL 开启 binlog",{"type":23,"tag":50,"props":18680,"children":18682},{"id":18681},"zookeeper-分布式环境搭建",[18683],{"type":28,"value":18684},"Zookeeper 分布式环境搭建",{"type":23,"tag":24,"props":18686,"children":18687},{},[18688],{"type":28,"value":18689},"参考文章 Zookeeper 分布式环境搭建",{"type":23,"tag":50,"props":18691,"children":18693},{"id":18692},"kafka-分布式环境搭建",[18694],{"type":28,"value":18695},"Kafka 分布式环境搭建",{"type":23,"tag":24,"props":18697,"children":18698},{},[18699],{"type":28,"value":18700},"参考文章 Kafka 分布式环境搭建",{"type":23,"tag":50,"props":18702,"children":18704},{"id":18703},"安装和使用-canal",[18705],{"type":28,"value":18706},"安装和使用 Canal",{"type":23,"tag":24,"props":18708,"children":18709},{},[18710,18712,18717],{"type":28,"value":18711},"终于到了主角登场，这里选用 ",{"type":23,"tag":99,"props":18713,"children":18715},{"className":18714},[],[18716],{"type":28,"value":18424},{"type":28,"value":18718}," 的v1.1.4稳定发布版，只需要下载deployer模块：",{"type":23,"tag":2152,"props":18720,"children":18722},{"className":5795,"code":18721,"language":5797,"meta":8,"style":8},"mkdir \u002Fdata\u002Fcanal\ncd \u002Fdata\u002Fcanal\n# 这里注意一点，Github在国内被墙，下载速度极慢，可以先用其他下载工具下载完再上传到服务器中\nwget https:\u002F\u002Fgithub.com\u002Falibaba\u002Fcanal\u002Freleases\u002Fdownload\u002Fcanal-1.1.4\u002Fcanal.deployer-1.1.4.tar.gz\ntar -zxvf canal.deployer-1.1.4.tar.gz\n",[18723],{"type":23,"tag":99,"props":18724,"children":18725},{"__ignoreMap":8},[18726,18739,18751,18759,18772],{"type":23,"tag":2161,"props":18727,"children":18728},{"class":2163,"line":2164},[18729,18734],{"type":23,"tag":2161,"props":18730,"children":18731},{"style":5824},[18732],{"type":28,"value":18733},"mkdir",{"type":23,"tag":2161,"props":18735,"children":18736},{"style":5855},[18737],{"type":28,"value":18738}," \u002Fdata\u002Fcanal\n",{"type":23,"tag":2161,"props":18740,"children":18741},{"class":2163,"line":927},[18742,18747],{"type":23,"tag":2161,"props":18743,"children":18744},{"style":5844},[18745],{"type":28,"value":18746},"cd",{"type":23,"tag":2161,"props":18748,"children":18749},{"style":5855},[18750],{"type":28,"value":18738},{"type":23,"tag":2161,"props":18752,"children":18753},{"class":2163,"line":924},[18754],{"type":23,"tag":2161,"props":18755,"children":18756},{"style":5807},[18757],{"type":28,"value":18758},"# 这里注意一点，Github在国内被墙，下载速度极慢，可以先用其他下载工具下载完再上传到服务器中\n",{"type":23,"tag":2161,"props":18760,"children":18761},{"class":2163,"line":2190},[18762,18767],{"type":23,"tag":2161,"props":18763,"children":18764},{"style":5824},[18765],{"type":28,"value":18766},"wget",{"type":23,"tag":2161,"props":18768,"children":18769},{"style":5855},[18770],{"type":28,"value":18771}," https:\u002F\u002Fgithub.com\u002Falibaba\u002Fcanal\u002Freleases\u002Fdownload\u002Fcanal-1.1.4\u002Fcanal.deployer-1.1.4.tar.gz\n",{"type":23,"tag":2161,"props":18773,"children":18774},{"class":2163,"line":2199},[18775,18779,18784],{"type":23,"tag":2161,"props":18776,"children":18777},{"style":5824},[18778],{"type":28,"value":16518},{"type":23,"tag":2161,"props":18780,"children":18781},{"style":5844},[18782],{"type":28,"value":18783}," -zxvf",{"type":23,"tag":2161,"props":18785,"children":18786},{"style":5855},[18787],{"type":28,"value":18788}," canal.deployer-1.1.4.tar.gz\n",{"type":23,"tag":24,"props":18790,"children":18791},{},[18792],{"type":28,"value":18793},"解压后的目录如下：",{"type":23,"tag":2152,"props":18795,"children":18797},{"className":5795,"code":18796,"language":5797,"meta":8,"style":8},"- bin   # 运维脚本\n- conf  # 配置文件\n  canal_local.properties  # canal本地配置，一般不需要动\n  canal.properties        # canal服务配置\n  logback.xml             # logback日志配置\n  metrics                 # 度量统计配置\n  spring                  # spring-实例配置，主要和binlog位置计算、一些策略配置相关\n  example                 # 实例配置文件夹，一般认为单个数据库对应一个独立的实例配置文件夹\n    instance.properties   # 实例配置，一般指单个数据库的配置\n- lib   # 服务依赖包\n- logs  # 日志文件输出目录\n",[18798],{"type":23,"tag":99,"props":18799,"children":18800},{"__ignoreMap":8},[18801,18818,18835,18848,18861,18874,18887,18900,18913,18926,18943],{"type":23,"tag":2161,"props":18802,"children":18803},{"class":2163,"line":2164},[18804,18808,18813],{"type":23,"tag":2161,"props":18805,"children":18806},{"style":5824},[18807],{"type":28,"value":11512},{"type":23,"tag":2161,"props":18809,"children":18810},{"style":5855},[18811],{"type":28,"value":18812}," bin",{"type":23,"tag":2161,"props":18814,"children":18815},{"style":5807},[18816],{"type":28,"value":18817},"   # 运维脚本\n",{"type":23,"tag":2161,"props":18819,"children":18820},{"class":2163,"line":927},[18821,18825,18830],{"type":23,"tag":2161,"props":18822,"children":18823},{"style":5824},[18824],{"type":28,"value":11512},{"type":23,"tag":2161,"props":18826,"children":18827},{"style":5855},[18828],{"type":28,"value":18829}," conf",{"type":23,"tag":2161,"props":18831,"children":18832},{"style":5807},[18833],{"type":28,"value":18834},"  # 配置文件\n",{"type":23,"tag":2161,"props":18836,"children":18837},{"class":2163,"line":924},[18838,18843],{"type":23,"tag":2161,"props":18839,"children":18840},{"style":5824},[18841],{"type":28,"value":18842},"  canal_local.properties",{"type":23,"tag":2161,"props":18844,"children":18845},{"style":5807},[18846],{"type":28,"value":18847},"  # canal本地配置，一般不需要动\n",{"type":23,"tag":2161,"props":18849,"children":18850},{"class":2163,"line":2190},[18851,18856],{"type":23,"tag":2161,"props":18852,"children":18853},{"style":5824},[18854],{"type":28,"value":18855},"  canal.properties",{"type":23,"tag":2161,"props":18857,"children":18858},{"style":5807},[18859],{"type":28,"value":18860},"        # canal服务配置\n",{"type":23,"tag":2161,"props":18862,"children":18863},{"class":2163,"line":2199},[18864,18869],{"type":23,"tag":2161,"props":18865,"children":18866},{"style":5824},[18867],{"type":28,"value":18868},"  logback.xml",{"type":23,"tag":2161,"props":18870,"children":18871},{"style":5807},[18872],{"type":28,"value":18873},"             # logback日志配置\n",{"type":23,"tag":2161,"props":18875,"children":18876},{"class":2163,"line":2208},[18877,18882],{"type":23,"tag":2161,"props":18878,"children":18879},{"style":5824},[18880],{"type":28,"value":18881},"  metrics",{"type":23,"tag":2161,"props":18883,"children":18884},{"style":5807},[18885],{"type":28,"value":18886},"                 # 度量统计配置\n",{"type":23,"tag":2161,"props":18888,"children":18889},{"class":2163,"line":2217},[18890,18895],{"type":23,"tag":2161,"props":18891,"children":18892},{"style":5824},[18893],{"type":28,"value":18894},"  spring",{"type":23,"tag":2161,"props":18896,"children":18897},{"style":5807},[18898],{"type":28,"value":18899},"                  # spring-实例配置，主要和binlog位置计算、一些策略配置相关\n",{"type":23,"tag":2161,"props":18901,"children":18902},{"class":2163,"line":2226},[18903,18908],{"type":23,"tag":2161,"props":18904,"children":18905},{"style":5824},[18906],{"type":28,"value":18907},"  example",{"type":23,"tag":2161,"props":18909,"children":18910},{"style":5807},[18911],{"type":28,"value":18912},"                 # 实例配置文件夹，一般认为单个数据库对应一个独立的实例配置文件夹\n",{"type":23,"tag":2161,"props":18914,"children":18915},{"class":2163,"line":2235},[18916,18921],{"type":23,"tag":2161,"props":18917,"children":18918},{"style":5824},[18919],{"type":28,"value":18920},"    instance.properties",{"type":23,"tag":2161,"props":18922,"children":18923},{"style":5807},[18924],{"type":28,"value":18925},"   # 实例配置，一般指单个数据库的配置\n",{"type":23,"tag":2161,"props":18927,"children":18928},{"class":2163,"line":2244},[18929,18933,18938],{"type":23,"tag":2161,"props":18930,"children":18931},{"style":5824},[18932],{"type":28,"value":11512},{"type":23,"tag":2161,"props":18934,"children":18935},{"style":5855},[18936],{"type":28,"value":18937}," lib",{"type":23,"tag":2161,"props":18939,"children":18940},{"style":5807},[18941],{"type":28,"value":18942},"   # 服务依赖包\n",{"type":23,"tag":2161,"props":18944,"children":18945},{"class":2163,"line":2253},[18946,18950,18955],{"type":23,"tag":2161,"props":18947,"children":18948},{"style":5824},[18949],{"type":28,"value":11512},{"type":23,"tag":2161,"props":18951,"children":18952},{"style":5855},[18953],{"type":28,"value":18954}," logs",{"type":23,"tag":2161,"props":18956,"children":18957},{"style":5807},[18958],{"type":28,"value":18959},"  # 日志文件输出目录\n",{"type":23,"tag":24,"props":18961,"children":18962},{},[18963,18965,18971,18973,18979,18980,18986,18988,18993],{"type":28,"value":18964},"在开发和测试环境建议把 ",{"type":23,"tag":99,"props":18966,"children":18968},{"className":18967},[],[18969],{"type":28,"value":18970},"logback.xml",{"type":28,"value":18972}," 的日志级别修改为DEBUG方便定位问题。这里需要关注 ",{"type":23,"tag":99,"props":18974,"children":18976},{"className":18975},[],[18977],{"type":28,"value":18978},"canal.properties",{"type":28,"value":1148},{"type":23,"tag":99,"props":18981,"children":18983},{"className":18982},[],[18984],{"type":28,"value":18985},"instance.properties",{"type":28,"value":18987}," 两个配置文件。 ",{"type":23,"tag":99,"props":18989,"children":18991},{"className":18990},[],[18992],{"type":28,"value":18978},{"type":28,"value":18994}," 文件中，需要修改：",{"type":23,"tag":399,"props":18996,"children":18997},{},[18998,19011,19057],{"type":23,"tag":403,"props":18999,"children":19000},{},[19001,19003,19009],{"type":28,"value":19002},"去掉 ",{"type":23,"tag":99,"props":19004,"children":19006},{"className":19005},[],[19007],{"type":28,"value":19008},"canal.instance.parser.parallelThreadSize = 16",{"type":28,"value":19010}," 这个配置项的注释，也就是启用此配置项，和实例解析器的线程数相关，不配置会表现为阻塞或者不进行解析。",{"type":23,"tag":403,"props":19012,"children":19013},{},[19014,19020,19022,19028,19030,19036,19037,19042,19043,19049,19051,19056],{"type":23,"tag":99,"props":19015,"children":19017},{"className":19016},[],[19018],{"type":28,"value":19019},"canal.serverMode",{"type":28,"value":19021}," 配置项指定为 ",{"type":23,"tag":99,"props":19023,"children":19025},{"className":19024},[],[19026],{"type":28,"value":19027},"kafka",{"type":28,"value":19029}," ，可选值有 ",{"type":23,"tag":99,"props":19031,"children":19033},{"className":19032},[],[19034],{"type":28,"value":19035},"tcp",{"type":28,"value":18630},{"type":23,"tag":99,"props":19038,"children":19040},{"className":19039},[],[19041],{"type":28,"value":19027},{"type":28,"value":1148},{"type":23,"tag":99,"props":19044,"children":19046},{"className":19045},[],[19047],{"type":28,"value":19048},"rocketmq",{"type":28,"value":19050}," ，默认是 ",{"type":23,"tag":99,"props":19052,"children":19054},{"className":19053},[],[19055],{"type":28,"value":19027},{"type":28,"value":16927},{"type":23,"tag":403,"props":19058,"children":19059},{},[19060,19066,19068,19073,19075,19081,19083,19089],{"type":23,"tag":99,"props":19061,"children":19063},{"className":19062},[],[19064],{"type":28,"value":19065},"canal.mq.servers",{"type":28,"value":19067}," 配置需要指定为 ",{"type":23,"tag":99,"props":19069,"children":19071},{"className":19070},[],[19072],{"type":28,"value":5285},{"type":28,"value":19074}," 服务或者集群 ",{"type":23,"tag":99,"props":19076,"children":19078},{"className":19077},[],[19079],{"type":28,"value":19080},"Broker",{"type":28,"value":19082}," 的地址，这里配置为 ",{"type":23,"tag":99,"props":19084,"children":19086},{"className":19085},[],[19087],{"type":28,"value":19088},"127.0.0.1:9092",{"type":28,"value":16927},{"type":23,"tag":17976,"props":19091,"children":19092},{},[19093,19098],{"type":23,"tag":24,"props":19094,"children":19095},{},[19096],{"type":28,"value":19097},"canal.mq.servers在不同的canal.serverMode有不同的意义。",{"type":23,"tag":399,"props":19099,"children":19100},{},[19101,19106,19111],{"type":23,"tag":403,"props":19102,"children":19103},{},[19104],{"type":28,"value":19105},"kafka模式下，指Kafka服务或者集群Broker的地址，也就是bootstrap.servers",{"type":23,"tag":403,"props":19107,"children":19108},{},[19109],{"type":28,"value":19110},"rocketmq模式下，指NameServer列表",{"type":23,"tag":403,"props":19112,"children":19113},{},[19114],{"type":28,"value":19115},"rabbitmq模式下，指RabbitMQ服务的Host和Port",{"type":23,"tag":24,"props":19117,"children":19118},{},[19119,19124,19126,19131],{"type":23,"tag":99,"props":19120,"children":19122},{"className":19121},[],[19123],{"type":28,"value":18985},{"type":28,"value":19125}," 一般指一个数据库实例的配置，Canal架构支持一个Canal服务实例，处理多个数据库实例的binlog异步解析。 ",{"type":23,"tag":99,"props":19127,"children":19129},{"className":19128},[],[19130],{"type":28,"value":18985},{"type":28,"value":19132}," 需要修改的配置项主要包括：",{"type":23,"tag":399,"props":19134,"children":19135},{},[19136,19154,19221],{"type":23,"tag":403,"props":19137,"children":19138},{},[19139,19145,19147,19153],{"type":23,"tag":99,"props":19140,"children":19142},{"className":19141},[],[19143],{"type":28,"value":19144},"canal.instance.mysql.slaveId",{"type":28,"value":19146}," 需要配置一个和Master节点的服务ID完全不同的值，这里笔者配置为 ",{"type":23,"tag":99,"props":19148,"children":19150},{"className":19149},[],[19151],{"type":28,"value":19152},"654321",{"type":28,"value":16927},{"type":23,"tag":403,"props":19155,"children":19156},{},[19157,19159],{"type":28,"value":19158},"配置数据源实例，包括地址、用户、密码和目标数据库：\n",{"type":23,"tag":399,"props":19160,"children":19161},{},[19162,19180,19191,19208],{"type":23,"tag":403,"props":19163,"children":19164},{},[19165,19171,19173,19179],{"type":23,"tag":99,"props":19166,"children":19168},{"className":19167},[],[19169],{"type":28,"value":19170},"canal.instance.master.address",{"type":28,"value":19172}," ，这里指定为 ",{"type":23,"tag":99,"props":19174,"children":19176},{"className":19175},[],[19177],{"type":28,"value":19178},"127.0.0.1:3306",{"type":28,"value":16927},{"type":23,"tag":403,"props":19181,"children":19182},{},[19183,19189],{"type":23,"tag":99,"props":19184,"children":19186},{"className":19185},[],[19187],{"type":28,"value":19188},"canal.instance.dbUsername",{"type":28,"value":19190}," ，这里指定为canal。",{"type":23,"tag":403,"props":19192,"children":19193},{},[19194,19200,19201,19207],{"type":23,"tag":99,"props":19195,"children":19197},{"className":19196},[],[19198],{"type":28,"value":19199},"canal.instance.dbPassword",{"type":28,"value":19172},{"type":23,"tag":99,"props":19202,"children":19204},{"className":19203},[],[19205],{"type":28,"value":19206},"QWqw12!@",{"type":28,"value":16927},{"type":23,"tag":403,"props":19209,"children":19210},{},[19211,19213,19219],{"type":28,"value":19212},"新增 ",{"type":23,"tag":99,"props":19214,"children":19216},{"className":19215},[],[19217],{"type":28,"value":19218},"canal.instance.defaultDatabaseName",{"type":28,"value":19220}," ，这里指定为test。",{"type":23,"tag":403,"props":19222,"children":19223},{},[19224,19229,19231,19237,19239,19245,19247],{"type":23,"tag":99,"props":19225,"children":19227},{"className":19226},[],[19228],{"type":28,"value":5285},{"type":28,"value":19230}," 相关配置，这里暂时使用静态 ",{"type":23,"tag":99,"props":19232,"children":19234},{"className":19233},[],[19235],{"type":28,"value":19236},"topic",{"type":28,"value":19238}," 和单个 ",{"type":23,"tag":99,"props":19240,"children":19242},{"className":19241},[],[19243],{"type":28,"value":19244},"partition",{"type":28,"value":19246}," ：\n",{"type":23,"tag":399,"props":19248,"children":19249},{},[19250,19266],{"type":23,"tag":403,"props":19251,"children":19252},{},[19253,19259,19260,19265],{"type":23,"tag":99,"props":19254,"children":19256},{"className":19255},[],[19257],{"type":28,"value":19258},"canal.mq.topic",{"type":28,"value":19172},{"type":23,"tag":99,"props":19261,"children":19263},{"className":19262},[],[19264],{"type":28,"value":10068},{"type":28,"value":16927},{"type":23,"tag":403,"props":19267,"children":19268},{},[19269,19275,19276,19281],{"type":23,"tag":99,"props":19270,"children":19272},{"className":19271},[],[19273],{"type":28,"value":19274},"canal.mq.partition",{"type":28,"value":19172},{"type":23,"tag":99,"props":19277,"children":19279},{"className":19278},[],[19280],{"type":28,"value":10621},{"type":28,"value":16927},{"type":23,"tag":24,"props":19283,"children":19284},{},[19285,19287,19292],{"type":28,"value":19286},"配置工作做好之后，可以启动 ",{"type":23,"tag":99,"props":19288,"children":19290},{"className":19289},[],[19291],{"type":28,"value":18424},{"type":28,"value":19293}," 服务：",{"type":23,"tag":2152,"props":19295,"children":19297},{"className":5795,"code":19296,"language":5797,"meta":8,"style":8},"sh \u002Fdata\u002Fcanal\u002Fbin\u002Fstartup.sh\n# 查看服务日志\ntail -100f \u002Fdata\u002Fcanal\u002Flogs\u002Fcanal\u002Fcanal\n# 查看实例日志  -- 一般情况下，关注实例日志即可\ntail -100f \u002Fdata\u002Fcanal\u002Flogs\u002Fexample\u002Fexample.log\n",[19298],{"type":23,"tag":99,"props":19299,"children":19300},{"__ignoreMap":8},[19301,19314,19322,19340,19348],{"type":23,"tag":2161,"props":19302,"children":19303},{"class":2163,"line":2164},[19304,19309],{"type":23,"tag":2161,"props":19305,"children":19306},{"style":5824},[19307],{"type":28,"value":19308},"sh",{"type":23,"tag":2161,"props":19310,"children":19311},{"style":5855},[19312],{"type":28,"value":19313}," \u002Fdata\u002Fcanal\u002Fbin\u002Fstartup.sh\n",{"type":23,"tag":2161,"props":19315,"children":19316},{"class":2163,"line":927},[19317],{"type":23,"tag":2161,"props":19318,"children":19319},{"style":5807},[19320],{"type":28,"value":19321},"# 查看服务日志\n",{"type":23,"tag":2161,"props":19323,"children":19324},{"class":2163,"line":924},[19325,19330,19335],{"type":23,"tag":2161,"props":19326,"children":19327},{"style":5824},[19328],{"type":28,"value":19329},"tail",{"type":23,"tag":2161,"props":19331,"children":19332},{"style":5844},[19333],{"type":28,"value":19334}," -100f",{"type":23,"tag":2161,"props":19336,"children":19337},{"style":5855},[19338],{"type":28,"value":19339}," \u002Fdata\u002Fcanal\u002Flogs\u002Fcanal\u002Fcanal\n",{"type":23,"tag":2161,"props":19341,"children":19342},{"class":2163,"line":2190},[19343],{"type":23,"tag":2161,"props":19344,"children":19345},{"style":5807},[19346],{"type":28,"value":19347},"# 查看实例日志  -- 一般情况下，关注实例日志即可\n",{"type":23,"tag":2161,"props":19349,"children":19350},{"class":2163,"line":2199},[19351,19355,19359],{"type":23,"tag":2161,"props":19352,"children":19353},{"style":5824},[19354],{"type":28,"value":19329},{"type":23,"tag":2161,"props":19356,"children":19357},{"style":5844},[19358],{"type":28,"value":19334},{"type":23,"tag":2161,"props":19360,"children":19361},{"style":5855},[19362],{"type":28,"value":19363}," \u002Fdata\u002Fcanal\u002Flogs\u002Fexample\u002Fexample.log\n",{"type":23,"tag":24,"props":19365,"children":19366},{},[19367],{"type":28,"value":19368},"启动正常后，见实例日志如下：",{"type":23,"tag":24,"props":19370,"children":19371},{},[19372],{"type":23,"tag":65,"props":19373,"children":19375},{"alt":8,"src":19374},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-6af348f8c1f04d14.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":19377,"children":19378},{},[19379,19381,19386],{"type":28,"value":19380},"在 ",{"type":23,"tag":99,"props":19382,"children":19384},{"className":19383},[],[19385],{"type":28,"value":10068},{"type":28,"value":19387}," 数据库创建一个订单表，并且执行几个简单的DML：",{"type":23,"tag":2152,"props":19389,"children":19393},{"className":19390,"code":19391,"language":19392,"meta":8,"style":8},"language-sql shiki shiki-themes github-light github-dark","USE test;\n\nCREATE TABLE IF NOT EXISTS test.omneo(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    commenttime timestamp NOT NULL DEFAULT current_timestamp,\n    PRIMARY KEY (pid)\n)ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n# 插入 4 条测试数据\ninsert into omneo values(1,\"0049683542a7-5bdb-d564-3133-276ae3ce\",\"Maurice\",\"Samuel\",\"01\u002F11\u002F1977\",\"H2M2V5\",\"Ballancourt\",\"male\",\"en couple\",\"2020-05-09 11:01:54\");\ninsert into omneo values(2,\"8338623542a7-5bdb-d564-3133-276ae3ce\",\"Gauthier\",\"Garbuet\",\"23\u002F05\u002F1965\",\"05274\",\"Cocagne\",\"female\",\"maried\",\"2020-05-09 11:01:54\");\ninsert into omneo values(3,\"3374573542a7-5bdb-d564-3133-276ae3ce\",\"Maurice\",\"Samuel\",\"01\u002F11\u002F1977\",\"H0H0H0\",\"Ottawa\",\"male\",\"en couple\",\"2020-05-09 11:01:54\");\ninsert into omneo values(4,\"5494133542a7-5bdb-d564-3133-276ae3ce\",\"Nicole\",\"Garbuet\",\"01\u002F11\u002F1977\",\"H0H0H0\",\"Maugio\",\"unknown\",\"single\",\"2020-05-09 11:01:54\");\n\n# 更新测试数据\nupdate omneo set firstname = \"world\" ,commenttime=\"2020-12-20 15:55:10\" where pid in(2,4);\n# 删除测试数据\ndelete from omneo where pid = 1;\n","sql",[19394],{"type":23,"tag":99,"props":19395,"children":19396},{"__ignoreMap":8},[19397,19410,19417,19465,19501,19534,19588,19636,19661,19685,19709,19733,19758,19786,19799,19835,19843,19861,19974,20082,20185,20290,20298,20307,20387,20396],{"type":23,"tag":2161,"props":19398,"children":19399},{"class":2163,"line":2164},[19400,19405],{"type":23,"tag":2161,"props":19401,"children":19402},{"style":5948},[19403],{"type":28,"value":19404},"USE",{"type":23,"tag":2161,"props":19406,"children":19407},{"style":5830},[19408],{"type":28,"value":19409}," test;\n",{"type":23,"tag":2161,"props":19411,"children":19412},{"class":2163,"line":927},[19413],{"type":23,"tag":2161,"props":19414,"children":19415},{"emptyLinePlaceholder":2176},[19416],{"type":28,"value":2179},{"type":23,"tag":2161,"props":19418,"children":19419},{"class":2163,"line":924},[19420,19425,19430,19435,19440,19445,19450,19455,19460],{"type":23,"tag":2161,"props":19421,"children":19422},{"style":5948},[19423],{"type":28,"value":19424},"CREATE",{"type":23,"tag":2161,"props":19426,"children":19427},{"style":5948},[19428],{"type":28,"value":19429}," TABLE",{"type":23,"tag":2161,"props":19431,"children":19432},{"style":5824},[19433],{"type":28,"value":19434}," IF",{"type":23,"tag":2161,"props":19436,"children":19437},{"style":5948},[19438],{"type":28,"value":19439}," NOT",{"type":23,"tag":2161,"props":19441,"children":19442},{"style":5948},[19443],{"type":28,"value":19444}," EXISTS",{"type":23,"tag":2161,"props":19446,"children":19447},{"style":5844},[19448],{"type":28,"value":19449}," test",{"type":23,"tag":2161,"props":19451,"children":19452},{"style":5830},[19453],{"type":28,"value":19454},".",{"type":23,"tag":2161,"props":19456,"children":19457},{"style":5844},[19458],{"type":28,"value":19459},"omneo",{"type":23,"tag":2161,"props":19461,"children":19462},{"style":5830},[19463],{"type":28,"value":19464},"(\n",{"type":23,"tag":2161,"props":19466,"children":19467},{"class":2163,"line":2190},[19468,19473,19478,19482,19487,19491,19496],{"type":23,"tag":2161,"props":19469,"children":19470},{"style":5830},[19471],{"type":28,"value":19472},"    pid ",{"type":23,"tag":2161,"props":19474,"children":19475},{"style":5948},[19476],{"type":28,"value":19477},"int",{"type":23,"tag":2161,"props":19479,"children":19480},{"style":5830},[19481],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19483,"children":19484},{"style":5844},[19485],{"type":28,"value":19486},"11",{"type":23,"tag":2161,"props":19488,"children":19489},{"style":5830},[19490],{"type":28,"value":11049},{"type":23,"tag":2161,"props":19492,"children":19493},{"style":5948},[19494],{"type":28,"value":19495},"NOT NULL",{"type":23,"tag":2161,"props":19497,"children":19498},{"style":5830},[19499],{"type":28,"value":19500}," AUTO_INCREMENT,\n",{"type":23,"tag":2161,"props":19502,"children":19503},{"class":2163,"line":2199},[19504,19509,19514,19518,19522,19526,19530],{"type":23,"tag":2161,"props":19505,"children":19506},{"style":5830},[19507],{"type":28,"value":19508},"    uuid ",{"type":23,"tag":2161,"props":19510,"children":19511},{"style":5948},[19512],{"type":28,"value":19513},"varchar",{"type":23,"tag":2161,"props":19515,"children":19516},{"style":5830},[19517],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19519,"children":19520},{"style":5844},[19521],{"type":28,"value":11446},{"type":23,"tag":2161,"props":19523,"children":19524},{"style":5830},[19525],{"type":28,"value":11049},{"type":23,"tag":2161,"props":19527,"children":19528},{"style":5948},[19529],{"type":28,"value":19495},{"type":23,"tag":2161,"props":19531,"children":19532},{"style":5830},[19533],{"type":28,"value":15751},{"type":23,"tag":2161,"props":19535,"children":19536},{"class":2163,"line":2208},[19537,19542,19546,19550,19555,19559,19564,19569,19574,19579,19584],{"type":23,"tag":2161,"props":19538,"children":19539},{"style":5830},[19540],{"type":28,"value":19541},"    firstname ",{"type":23,"tag":2161,"props":19543,"children":19544},{"style":5948},[19545],{"type":28,"value":19513},{"type":23,"tag":2161,"props":19547,"children":19548},{"style":5830},[19549],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19551,"children":19552},{"style":5844},[19553],{"type":28,"value":19554},"20",{"type":23,"tag":2161,"props":19556,"children":19557},{"style":5830},[19558],{"type":28,"value":11049},{"type":23,"tag":2161,"props":19560,"children":19561},{"style":5948},[19562],{"type":28,"value":19563},"CHARACTER",{"type":23,"tag":2161,"props":19565,"children":19566},{"style":5948},[19567],{"type":28,"value":19568}," SET",{"type":23,"tag":2161,"props":19570,"children":19571},{"style":5830},[19572],{"type":28,"value":19573}," utf8 ",{"type":23,"tag":2161,"props":19575,"children":19576},{"style":5948},[19577],{"type":28,"value":19578},"DEFAULT",{"type":23,"tag":2161,"props":19580,"children":19581},{"style":5948},[19582],{"type":28,"value":19583}," NULL",{"type":23,"tag":2161,"props":19585,"children":19586},{"style":5830},[19587],{"type":28,"value":15751},{"type":23,"tag":2161,"props":19589,"children":19590},{"class":2163,"line":2217},[19591,19596,19600,19604,19608,19612,19616,19620,19624,19628,19632],{"type":23,"tag":2161,"props":19592,"children":19593},{"style":5830},[19594],{"type":28,"value":19595},"    lastname ",{"type":23,"tag":2161,"props":19597,"children":19598},{"style":5948},[19599],{"type":28,"value":19513},{"type":23,"tag":2161,"props":19601,"children":19602},{"style":5830},[19603],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19605,"children":19606},{"style":5844},[19607],{"type":28,"value":19554},{"type":23,"tag":2161,"props":19609,"children":19610},{"style":5830},[19611],{"type":28,"value":11049},{"type":23,"tag":2161,"props":19613,"children":19614},{"style":5948},[19615],{"type":28,"value":19563},{"type":23,"tag":2161,"props":19617,"children":19618},{"style":5948},[19619],{"type":28,"value":19568},{"type":23,"tag":2161,"props":19621,"children":19622},{"style":5830},[19623],{"type":28,"value":19573},{"type":23,"tag":2161,"props":19625,"children":19626},{"style":5948},[19627],{"type":28,"value":19578},{"type":23,"tag":2161,"props":19629,"children":19630},{"style":5948},[19631],{"type":28,"value":19583},{"type":23,"tag":2161,"props":19633,"children":19634},{"style":5830},[19635],{"type":28,"value":15751},{"type":23,"tag":2161,"props":19637,"children":19638},{"class":2163,"line":2226},[19639,19644,19648,19652,19656],{"type":23,"tag":2161,"props":19640,"children":19641},{"style":5830},[19642],{"type":28,"value":19643},"    birthdate ",{"type":23,"tag":2161,"props":19645,"children":19646},{"style":5948},[19647],{"type":28,"value":19513},{"type":23,"tag":2161,"props":19649,"children":19650},{"style":5830},[19651],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19653,"children":19654},{"style":5844},[19655],{"type":28,"value":19554},{"type":23,"tag":2161,"props":19657,"children":19658},{"style":5830},[19659],{"type":28,"value":19660},"),\n",{"type":23,"tag":2161,"props":19662,"children":19663},{"class":2163,"line":2235},[19664,19669,19673,19677,19681],{"type":23,"tag":2161,"props":19665,"children":19666},{"style":5830},[19667],{"type":28,"value":19668},"    postalcode ",{"type":23,"tag":2161,"props":19670,"children":19671},{"style":5948},[19672],{"type":28,"value":19513},{"type":23,"tag":2161,"props":19674,"children":19675},{"style":5830},[19676],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19678,"children":19679},{"style":5844},[19680],{"type":28,"value":19554},{"type":23,"tag":2161,"props":19682,"children":19683},{"style":5830},[19684],{"type":28,"value":19660},{"type":23,"tag":2161,"props":19686,"children":19687},{"class":2163,"line":2244},[19688,19693,19697,19701,19705],{"type":23,"tag":2161,"props":19689,"children":19690},{"style":5830},[19691],{"type":28,"value":19692},"    city ",{"type":23,"tag":2161,"props":19694,"children":19695},{"style":5948},[19696],{"type":28,"value":19513},{"type":23,"tag":2161,"props":19698,"children":19699},{"style":5830},[19700],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19702,"children":19703},{"style":5844},[19704],{"type":28,"value":19554},{"type":23,"tag":2161,"props":19706,"children":19707},{"style":5830},[19708],{"type":28,"value":19660},{"type":23,"tag":2161,"props":19710,"children":19711},{"class":2163,"line":2253},[19712,19717,19721,19725,19729],{"type":23,"tag":2161,"props":19713,"children":19714},{"style":5830},[19715],{"type":28,"value":19716},"    sexe ",{"type":23,"tag":2161,"props":19718,"children":19719},{"style":5948},[19720],{"type":28,"value":19513},{"type":23,"tag":2161,"props":19722,"children":19723},{"style":5830},[19724],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19726,"children":19727},{"style":5844},[19728],{"type":28,"value":19554},{"type":23,"tag":2161,"props":19730,"children":19731},{"style":5830},[19732],{"type":28,"value":19660},{"type":23,"tag":2161,"props":19734,"children":19735},{"class":2163,"line":6337},[19736,19741,19746,19750,19754],{"type":23,"tag":2161,"props":19737,"children":19738},{"style":5948},[19739],{"type":28,"value":19740},"    status",{"type":23,"tag":2161,"props":19742,"children":19743},{"style":5948},[19744],{"type":28,"value":19745}," varchar",{"type":23,"tag":2161,"props":19747,"children":19748},{"style":5830},[19749],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19751,"children":19752},{"style":5844},[19753],{"type":28,"value":19554},{"type":23,"tag":2161,"props":19755,"children":19756},{"style":5830},[19757],{"type":28,"value":19660},{"type":23,"tag":2161,"props":19759,"children":19760},{"class":2163,"line":6365},[19761,19766,19771,19776,19781],{"type":23,"tag":2161,"props":19762,"children":19763},{"style":5830},[19764],{"type":28,"value":19765},"    commenttime ",{"type":23,"tag":2161,"props":19767,"children":19768},{"style":5948},[19769],{"type":28,"value":19770},"timestamp",{"type":23,"tag":2161,"props":19772,"children":19773},{"style":5948},[19774],{"type":28,"value":19775}," NOT NULL",{"type":23,"tag":2161,"props":19777,"children":19778},{"style":5948},[19779],{"type":28,"value":19780}," DEFAULT",{"type":23,"tag":2161,"props":19782,"children":19783},{"style":5830},[19784],{"type":28,"value":19785}," current_timestamp,\n",{"type":23,"tag":2161,"props":19787,"children":19788},{"class":2163,"line":6405},[19789,19794],{"type":23,"tag":2161,"props":19790,"children":19791},{"style":5948},[19792],{"type":28,"value":19793},"    PRIMARY KEY",{"type":23,"tag":2161,"props":19795,"children":19796},{"style":5830},[19797],{"type":28,"value":19798}," (pid)\n",{"type":23,"tag":2161,"props":19800,"children":19802},{"class":2163,"line":19801},15,[19803,19808,19812,19817,19821,19826,19830],{"type":23,"tag":2161,"props":19804,"children":19805},{"style":5830},[19806],{"type":28,"value":19807},")ENGINE",{"type":23,"tag":2161,"props":19809,"children":19810},{"style":5948},[19811],{"type":28,"value":6258},{"type":23,"tag":2161,"props":19813,"children":19814},{"style":5830},[19815],{"type":28,"value":19816},"InnoDB ",{"type":23,"tag":2161,"props":19818,"children":19819},{"style":5948},[19820],{"type":28,"value":19578},{"type":23,"tag":2161,"props":19822,"children":19823},{"style":5830},[19824],{"type":28,"value":19825}," CHARSET",{"type":23,"tag":2161,"props":19827,"children":19828},{"style":5948},[19829],{"type":28,"value":6258},{"type":23,"tag":2161,"props":19831,"children":19832},{"style":5830},[19833],{"type":28,"value":19834},"utf8;\n",{"type":23,"tag":2161,"props":19836,"children":19838},{"class":2163,"line":19837},16,[19839],{"type":23,"tag":2161,"props":19840,"children":19841},{"emptyLinePlaceholder":2176},[19842],{"type":28,"value":2179},{"type":23,"tag":2161,"props":19844,"children":19846},{"class":2163,"line":19845},17,[19847,19852,19856],{"type":23,"tag":2161,"props":19848,"children":19849},{"style":5830},[19850],{"type":28,"value":19851},"# 插入 ",{"type":23,"tag":2161,"props":19853,"children":19854},{"style":5844},[19855],{"type":28,"value":3710},{"type":23,"tag":2161,"props":19857,"children":19858},{"style":5830},[19859],{"type":28,"value":19860}," 条测试数据\n",{"type":23,"tag":2161,"props":19862,"children":19864},{"class":2163,"line":19863},18,[19865,19870,19875,19880,19884,19888,19893,19898,19902,19907,19911,19916,19920,19925,19929,19934,19938,19943,19947,19952,19956,19961,19965,19970],{"type":23,"tag":2161,"props":19866,"children":19867},{"style":5948},[19868],{"type":28,"value":19869},"insert into",{"type":23,"tag":2161,"props":19871,"children":19872},{"style":5830},[19873],{"type":28,"value":19874}," omneo ",{"type":23,"tag":2161,"props":19876,"children":19877},{"style":5948},[19878],{"type":28,"value":19879},"values",{"type":23,"tag":2161,"props":19881,"children":19882},{"style":5830},[19883],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19885,"children":19886},{"style":5844},[19887],{"type":28,"value":3641},{"type":23,"tag":2161,"props":19889,"children":19890},{"style":5830},[19891],{"type":28,"value":19892},",",{"type":23,"tag":2161,"props":19894,"children":19895},{"style":5855},[19896],{"type":28,"value":19897},"\"0049683542a7-5bdb-d564-3133-276ae3ce\"",{"type":23,"tag":2161,"props":19899,"children":19900},{"style":5830},[19901],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19903,"children":19904},{"style":5855},[19905],{"type":28,"value":19906},"\"Maurice\"",{"type":23,"tag":2161,"props":19908,"children":19909},{"style":5830},[19910],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19912,"children":19913},{"style":5855},[19914],{"type":28,"value":19915},"\"Samuel\"",{"type":23,"tag":2161,"props":19917,"children":19918},{"style":5830},[19919],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19921,"children":19922},{"style":5855},[19923],{"type":28,"value":19924},"\"01\u002F11\u002F1977\"",{"type":23,"tag":2161,"props":19926,"children":19927},{"style":5830},[19928],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19930,"children":19931},{"style":5855},[19932],{"type":28,"value":19933},"\"H2M2V5\"",{"type":23,"tag":2161,"props":19935,"children":19936},{"style":5830},[19937],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19939,"children":19940},{"style":5855},[19941],{"type":28,"value":19942},"\"Ballancourt\"",{"type":23,"tag":2161,"props":19944,"children":19945},{"style":5830},[19946],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19948,"children":19949},{"style":5855},[19950],{"type":28,"value":19951},"\"male\"",{"type":23,"tag":2161,"props":19953,"children":19954},{"style":5830},[19955],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19957,"children":19958},{"style":5855},[19959],{"type":28,"value":19960},"\"en couple\"",{"type":23,"tag":2161,"props":19962,"children":19963},{"style":5830},[19964],{"type":28,"value":19892},{"type":23,"tag":2161,"props":19966,"children":19967},{"style":5855},[19968],{"type":28,"value":19969},"\"2020-05-09 11:01:54\"",{"type":23,"tag":2161,"props":19971,"children":19972},{"style":5830},[19973],{"type":28,"value":10626},{"type":23,"tag":2161,"props":19975,"children":19977},{"class":2163,"line":19976},19,[19978,19982,19986,19990,19994,19998,20002,20007,20011,20016,20020,20025,20029,20034,20038,20043,20047,20052,20056,20061,20065,20070,20074,20078],{"type":23,"tag":2161,"props":19979,"children":19980},{"style":5948},[19981],{"type":28,"value":19869},{"type":23,"tag":2161,"props":19983,"children":19984},{"style":5830},[19985],{"type":28,"value":19874},{"type":23,"tag":2161,"props":19987,"children":19988},{"style":5948},[19989],{"type":28,"value":19879},{"type":23,"tag":2161,"props":19991,"children":19992},{"style":5830},[19993],{"type":28,"value":10486},{"type":23,"tag":2161,"props":19995,"children":19996},{"style":5844},[19997],{"type":28,"value":3664},{"type":23,"tag":2161,"props":19999,"children":20000},{"style":5830},[20001],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20003,"children":20004},{"style":5855},[20005],{"type":28,"value":20006},"\"8338623542a7-5bdb-d564-3133-276ae3ce\"",{"type":23,"tag":2161,"props":20008,"children":20009},{"style":5830},[20010],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20012,"children":20013},{"style":5855},[20014],{"type":28,"value":20015},"\"Gauthier\"",{"type":23,"tag":2161,"props":20017,"children":20018},{"style":5830},[20019],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20021,"children":20022},{"style":5855},[20023],{"type":28,"value":20024},"\"Garbuet\"",{"type":23,"tag":2161,"props":20026,"children":20027},{"style":5830},[20028],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20030,"children":20031},{"style":5855},[20032],{"type":28,"value":20033},"\"23\u002F05\u002F1965\"",{"type":23,"tag":2161,"props":20035,"children":20036},{"style":5830},[20037],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20039,"children":20040},{"style":5855},[20041],{"type":28,"value":20042},"\"05274\"",{"type":23,"tag":2161,"props":20044,"children":20045},{"style":5830},[20046],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20048,"children":20049},{"style":5855},[20050],{"type":28,"value":20051},"\"Cocagne\"",{"type":23,"tag":2161,"props":20053,"children":20054},{"style":5830},[20055],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20057,"children":20058},{"style":5855},[20059],{"type":28,"value":20060},"\"female\"",{"type":23,"tag":2161,"props":20062,"children":20063},{"style":5830},[20064],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20066,"children":20067},{"style":5855},[20068],{"type":28,"value":20069},"\"maried\"",{"type":23,"tag":2161,"props":20071,"children":20072},{"style":5830},[20073],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20075,"children":20076},{"style":5855},[20077],{"type":28,"value":19969},{"type":23,"tag":2161,"props":20079,"children":20080},{"style":5830},[20081],{"type":28,"value":10626},{"type":23,"tag":2161,"props":20083,"children":20085},{"class":2163,"line":20084},20,[20086,20090,20094,20098,20102,20106,20110,20115,20119,20123,20127,20131,20135,20139,20143,20148,20152,20157,20161,20165,20169,20173,20177,20181],{"type":23,"tag":2161,"props":20087,"children":20088},{"style":5948},[20089],{"type":28,"value":19869},{"type":23,"tag":2161,"props":20091,"children":20092},{"style":5830},[20093],{"type":28,"value":19874},{"type":23,"tag":2161,"props":20095,"children":20096},{"style":5948},[20097],{"type":28,"value":19879},{"type":23,"tag":2161,"props":20099,"children":20100},{"style":5830},[20101],{"type":28,"value":10486},{"type":23,"tag":2161,"props":20103,"children":20104},{"style":5844},[20105],{"type":28,"value":3687},{"type":23,"tag":2161,"props":20107,"children":20108},{"style":5830},[20109],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20111,"children":20112},{"style":5855},[20113],{"type":28,"value":20114},"\"3374573542a7-5bdb-d564-3133-276ae3ce\"",{"type":23,"tag":2161,"props":20116,"children":20117},{"style":5830},[20118],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20120,"children":20121},{"style":5855},[20122],{"type":28,"value":19906},{"type":23,"tag":2161,"props":20124,"children":20125},{"style":5830},[20126],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20128,"children":20129},{"style":5855},[20130],{"type":28,"value":19915},{"type":23,"tag":2161,"props":20132,"children":20133},{"style":5830},[20134],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20136,"children":20137},{"style":5855},[20138],{"type":28,"value":19924},{"type":23,"tag":2161,"props":20140,"children":20141},{"style":5830},[20142],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20144,"children":20145},{"style":5855},[20146],{"type":28,"value":20147},"\"H0H0H0\"",{"type":23,"tag":2161,"props":20149,"children":20150},{"style":5830},[20151],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20153,"children":20154},{"style":5855},[20155],{"type":28,"value":20156},"\"Ottawa\"",{"type":23,"tag":2161,"props":20158,"children":20159},{"style":5830},[20160],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20162,"children":20163},{"style":5855},[20164],{"type":28,"value":19951},{"type":23,"tag":2161,"props":20166,"children":20167},{"style":5830},[20168],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20170,"children":20171},{"style":5855},[20172],{"type":28,"value":19960},{"type":23,"tag":2161,"props":20174,"children":20175},{"style":5830},[20176],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20178,"children":20179},{"style":5855},[20180],{"type":28,"value":19969},{"type":23,"tag":2161,"props":20182,"children":20183},{"style":5830},[20184],{"type":28,"value":10626},{"type":23,"tag":2161,"props":20186,"children":20188},{"class":2163,"line":20187},21,[20189,20193,20197,20201,20205,20209,20213,20218,20222,20227,20231,20235,20239,20243,20247,20251,20255,20260,20264,20269,20273,20278,20282,20286],{"type":23,"tag":2161,"props":20190,"children":20191},{"style":5948},[20192],{"type":28,"value":19869},{"type":23,"tag":2161,"props":20194,"children":20195},{"style":5830},[20196],{"type":28,"value":19874},{"type":23,"tag":2161,"props":20198,"children":20199},{"style":5948},[20200],{"type":28,"value":19879},{"type":23,"tag":2161,"props":20202,"children":20203},{"style":5830},[20204],{"type":28,"value":10486},{"type":23,"tag":2161,"props":20206,"children":20207},{"style":5844},[20208],{"type":28,"value":3710},{"type":23,"tag":2161,"props":20210,"children":20211},{"style":5830},[20212],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20214,"children":20215},{"style":5855},[20216],{"type":28,"value":20217},"\"5494133542a7-5bdb-d564-3133-276ae3ce\"",{"type":23,"tag":2161,"props":20219,"children":20220},{"style":5830},[20221],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20223,"children":20224},{"style":5855},[20225],{"type":28,"value":20226},"\"Nicole\"",{"type":23,"tag":2161,"props":20228,"children":20229},{"style":5830},[20230],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20232,"children":20233},{"style":5855},[20234],{"type":28,"value":20024},{"type":23,"tag":2161,"props":20236,"children":20237},{"style":5830},[20238],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20240,"children":20241},{"style":5855},[20242],{"type":28,"value":19924},{"type":23,"tag":2161,"props":20244,"children":20245},{"style":5830},[20246],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20248,"children":20249},{"style":5855},[20250],{"type":28,"value":20147},{"type":23,"tag":2161,"props":20252,"children":20253},{"style":5830},[20254],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20256,"children":20257},{"style":5855},[20258],{"type":28,"value":20259},"\"Maugio\"",{"type":23,"tag":2161,"props":20261,"children":20262},{"style":5830},[20263],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20265,"children":20266},{"style":5855},[20267],{"type":28,"value":20268},"\"unknown\"",{"type":23,"tag":2161,"props":20270,"children":20271},{"style":5830},[20272],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20274,"children":20275},{"style":5855},[20276],{"type":28,"value":20277},"\"single\"",{"type":23,"tag":2161,"props":20279,"children":20280},{"style":5830},[20281],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20283,"children":20284},{"style":5855},[20285],{"type":28,"value":19969},{"type":23,"tag":2161,"props":20287,"children":20288},{"style":5830},[20289],{"type":28,"value":10626},{"type":23,"tag":2161,"props":20291,"children":20293},{"class":2163,"line":20292},22,[20294],{"type":23,"tag":2161,"props":20295,"children":20296},{"emptyLinePlaceholder":2176},[20297],{"type":28,"value":2179},{"type":23,"tag":2161,"props":20299,"children":20301},{"class":2163,"line":20300},23,[20302],{"type":23,"tag":2161,"props":20303,"children":20304},{"style":5830},[20305],{"type":28,"value":20306},"# 更新测试数据\n",{"type":23,"tag":2161,"props":20308,"children":20310},{"class":2163,"line":20309},24,[20311,20316,20320,20324,20329,20333,20338,20343,20347,20352,20357,20362,20367,20371,20375,20379,20383],{"type":23,"tag":2161,"props":20312,"children":20313},{"style":5948},[20314],{"type":28,"value":20315},"update",{"type":23,"tag":2161,"props":20317,"children":20318},{"style":5830},[20319],{"type":28,"value":19874},{"type":23,"tag":2161,"props":20321,"children":20322},{"style":5948},[20323],{"type":28,"value":17812},{"type":23,"tag":2161,"props":20325,"children":20326},{"style":5830},[20327],{"type":28,"value":20328}," firstname ",{"type":23,"tag":2161,"props":20330,"children":20331},{"style":5948},[20332],{"type":28,"value":6258},{"type":23,"tag":2161,"props":20334,"children":20335},{"style":5855},[20336],{"type":28,"value":20337}," \"world\"",{"type":23,"tag":2161,"props":20339,"children":20340},{"style":5830},[20341],{"type":28,"value":20342}," ,commenttime",{"type":23,"tag":2161,"props":20344,"children":20345},{"style":5948},[20346],{"type":28,"value":6258},{"type":23,"tag":2161,"props":20348,"children":20349},{"style":5855},[20350],{"type":28,"value":20351},"\"2020-12-20 15:55:10\"",{"type":23,"tag":2161,"props":20353,"children":20354},{"style":5948},[20355],{"type":28,"value":20356}," where",{"type":23,"tag":2161,"props":20358,"children":20359},{"style":5830},[20360],{"type":28,"value":20361}," pid ",{"type":23,"tag":2161,"props":20363,"children":20364},{"style":5948},[20365],{"type":28,"value":20366},"in",{"type":23,"tag":2161,"props":20368,"children":20369},{"style":5830},[20370],{"type":28,"value":10486},{"type":23,"tag":2161,"props":20372,"children":20373},{"style":5844},[20374],{"type":28,"value":3664},{"type":23,"tag":2161,"props":20376,"children":20377},{"style":5830},[20378],{"type":28,"value":19892},{"type":23,"tag":2161,"props":20380,"children":20381},{"style":5844},[20382],{"type":28,"value":3710},{"type":23,"tag":2161,"props":20384,"children":20385},{"style":5830},[20386],{"type":28,"value":10626},{"type":23,"tag":2161,"props":20388,"children":20390},{"class":2163,"line":20389},25,[20391],{"type":23,"tag":2161,"props":20392,"children":20393},{"style":5830},[20394],{"type":28,"value":20395},"# 删除测试数据\n",{"type":23,"tag":2161,"props":20397,"children":20399},{"class":2163,"line":20398},26,[20400,20405,20410,20414,20418,20422,20426,20430],{"type":23,"tag":2161,"props":20401,"children":20402},{"style":5948},[20403],{"type":28,"value":20404},"delete",{"type":23,"tag":2161,"props":20406,"children":20407},{"style":5948},[20408],{"type":28,"value":20409}," from",{"type":23,"tag":2161,"props":20411,"children":20412},{"style":5830},[20413],{"type":28,"value":19874},{"type":23,"tag":2161,"props":20415,"children":20416},{"style":5948},[20417],{"type":28,"value":16256},{"type":23,"tag":2161,"props":20419,"children":20420},{"style":5830},[20421],{"type":28,"value":20361},{"type":23,"tag":2161,"props":20423,"children":20424},{"style":5948},[20425],{"type":28,"value":6258},{"type":23,"tag":2161,"props":20427,"children":20428},{"style":5844},[20429],{"type":28,"value":6175},{"type":23,"tag":2161,"props":20431,"children":20432},{"style":5830},[20433],{"type":28,"value":20434},";\n",{"type":23,"tag":24,"props":20436,"children":20437},{},[20438],{"type":23,"tag":65,"props":20439,"children":20441},{"alt":8,"src":20440},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-d113eca607421a19.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":20443,"children":20444},{},[20445,20447,20452,20454,20459,20460,20465,20467,20473,20475,20480,20482,20487],{"type":28,"value":20446},"可见 ",{"type":23,"tag":99,"props":20448,"children":20450},{"className":20449},[],[20451],{"type":28,"value":5285},{"type":28,"value":20453}," 的名为 ",{"type":23,"tag":99,"props":20455,"children":20457},{"className":20456},[],[20458],{"type":28,"value":10068},{"type":28,"value":9348},{"type":23,"tag":99,"props":20461,"children":20463},{"className":20462},[],[20464],{"type":28,"value":19236},{"type":28,"value":20466}," 已经写入了对应的结构化 ",{"type":23,"tag":99,"props":20468,"children":20470},{"className":20469},[],[20471],{"type":28,"value":20472},"binlog",{"type":28,"value":20474}," 事件数据，可以编写消费者监听 ",{"type":23,"tag":99,"props":20476,"children":20478},{"className":20477},[],[20479],{"type":28,"value":5285},{"type":28,"value":20481}," 对应的 ",{"type":23,"tag":99,"props":20483,"children":20485},{"className":20484},[],[20486],{"type":28,"value":19236},{"type":28,"value":20488}," 然后对获取到的数据进行后续处理。",{"type":23,"tag":50,"props":20490,"children":20491},{"id":17880},[20492],{"type":28,"value":17880},{"type":23,"tag":24,"props":20494,"children":20495},{},[20496,20498,20503,20505,20510,20512,20518],{"type":28,"value":20497},"这篇文章大部分篇幅用于介绍其他中间件是怎么部署的，这个问题侧面说明了 ",{"type":23,"tag":99,"props":20499,"children":20501},{"className":20500},[],[20502],{"type":28,"value":18424},{"type":28,"value":20504}," 本身部署并不复杂，它的配置文件属性项比较多，但是实际上需要自定义和改动的配置项是比较少的，也就是说明了它的运维成本和学习成本并不高。后面会分析基于结构化 ",{"type":23,"tag":99,"props":20506,"children":20508},{"className":20507},[],[20509],{"type":28,"value":20472},{"type":28,"value":20511}," 事件做 ",{"type":23,"tag":99,"props":20513,"children":20515},{"className":20514},[],[20516],{"type":28,"value":20517},"ELT",{"type":28,"value":20519}," 和持久化相关工作以及Canal的生产环境可用级别HA集群的搭建。",{"type":23,"tag":24,"props":20521,"children":20522},{},[20523],{"type":28,"value":20524},"参考资料：",{"type":23,"tag":399,"props":20526,"children":20527},{},[20528,20538],{"type":23,"tag":403,"props":20529,"children":20530},{},[20531],{"type":23,"tag":41,"props":20532,"children":20535},{"href":20533,"rel":20534},"https:\u002F\u002Fdev.mysql.com\u002Fdoc\u002Fmysql-yum-repo-quick-guide\u002Fen\u002F",[963],[20536],{"type":28,"value":20537},"A Quick Guide to Using the MySQL Yum Repository",{"type":23,"tag":403,"props":20539,"children":20540},{},[20541],{"type":23,"tag":41,"props":20542,"children":20545},{"href":20543,"rel":20544},"https:\u002F\u002Fgithub.com\u002Falibaba\u002Fcanal",[963],[20546],{"type":28,"value":18424},{"type":23,"tag":2730,"props":20548,"children":20549},{},[20550],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":20552},[20553,20554,20555,20556,20557,20558,20562,20563,20564,20565],{"id":17908,"depth":927,"text":17908},{"id":18453,"depth":927,"text":18456},{"id":18459,"depth":927,"text":18459},{"id":18515,"depth":927,"text":18515},{"id":18616,"depth":927,"text":18616},{"id":18653,"depth":927,"text":18656,"children":20559},[20560,20561],{"id":18659,"depth":924,"text":18662},{"id":18670,"depth":924,"text":18673},{"id":18681,"depth":927,"text":18684},{"id":18692,"depth":927,"text":18695},{"id":18703,"depth":927,"text":18706},{"id":17880,"depth":927,"text":17880},"content:blog:2020-05-12-canal-kafka-mysql.md","blog\u002F2020-05-12-canal-kafka-mysql.md","blog\u002F2020-05-12-canal-kafka-mysql",{"_path":20570,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":20571,"description":20572,"date":18422,"tags":20573,"cover":20574,"source":20575,"body":20576,"_type":937,"_id":21517,"_source":939,"_file":21518,"_stem":21519,"_extension":942},"\u002Fblog\u002F2020-05-12-centos-mysql57","Centos 7.3 安装 MySQL 5.7","完整的 CentOS 7.3 安装 MySQL 5.7 教程，包括下载、安装、密码策略修改、远程访问设置及字符编码配置。",[16717,16718,18425,5718],"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-e45bda7519cf3b87.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Fa4a804d978da",{"type":20,"children":20577,"toc":21515},[20578,20586,20616,20623,20628,20658,20665,20673,20700,20707,20712,20720,20967,20972,20997,21005,21028,21035,21057,21064,21111,21118,21126,21134,21195,21199,21220,21228,21321,21326,21349,21357,21407,21415,21444,21451,21456,21486,21490,21511],{"type":23,"tag":890,"props":20579,"children":20580},{},[20581],{"type":23,"tag":403,"props":20582,"children":20583},{},[20584],{"type":28,"value":20585},"下载并安装MySQL官方的 Yum Repository",{"type":23,"tag":2152,"props":20587,"children":20591},{"className":20588,"code":20589,"language":20590,"meta":8,"style":8},"language-shell shiki shiki-themes github-light github-dark","wget -i -c http:\u002F\u002Fdev.mysql.com\u002Fget\u002Fmysql57-community-release-el7-10.noarch.rpm\n","shell",[20592],{"type":23,"tag":99,"props":20593,"children":20594},{"__ignoreMap":8},[20595],{"type":23,"tag":2161,"props":20596,"children":20597},{"class":2163,"line":2164},[20598,20602,20607,20611],{"type":23,"tag":2161,"props":20599,"children":20600},{"style":5824},[20601],{"type":28,"value":18766},{"type":23,"tag":2161,"props":20603,"children":20604},{"style":5844},[20605],{"type":28,"value":20606}," -i",{"type":23,"tag":2161,"props":20608,"children":20609},{"style":5844},[20610],{"type":28,"value":10015},{"type":23,"tag":2161,"props":20612,"children":20613},{"style":5855},[20614],{"type":28,"value":20615}," http:\u002F\u002Fdev.mysql.com\u002Fget\u002Fmysql57-community-release-el7-10.noarch.rpm\n",{"type":23,"tag":24,"props":20617,"children":20618},{},[20619],{"type":23,"tag":65,"props":20620,"children":20622},{"alt":8,"src":20621},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-e45bda7519cf3b87.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":20624,"children":20625},{},[20626],{"type":28,"value":20627},"使用上面的命令就直接下载了安装用的Yum Repository，大概25KB的样子，然后就可以直接yum安装了。",{"type":23,"tag":2152,"props":20629,"children":20631},{"className":20588,"code":20630,"language":20590,"meta":8,"style":8},"yum -y install mysql57-community-release-el7-10.noarch.rpm\n",[20632],{"type":23,"tag":99,"props":20633,"children":20634},{"__ignoreMap":8},[20635],{"type":23,"tag":2161,"props":20636,"children":20637},{"class":2163,"line":2164},[20638,20643,20648,20653],{"type":23,"tag":2161,"props":20639,"children":20640},{"style":5824},[20641],{"type":28,"value":20642},"yum",{"type":23,"tag":2161,"props":20644,"children":20645},{"style":5844},[20646],{"type":28,"value":20647}," -y",{"type":23,"tag":2161,"props":20649,"children":20650},{"style":5855},[20651],{"type":28,"value":20652}," install",{"type":23,"tag":2161,"props":20654,"children":20655},{"style":5855},[20656],{"type":28,"value":20657}," mysql57-community-release-el7-10.noarch.rpm\n",{"type":23,"tag":24,"props":20659,"children":20660},{},[20661],{"type":23,"tag":65,"props":20662,"children":20664},{"alt":8,"src":20663},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-89ab0131d9c4ec7f.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":20666,"children":20667},{"start":927},[20668],{"type":23,"tag":403,"props":20669,"children":20670},{},[20671],{"type":28,"value":20672},"安装 MySQL 服务",{"type":23,"tag":2152,"props":20674,"children":20676},{"className":20588,"code":20675,"language":20590,"meta":8,"style":8},"yum -y install mysql-community-server\n",[20677],{"type":23,"tag":99,"props":20678,"children":20679},{"__ignoreMap":8},[20680],{"type":23,"tag":2161,"props":20681,"children":20682},{"class":2163,"line":2164},[20683,20687,20691,20695],{"type":23,"tag":2161,"props":20684,"children":20685},{"style":5824},[20686],{"type":28,"value":20642},{"type":23,"tag":2161,"props":20688,"children":20689},{"style":5844},[20690],{"type":28,"value":20647},{"type":23,"tag":2161,"props":20692,"children":20693},{"style":5855},[20694],{"type":28,"value":20652},{"type":23,"tag":2161,"props":20696,"children":20697},{"style":5855},[20698],{"type":28,"value":20699}," mysql-community-server\n",{"type":23,"tag":24,"props":20701,"children":20702},{},[20703],{"type":23,"tag":65,"props":20704,"children":20706},{"alt":8,"src":20705},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-4f1347bae5c9905a.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":20708,"children":20709},{},[20710],{"type":28,"value":20711},"这个过程比较漫长.....",{"type":23,"tag":890,"props":20713,"children":20714},{"start":924},[20715],{"type":23,"tag":403,"props":20716,"children":20717},{},[20718],{"type":28,"value":20719},"MySQL 配置",{"type":23,"tag":2152,"props":20721,"children":20725},{"className":20722,"code":20723,"language":20724,"meta":8,"style":8},"language-ini shiki shiki-themes github-light github-dark","# For advice on how to change settings please see\n# http:\u002F\u002Fdev.mysql.com\u002Fdoc\u002Frefman\u002F5.7\u002Fen\u002Fserver-configuration-defaults.html\n\n[mysqld]\n#\n# Remove leading # and set to the amount of RAM for the most important data\n# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.\n# innodb_buffer_pool_size = 128M\n#\n# Remove leading # to turn on a very important data integrity option: logging\n# changes to the binary log between backups.\n# log_bin\n#\n# Remove leading # to set options mainly useful for reporting servers.\n# The server defaults are faster for transactions and fast SELECTs.\n# Adjust sizes as needed, experiment to find the optimal values.\n# join_buffer_size = 128M\n# sort_buffer_size = 2M\n# read_rnd_buffer_size = 2M\ndatadir=\u002Fvar\u002Flib\u002Fmysql\nsocket=\u002Fvar\u002Flib\u002Fmysql\u002Fmysql.sock\n\n# 绑定 ip\nbind-address=0.0.0.0\n\n# Disabling symbolic-links is recommended to prevent assorted security risks\nsymbolic-links=0\n\nlog-error=\u002Fvar\u002Flog\u002Fmysqld.log\npid-file=\u002Fvar\u002Frun\u002Fmysqld\u002Fmysqld.pid\n","ini",[20726],{"type":23,"tag":99,"props":20727,"children":20728},{"__ignoreMap":8},[20729,20737,20745,20752,20760,20768,20776,20784,20792,20799,20807,20815,20823,20830,20838,20846,20854,20862,20870,20878,20886,20894,20901,20909,20917,20924,20932,20941,20949,20958],{"type":23,"tag":2161,"props":20730,"children":20731},{"class":2163,"line":2164},[20732],{"type":23,"tag":2161,"props":20733,"children":20734},{},[20735],{"type":28,"value":20736},"# For advice on how to change settings please see\n",{"type":23,"tag":2161,"props":20738,"children":20739},{"class":2163,"line":927},[20740],{"type":23,"tag":2161,"props":20741,"children":20742},{},[20743],{"type":28,"value":20744},"# http:\u002F\u002Fdev.mysql.com\u002Fdoc\u002Frefman\u002F5.7\u002Fen\u002Fserver-configuration-defaults.html\n",{"type":23,"tag":2161,"props":20746,"children":20747},{"class":2163,"line":924},[20748],{"type":23,"tag":2161,"props":20749,"children":20750},{"emptyLinePlaceholder":2176},[20751],{"type":28,"value":2179},{"type":23,"tag":2161,"props":20753,"children":20754},{"class":2163,"line":2190},[20755],{"type":23,"tag":2161,"props":20756,"children":20757},{},[20758],{"type":28,"value":20759},"[mysqld]\n",{"type":23,"tag":2161,"props":20761,"children":20762},{"class":2163,"line":2199},[20763],{"type":23,"tag":2161,"props":20764,"children":20765},{},[20766],{"type":28,"value":20767},"#\n",{"type":23,"tag":2161,"props":20769,"children":20770},{"class":2163,"line":2208},[20771],{"type":23,"tag":2161,"props":20772,"children":20773},{},[20774],{"type":28,"value":20775},"# Remove leading # and set to the amount of RAM for the most important data\n",{"type":23,"tag":2161,"props":20777,"children":20778},{"class":2163,"line":2217},[20779],{"type":23,"tag":2161,"props":20780,"children":20781},{},[20782],{"type":28,"value":20783},"# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.\n",{"type":23,"tag":2161,"props":20785,"children":20786},{"class":2163,"line":2226},[20787],{"type":23,"tag":2161,"props":20788,"children":20789},{},[20790],{"type":28,"value":20791},"# innodb_buffer_pool_size = 128M\n",{"type":23,"tag":2161,"props":20793,"children":20794},{"class":2163,"line":2235},[20795],{"type":23,"tag":2161,"props":20796,"children":20797},{},[20798],{"type":28,"value":20767},{"type":23,"tag":2161,"props":20800,"children":20801},{"class":2163,"line":2244},[20802],{"type":23,"tag":2161,"props":20803,"children":20804},{},[20805],{"type":28,"value":20806},"# Remove leading # to turn on a very important data integrity option: logging\n",{"type":23,"tag":2161,"props":20808,"children":20809},{"class":2163,"line":2253},[20810],{"type":23,"tag":2161,"props":20811,"children":20812},{},[20813],{"type":28,"value":20814},"# changes to the binary log between backups.\n",{"type":23,"tag":2161,"props":20816,"children":20817},{"class":2163,"line":6337},[20818],{"type":23,"tag":2161,"props":20819,"children":20820},{},[20821],{"type":28,"value":20822},"# log_bin\n",{"type":23,"tag":2161,"props":20824,"children":20825},{"class":2163,"line":6365},[20826],{"type":23,"tag":2161,"props":20827,"children":20828},{},[20829],{"type":28,"value":20767},{"type":23,"tag":2161,"props":20831,"children":20832},{"class":2163,"line":6405},[20833],{"type":23,"tag":2161,"props":20834,"children":20835},{},[20836],{"type":28,"value":20837},"# Remove leading # to set options mainly useful for reporting servers.\n",{"type":23,"tag":2161,"props":20839,"children":20840},{"class":2163,"line":19801},[20841],{"type":23,"tag":2161,"props":20842,"children":20843},{},[20844],{"type":28,"value":20845},"# The server defaults are faster for transactions and fast SELECTs.\n",{"type":23,"tag":2161,"props":20847,"children":20848},{"class":2163,"line":19837},[20849],{"type":23,"tag":2161,"props":20850,"children":20851},{},[20852],{"type":28,"value":20853},"# Adjust sizes as needed, experiment to find the optimal values.\n",{"type":23,"tag":2161,"props":20855,"children":20856},{"class":2163,"line":19845},[20857],{"type":23,"tag":2161,"props":20858,"children":20859},{},[20860],{"type":28,"value":20861},"# join_buffer_size = 128M\n",{"type":23,"tag":2161,"props":20863,"children":20864},{"class":2163,"line":19863},[20865],{"type":23,"tag":2161,"props":20866,"children":20867},{},[20868],{"type":28,"value":20869},"# sort_buffer_size = 2M\n",{"type":23,"tag":2161,"props":20871,"children":20872},{"class":2163,"line":19976},[20873],{"type":23,"tag":2161,"props":20874,"children":20875},{},[20876],{"type":28,"value":20877},"# read_rnd_buffer_size = 2M\n",{"type":23,"tag":2161,"props":20879,"children":20880},{"class":2163,"line":20084},[20881],{"type":23,"tag":2161,"props":20882,"children":20883},{},[20884],{"type":28,"value":20885},"datadir=\u002Fvar\u002Flib\u002Fmysql\n",{"type":23,"tag":2161,"props":20887,"children":20888},{"class":2163,"line":20187},[20889],{"type":23,"tag":2161,"props":20890,"children":20891},{},[20892],{"type":28,"value":20893},"socket=\u002Fvar\u002Flib\u002Fmysql\u002Fmysql.sock\n",{"type":23,"tag":2161,"props":20895,"children":20896},{"class":2163,"line":20292},[20897],{"type":23,"tag":2161,"props":20898,"children":20899},{"emptyLinePlaceholder":2176},[20900],{"type":28,"value":2179},{"type":23,"tag":2161,"props":20902,"children":20903},{"class":2163,"line":20300},[20904],{"type":23,"tag":2161,"props":20905,"children":20906},{},[20907],{"type":28,"value":20908},"# 绑定 ip\n",{"type":23,"tag":2161,"props":20910,"children":20911},{"class":2163,"line":20309},[20912],{"type":23,"tag":2161,"props":20913,"children":20914},{},[20915],{"type":28,"value":20916},"bind-address=0.0.0.0\n",{"type":23,"tag":2161,"props":20918,"children":20919},{"class":2163,"line":20389},[20920],{"type":23,"tag":2161,"props":20921,"children":20922},{"emptyLinePlaceholder":2176},[20923],{"type":28,"value":2179},{"type":23,"tag":2161,"props":20925,"children":20926},{"class":2163,"line":20398},[20927],{"type":23,"tag":2161,"props":20928,"children":20929},{},[20930],{"type":28,"value":20931},"# Disabling symbolic-links is recommended to prevent assorted security risks\n",{"type":23,"tag":2161,"props":20933,"children":20935},{"class":2163,"line":20934},27,[20936],{"type":23,"tag":2161,"props":20937,"children":20938},{},[20939],{"type":28,"value":20940},"symbolic-links=0\n",{"type":23,"tag":2161,"props":20942,"children":20944},{"class":2163,"line":20943},28,[20945],{"type":23,"tag":2161,"props":20946,"children":20947},{"emptyLinePlaceholder":2176},[20948],{"type":28,"value":2179},{"type":23,"tag":2161,"props":20950,"children":20952},{"class":2163,"line":20951},29,[20953],{"type":23,"tag":2161,"props":20954,"children":20955},{},[20956],{"type":28,"value":20957},"log-error=\u002Fvar\u002Flog\u002Fmysqld.log\n",{"type":23,"tag":2161,"props":20959,"children":20961},{"class":2163,"line":20960},30,[20962],{"type":23,"tag":2161,"props":20963,"children":20964},{},[20965],{"type":28,"value":20966},"pid-file=\u002Fvar\u002Frun\u002Fmysqld\u002Fmysqld.pid\n",{"type":23,"tag":24,"props":20968,"children":20969},{},[20970],{"type":28,"value":20971},"重启mysql服务使配置生效",{"type":23,"tag":2152,"props":20973,"children":20975},{"className":20588,"code":20974,"language":20590,"meta":8,"style":8},"systemctl restart mysqld\n",[20976],{"type":23,"tag":99,"props":20977,"children":20978},{"__ignoreMap":8},[20979],{"type":23,"tag":2161,"props":20980,"children":20981},{"class":2163,"line":2164},[20982,20987,20992],{"type":23,"tag":2161,"props":20983,"children":20984},{"style":5824},[20985],{"type":28,"value":20986},"systemctl",{"type":23,"tag":2161,"props":20988,"children":20989},{"style":5855},[20990],{"type":28,"value":20991}," restart",{"type":23,"tag":2161,"props":20993,"children":20994},{"style":5855},[20995],{"type":28,"value":20996}," mysqld\n",{"type":23,"tag":399,"props":20998,"children":20999},{},[21000],{"type":23,"tag":403,"props":21001,"children":21002},{},[21003],{"type":28,"value":21004},"查看 MySQL 运行状态，运行状态如图：",{"type":23,"tag":2152,"props":21006,"children":21008},{"className":20588,"code":21007,"language":20590,"meta":8,"style":8},"systemctl status mysqld\n",[21009],{"type":23,"tag":99,"props":21010,"children":21011},{"__ignoreMap":8},[21012],{"type":23,"tag":2161,"props":21013,"children":21014},{"class":2163,"line":2164},[21015,21019,21024],{"type":23,"tag":2161,"props":21016,"children":21017},{"style":5824},[21018],{"type":28,"value":20986},{"type":23,"tag":2161,"props":21020,"children":21021},{"style":5855},[21022],{"type":28,"value":21023}," status",{"type":23,"tag":2161,"props":21025,"children":21026},{"style":5855},[21027],{"type":28,"value":20996},{"type":23,"tag":24,"props":21029,"children":21030},{},[21031],{"type":23,"tag":65,"props":21032,"children":21034},{"alt":8,"src":21033},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-eff41e1a4f7dd170.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":399,"props":21036,"children":21037},{},[21038],{"type":23,"tag":403,"props":21039,"children":21040},{},[21041,21043,21049,21051],{"type":28,"value":21042},"查看 ",{"type":23,"tag":99,"props":21044,"children":21046},{"className":21045},[],[21047],{"type":28,"value":21048},"root@localhost",{"type":28,"value":21050}," 密码, ",{"type":23,"tag":99,"props":21052,"children":21054},{"className":21053},[],[21055],{"type":28,"value":21056},"grep \"password\" \u002Fvar\u002Flog\u002Fmysqld.log",{"type":23,"tag":24,"props":21058,"children":21059},{},[21060],{"type":23,"tag":65,"props":21061,"children":21063},{"alt":8,"src":21062},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-ca5f7369dd316da1.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1100\u002Fformat\u002Fwebp",[],{"type":23,"tag":399,"props":21065,"children":21066},{},[21067,21080,21100],{"type":23,"tag":403,"props":21068,"children":21069},{},[21070,21072,21078],{"type":28,"value":21071},"进入数据库 ",{"type":23,"tag":99,"props":21073,"children":21075},{"className":21074},[],[21076],{"type":28,"value":21077},"mysql -u root -p",{"type":28,"value":21079}," ，输入初始密码",{"type":23,"tag":403,"props":21081,"children":21082},{},[21083,21085,21090,21092,21098],{"type":28,"value":21084},"修改 ",{"type":23,"tag":99,"props":21086,"children":21088},{"className":21087},[],[21089],{"type":28,"value":21048},{"type":28,"value":21091}," 密码， ",{"type":23,"tag":99,"props":21093,"children":21095},{"className":21094},[],[21096],{"type":28,"value":21097},"ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';",{"type":28,"value":21099},"\n其中'new password'替换成你要设置的密码，注意:密码设置必须要大小写字母数字和特殊符号（,\u002F';:等）,不然不能配置成功，如果要修改为root这样的弱密码，需要进行以下配置：",{"type":23,"tag":403,"props":21101,"children":21102},{},[21103,21105],{"type":28,"value":21104},"查看当前密码策略 ",{"type":23,"tag":99,"props":21106,"children":21108},{"className":21107},[],[21109],{"type":28,"value":21110},"show variables like '%password%';",{"type":23,"tag":24,"props":21112,"children":21113},{},[21114],{"type":23,"tag":65,"props":21115,"children":21117},{"alt":8,"src":21116},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-eee308db62b5f3c8.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1021\u002Fformat\u002Fwebp",[],{"type":23,"tag":17976,"props":21119,"children":21120},{},[21121],{"type":23,"tag":24,"props":21122,"children":21123},{},[21124],{"type":28,"value":21125},"策略说明\nvalidate_password.length 是密码的最小长度，默认是8，我们把它改成6\n输入：set global validate_password.length=6;\nvalidate_password.policy 验证密码的复杂程度，我们把它改成0\n输入：set global validate_password.policy=0;\nvalidate_password.check_user_name 用户名检查，用户名和密码不能相同，我们也把它关掉\n输入：set global validate_password.check_user_name=off;",{"type":23,"tag":399,"props":21127,"children":21128},{},[21129],{"type":23,"tag":403,"props":21130,"children":21131},{},[21132],{"type":28,"value":21133},"修改密码策略\n添加validate_password_policy配置\n选择0（LOW），1（MEDIUM），2（STRONG）其中一种，选择2需要提供密码字典文件",{"type":23,"tag":2152,"props":21135,"children":21137},{"className":20722,"code":21136,"language":20724,"meta":8,"style":8},"[mysqld]\n# ...省略其他配置...\n\n# 添加validate_password_policy配置\nvalidate_password_policy=0\n# 关闭密码策略\nvalidate_password = off\n",[21138],{"type":23,"tag":99,"props":21139,"children":21140},{"__ignoreMap":8},[21141,21148,21156,21163,21171,21179,21187],{"type":23,"tag":2161,"props":21142,"children":21143},{"class":2163,"line":2164},[21144],{"type":23,"tag":2161,"props":21145,"children":21146},{},[21147],{"type":28,"value":20759},{"type":23,"tag":2161,"props":21149,"children":21150},{"class":2163,"line":927},[21151],{"type":23,"tag":2161,"props":21152,"children":21153},{},[21154],{"type":28,"value":21155},"# ...省略其他配置...\n",{"type":23,"tag":2161,"props":21157,"children":21158},{"class":2163,"line":924},[21159],{"type":23,"tag":2161,"props":21160,"children":21161},{"emptyLinePlaceholder":2176},[21162],{"type":28,"value":2179},{"type":23,"tag":2161,"props":21164,"children":21165},{"class":2163,"line":2190},[21166],{"type":23,"tag":2161,"props":21167,"children":21168},{},[21169],{"type":28,"value":21170},"# 添加validate_password_policy配置\n",{"type":23,"tag":2161,"props":21172,"children":21173},{"class":2163,"line":2199},[21174],{"type":23,"tag":2161,"props":21175,"children":21176},{},[21177],{"type":28,"value":21178},"validate_password_policy=0\n",{"type":23,"tag":2161,"props":21180,"children":21181},{"class":2163,"line":2208},[21182],{"type":23,"tag":2161,"props":21183,"children":21184},{},[21185],{"type":28,"value":21186},"# 关闭密码策略\n",{"type":23,"tag":2161,"props":21188,"children":21189},{"class":2163,"line":2217},[21190],{"type":23,"tag":2161,"props":21191,"children":21192},{},[21193],{"type":28,"value":21194},"validate_password = off\n",{"type":23,"tag":24,"props":21196,"children":21197},{},[21198],{"type":28,"value":20971},{"type":23,"tag":2152,"props":21200,"children":21201},{"className":20588,"code":20974,"language":20590,"meta":8,"style":8},[21202],{"type":23,"tag":99,"props":21203,"children":21204},{"__ignoreMap":8},[21205],{"type":23,"tag":2161,"props":21206,"children":21207},{"class":2163,"line":2164},[21208,21212,21216],{"type":23,"tag":2161,"props":21209,"children":21210},{"style":5824},[21211],{"type":28,"value":20986},{"type":23,"tag":2161,"props":21213,"children":21214},{"style":5855},[21215],{"type":28,"value":20991},{"type":23,"tag":2161,"props":21217,"children":21218},{"style":5855},[21219],{"type":28,"value":20996},{"type":23,"tag":890,"props":21221,"children":21222},{"start":2190},[21223],{"type":23,"tag":403,"props":21224,"children":21225},{},[21226],{"type":28,"value":21227},"开启mysql的远程访问\n执行以下命令开启远程访问限制（注意：下面命令开启的IP是 192.168.0.1，如要开启所有的，用%代替IP）：",{"type":23,"tag":2152,"props":21229,"children":21231},{"className":19390,"code":21230,"language":19392,"meta":8,"style":8},"grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option;\n",[21232],{"type":23,"tag":99,"props":21233,"children":21234},{"__ignoreMap":8},[21235],{"type":23,"tag":2161,"props":21236,"children":21237},{"class":2163,"line":2164},[21238,21243,21248,21253,21258,21262,21267,21272,21277,21282,21287,21292,21297,21302,21307,21312,21317],{"type":23,"tag":2161,"props":21239,"children":21240},{"style":5948},[21241],{"type":28,"value":21242},"grant",{"type":23,"tag":2161,"props":21244,"children":21245},{"style":5830},[21246],{"type":28,"value":21247}," all privileges ",{"type":23,"tag":2161,"props":21249,"children":21250},{"style":5948},[21251],{"type":28,"value":21252},"on",{"type":23,"tag":2161,"props":21254,"children":21255},{"style":5948},[21256],{"type":28,"value":21257}," *",{"type":23,"tag":2161,"props":21259,"children":21260},{"style":5830},[21261],{"type":28,"value":19454},{"type":23,"tag":2161,"props":21263,"children":21264},{"style":5948},[21265],{"type":28,"value":21266},"*",{"type":23,"tag":2161,"props":21268,"children":21269},{"style":5948},[21270],{"type":28,"value":21271}," to",{"type":23,"tag":2161,"props":21273,"children":21274},{"style":5855},[21275],{"type":28,"value":21276}," 'root'",{"type":23,"tag":2161,"props":21278,"children":21279},{"style":5830},[21280],{"type":28,"value":21281},"@",{"type":23,"tag":2161,"props":21283,"children":21284},{"style":5855},[21285],{"type":28,"value":21286},"'192.168.0.1'",{"type":23,"tag":2161,"props":21288,"children":21289},{"style":5830},[21290],{"type":28,"value":21291}," identified ",{"type":23,"tag":2161,"props":21293,"children":21294},{"style":5948},[21295],{"type":28,"value":21296},"by",{"type":23,"tag":2161,"props":21298,"children":21299},{"style":5855},[21300],{"type":28,"value":21301}," 'password'",{"type":23,"tag":2161,"props":21303,"children":21304},{"style":5948},[21305],{"type":28,"value":21306}," with",{"type":23,"tag":2161,"props":21308,"children":21309},{"style":5948},[21310],{"type":28,"value":21311}," grant",{"type":23,"tag":2161,"props":21313,"children":21314},{"style":5948},[21315],{"type":28,"value":21316}," option",{"type":23,"tag":2161,"props":21318,"children":21319},{"style":5830},[21320],{"type":28,"value":20434},{"type":23,"tag":24,"props":21322,"children":21323},{},[21324],{"type":28,"value":21325},"然后再输入下面两行命令",{"type":23,"tag":2152,"props":21327,"children":21329},{"className":19390,"code":21328,"language":19392,"meta":8,"style":8},"flush privileges;\nexit;\n",[21330],{"type":23,"tag":99,"props":21331,"children":21332},{"__ignoreMap":8},[21333,21341],{"type":23,"tag":2161,"props":21334,"children":21335},{"class":2163,"line":2164},[21336],{"type":23,"tag":2161,"props":21337,"children":21338},{"style":5830},[21339],{"type":28,"value":21340},"flush privileges;\n",{"type":23,"tag":2161,"props":21342,"children":21343},{"class":2163,"line":927},[21344],{"type":23,"tag":2161,"props":21345,"children":21346},{"style":5830},[21347],{"type":28,"value":21348},"exit;\n",{"type":23,"tag":890,"props":21350,"children":21351},{"start":2199},[21352],{"type":23,"tag":403,"props":21353,"children":21354},{},[21355],{"type":28,"value":21356},"为 firewalld 添加开放端口\n添加mysql端口3306",{"type":23,"tag":2152,"props":21358,"children":21360},{"className":20588,"code":21359,"language":20590,"meta":8,"style":8},"firewall-cmd --zone=public --add-port=3306\u002Ftcp --permanent\n# 重新加载\nfirewall-cmd --reload\n",[21361],{"type":23,"tag":99,"props":21362,"children":21363},{"__ignoreMap":8},[21364,21387,21395],{"type":23,"tag":2161,"props":21365,"children":21366},{"class":2163,"line":2164},[21367,21372,21377,21382],{"type":23,"tag":2161,"props":21368,"children":21369},{"style":5824},[21370],{"type":28,"value":21371},"firewall-cmd",{"type":23,"tag":2161,"props":21373,"children":21374},{"style":5844},[21375],{"type":28,"value":21376}," --zone=public",{"type":23,"tag":2161,"props":21378,"children":21379},{"style":5844},[21380],{"type":28,"value":21381}," --add-port=3306\u002Ftcp",{"type":23,"tag":2161,"props":21383,"children":21384},{"style":5844},[21385],{"type":28,"value":21386}," --permanent\n",{"type":23,"tag":2161,"props":21388,"children":21389},{"class":2163,"line":927},[21390],{"type":23,"tag":2161,"props":21391,"children":21392},{"style":5807},[21393],{"type":28,"value":21394},"# 重新加载\n",{"type":23,"tag":2161,"props":21396,"children":21397},{"class":2163,"line":924},[21398,21402],{"type":23,"tag":2161,"props":21399,"children":21400},{"style":5824},[21401],{"type":28,"value":21371},{"type":23,"tag":2161,"props":21403,"children":21404},{"style":5844},[21405],{"type":28,"value":21406}," --reload\n",{"type":23,"tag":890,"props":21408,"children":21409},{"start":2208},[21410],{"type":23,"tag":403,"props":21411,"children":21412},{},[21413],{"type":28,"value":21414},"修改mysql的字符编码（不修改会产生中文乱码问题）\n显示原来编码：",{"type":23,"tag":2152,"props":21416,"children":21418},{"className":19390,"code":21417,"language":19392,"meta":8,"style":8},"show variables like '%character%';\n",[21419],{"type":23,"tag":99,"props":21420,"children":21421},{"__ignoreMap":8},[21422],{"type":23,"tag":2161,"props":21423,"children":21424},{"class":2163,"line":2164},[21425,21430,21435,21440],{"type":23,"tag":2161,"props":21426,"children":21427},{"style":5830},[21428],{"type":28,"value":21429},"show variables ",{"type":23,"tag":2161,"props":21431,"children":21432},{"style":5948},[21433],{"type":28,"value":21434},"like",{"type":23,"tag":2161,"props":21436,"children":21437},{"style":5855},[21438],{"type":28,"value":21439}," '%character%'",{"type":23,"tag":2161,"props":21441,"children":21442},{"style":5830},[21443],{"type":28,"value":20434},{"type":23,"tag":24,"props":21445,"children":21446},{},[21447],{"type":23,"tag":65,"props":21448,"children":21450},{"alt":8,"src":21449},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-d8183a07edf14f58.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F932\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":21452,"children":21453},{},[21454],{"type":28,"value":21455},"修改\u002Fetc\u002Fmy.cnf",{"type":23,"tag":2152,"props":21457,"children":21459},{"className":20722,"code":21458,"language":20724,"meta":8,"style":8},"[mysqld]\ncharacter_set_server=utf8\ninit_connect='SET NAMES utf8'\n",[21460],{"type":23,"tag":99,"props":21461,"children":21462},{"__ignoreMap":8},[21463,21470,21478],{"type":23,"tag":2161,"props":21464,"children":21465},{"class":2163,"line":2164},[21466],{"type":23,"tag":2161,"props":21467,"children":21468},{},[21469],{"type":28,"value":20759},{"type":23,"tag":2161,"props":21471,"children":21472},{"class":2163,"line":927},[21473],{"type":23,"tag":2161,"props":21474,"children":21475},{},[21476],{"type":28,"value":21477},"character_set_server=utf8\n",{"type":23,"tag":2161,"props":21479,"children":21480},{"class":2163,"line":924},[21481],{"type":23,"tag":2161,"props":21482,"children":21483},{},[21484],{"type":28,"value":21485},"init_connect='SET NAMES utf8'\n",{"type":23,"tag":24,"props":21487,"children":21488},{},[21489],{"type":28,"value":20971},{"type":23,"tag":2152,"props":21491,"children":21492},{"className":20588,"code":20974,"language":20590,"meta":8,"style":8},[21493],{"type":23,"tag":99,"props":21494,"children":21495},{"__ignoreMap":8},[21496],{"type":23,"tag":2161,"props":21497,"children":21498},{"class":2163,"line":2164},[21499,21503,21507],{"type":23,"tag":2161,"props":21500,"children":21501},{"style":5824},[21502],{"type":28,"value":20986},{"type":23,"tag":2161,"props":21504,"children":21505},{"style":5855},[21506],{"type":28,"value":20991},{"type":23,"tag":2161,"props":21508,"children":21509},{"style":5855},[21510],{"type":28,"value":20996},{"type":23,"tag":2730,"props":21512,"children":21513},{},[21514],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":21516},[],"content:blog:2020-05-12-centos-mysql57.md","blog\u002F2020-05-12-centos-mysql57.md","blog\u002F2020-05-12-centos-mysql57",{"_path":21521,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":21522,"description":21523,"date":18422,"tags":21524,"cover":21525,"source":21526,"body":21527,"_type":937,"_id":22508,"_source":939,"_file":22509,"_stem":22510,"_extension":942},"\u002Fblog\u002F2020-05-12-centos-mysql80","Centos 7.3 安装 MySQL 8.0","完整的 CentOS 7.3 安装 MySQL 8.0 教程，包括准备工作、安装配置、密码策略修改、远程访问开启及字符编码设置。",[16717,16718,18425,5718],"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-c5cda4af38ff1060.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Fdb03c0959506",{"type":20,"children":21528,"toc":22504},[21529,21534,21542,21581,21595,21603,21611,21659,21667,21675,21700,21708,21731,21744,21749,21757,21781,21789,21816,21821,21828,21836,21844,21867,21875,21896,21910,21929,21953,21960,21968,22117,22122,22130,22159,22166,22216,22223,22227,22248,22255,22332,22336,22356,22363,22406,22413,22438,22444,22448,22475,22479,22500],{"type":23,"tag":50,"props":21530,"children":21532},{"id":21531},"准备工作",[21533],{"type":28,"value":21531},{"type":23,"tag":890,"props":21535,"children":21536},{},[21537],{"type":23,"tag":403,"props":21538,"children":21539},{},[21540],{"type":28,"value":21541},"查看是否有安装过 mysql",{"type":23,"tag":2152,"props":21543,"children":21545},{"className":20588,"code":21544,"language":20590,"meta":8,"style":8},"rpm -qa | grep -i mysql\n",[21546],{"type":23,"tag":99,"props":21547,"children":21548},{"__ignoreMap":8},[21549],{"type":23,"tag":2161,"props":21550,"children":21551},{"class":2163,"line":2164},[21552,21557,21562,21567,21572,21576],{"type":23,"tag":2161,"props":21553,"children":21554},{"style":5824},[21555],{"type":28,"value":21556},"rpm",{"type":23,"tag":2161,"props":21558,"children":21559},{"style":5844},[21560],{"type":28,"value":21561}," -qa",{"type":23,"tag":2161,"props":21563,"children":21564},{"style":5948},[21565],{"type":28,"value":21566}," |",{"type":23,"tag":2161,"props":21568,"children":21569},{"style":5824},[21570],{"type":28,"value":21571}," grep",{"type":23,"tag":2161,"props":21573,"children":21574},{"style":5844},[21575],{"type":28,"value":20606},{"type":23,"tag":2161,"props":21577,"children":21578},{"style":5855},[21579],{"type":28,"value":21580}," mysql\n",{"type":23,"tag":890,"props":21582,"children":21583},{"start":927},[21584],{"type":23,"tag":403,"props":21585,"children":21586},{},[21587,21589],{"type":28,"value":21588},"删除 MySQL ",{"type":23,"tag":99,"props":21590,"children":21592},{"className":21591},[],[21593],{"type":28,"value":21594},"yum -y remove MySQL-*",{"type":23,"tag":17976,"props":21596,"children":21597},{},[21598],{"type":23,"tag":24,"props":21599,"children":21600},{},[21601],{"type":28,"value":21602},"一般用rpm -e 的命令删除mysql,这样表面上删除了mysql,可是mysql的一些残余程序仍然存在,并且通过第一步的方式也查找不到残余,而yum命令比较强大,可以完全删除mysql.(用rpm删除后再次安装的时候会提示已经安装了,这就是rpm没删除干净的原因)",{"type":23,"tag":890,"props":21604,"children":21605},{"start":924},[21606],{"type":23,"tag":403,"props":21607,"children":21608},{},[21609],{"type":28,"value":21610},"把所有出现的目录统统删除",{"type":23,"tag":2152,"props":21612,"children":21614},{"className":20588,"code":21613,"language":20590,"meta":8,"style":8},"find \u002F -name mysql | xargs rm -rf\n",[21615],{"type":23,"tag":99,"props":21616,"children":21617},{"__ignoreMap":8},[21618],{"type":23,"tag":2161,"props":21619,"children":21620},{"class":2163,"line":2164},[21621,21625,21630,21635,21640,21644,21649,21654],{"type":23,"tag":2161,"props":21622,"children":21623},{"style":5824},[21624],{"type":28,"value":16313},{"type":23,"tag":2161,"props":21626,"children":21627},{"style":5855},[21628],{"type":28,"value":21629}," \u002F",{"type":23,"tag":2161,"props":21631,"children":21632},{"style":5844},[21633],{"type":28,"value":21634}," -name",{"type":23,"tag":2161,"props":21636,"children":21637},{"style":5855},[21638],{"type":28,"value":21639}," mysql",{"type":23,"tag":2161,"props":21641,"children":21642},{"style":5948},[21643],{"type":28,"value":21566},{"type":23,"tag":2161,"props":21645,"children":21646},{"style":5824},[21647],{"type":28,"value":21648}," xargs",{"type":23,"tag":2161,"props":21650,"children":21651},{"style":5855},[21652],{"type":28,"value":21653}," rm",{"type":23,"tag":2161,"props":21655,"children":21656},{"style":5844},[21657],{"type":28,"value":21658}," -rf\n",{"type":23,"tag":17976,"props":21660,"children":21661},{},[21662],{"type":23,"tag":24,"props":21663,"children":21664},{},[21665],{"type":28,"value":21666},"查找mysql的一些目录，把所有出现的目录删除，可以使用rm -rf 路径，删除时请注意，一旦删除无法恢复。",{"type":23,"tag":890,"props":21668,"children":21669},{"start":2190},[21670],{"type":23,"tag":403,"props":21671,"children":21672},{},[21673],{"type":28,"value":21674},"删除配置文件",{"type":23,"tag":2152,"props":21676,"children":21678},{"className":20588,"code":21677,"language":20590,"meta":8,"style":8},"rm -rf \u002Fetc\u002Fmy.cnf\n",[21679],{"type":23,"tag":99,"props":21680,"children":21681},{"__ignoreMap":8},[21682],{"type":23,"tag":2161,"props":21683,"children":21684},{"class":2163,"line":2164},[21685,21690,21695],{"type":23,"tag":2161,"props":21686,"children":21687},{"style":5824},[21688],{"type":28,"value":21689},"rm",{"type":23,"tag":2161,"props":21691,"children":21692},{"style":5844},[21693],{"type":28,"value":21694}," -rf",{"type":23,"tag":2161,"props":21696,"children":21697},{"style":5855},[21698],{"type":28,"value":21699}," \u002Fetc\u002Fmy.cnf\n",{"type":23,"tag":890,"props":21701,"children":21702},{"start":2199},[21703],{"type":23,"tag":403,"props":21704,"children":21705},{},[21706],{"type":28,"value":21707},"删除mysql的默认密码",{"type":23,"tag":2152,"props":21709,"children":21711},{"className":20588,"code":21710,"language":20590,"meta":8,"style":8},"rm -rf \u002Froot\u002F.mysql_sercret\n",[21712],{"type":23,"tag":99,"props":21713,"children":21714},{"__ignoreMap":8},[21715],{"type":23,"tag":2161,"props":21716,"children":21717},{"class":2163,"line":2164},[21718,21722,21726],{"type":23,"tag":2161,"props":21719,"children":21720},{"style":5824},[21721],{"type":28,"value":21689},{"type":23,"tag":2161,"props":21723,"children":21724},{"style":5844},[21725],{"type":28,"value":21694},{"type":23,"tag":2161,"props":21727,"children":21728},{"style":5855},[21729],{"type":28,"value":21730}," \u002Froot\u002F.mysql_sercret\n",{"type":23,"tag":24,"props":21732,"children":21733},{},[21734,21736,21742],{"type":28,"value":21735},"五步完成之后，这样mysql就全部删除干净了，若没安装过 ",{"type":23,"tag":99,"props":21737,"children":21739},{"className":21738},[],[21740],{"type":28,"value":21741},"mysql",{"type":28,"value":21743}," 可忽略以上步骤",{"type":23,"tag":50,"props":21745,"children":21747},{"id":21746},"开始安装",[21748],{"type":28,"value":21746},{"type":23,"tag":890,"props":21750,"children":21751},{},[21752],{"type":23,"tag":403,"props":21753,"children":21754},{},[21755],{"type":28,"value":21756},"配置Mysql 8.0安装源",{"type":23,"tag":2152,"props":21758,"children":21760},{"className":20588,"code":21759,"language":20590,"meta":8,"style":8},"rpm -Uvh https:\u002F\u002Fdev.mysql.com\u002Fget\u002Fmysql80-community-release-el7-3.noarch.rpm\n",[21761],{"type":23,"tag":99,"props":21762,"children":21763},{"__ignoreMap":8},[21764],{"type":23,"tag":2161,"props":21765,"children":21766},{"class":2163,"line":2164},[21767,21771,21776],{"type":23,"tag":2161,"props":21768,"children":21769},{"style":5824},[21770],{"type":28,"value":21556},{"type":23,"tag":2161,"props":21772,"children":21773},{"style":5844},[21774],{"type":28,"value":21775}," -Uvh",{"type":23,"tag":2161,"props":21777,"children":21778},{"style":5855},[21779],{"type":28,"value":21780}," https:\u002F\u002Fdev.mysql.com\u002Fget\u002Fmysql80-community-release-el7-3.noarch.rpm\n",{"type":23,"tag":890,"props":21782,"children":21783},{"start":927},[21784],{"type":23,"tag":403,"props":21785,"children":21786},{},[21787],{"type":28,"value":21788},"安装Mysql 8.0",{"type":23,"tag":2152,"props":21790,"children":21792},{"className":20588,"code":21791,"language":20590,"meta":8,"style":8},"yum --enablerepo=mysql80-community install mysql-community-server\n",[21793],{"type":23,"tag":99,"props":21794,"children":21795},{"__ignoreMap":8},[21796],{"type":23,"tag":2161,"props":21797,"children":21798},{"class":2163,"line":2164},[21799,21803,21808,21812],{"type":23,"tag":2161,"props":21800,"children":21801},{"style":5824},[21802],{"type":28,"value":20642},{"type":23,"tag":2161,"props":21804,"children":21805},{"style":5844},[21806],{"type":28,"value":21807}," --enablerepo=mysql80-community",{"type":23,"tag":2161,"props":21809,"children":21810},{"style":5855},[21811],{"type":28,"value":20652},{"type":23,"tag":2161,"props":21813,"children":21814},{"style":5855},[21815],{"type":28,"value":20699},{"type":23,"tag":24,"props":21817,"children":21818},{},[21819],{"type":28,"value":21820},"提示下载插件选择：y",{"type":23,"tag":24,"props":21822,"children":21823},{},[21824],{"type":23,"tag":65,"props":21825,"children":21827},{"alt":8,"src":21826},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-c5cda4af38ff1060.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":17976,"props":21829,"children":21830},{},[21831],{"type":23,"tag":24,"props":21832,"children":21833},{},[21834],{"type":28,"value":21835},"看到complet(完毕)就是安装完啦",{"type":23,"tag":890,"props":21837,"children":21838},{"start":924},[21839],{"type":23,"tag":403,"props":21840,"children":21841},{},[21842],{"type":28,"value":21843},"启动 MySQL 服务",{"type":23,"tag":2152,"props":21845,"children":21847},{"className":20588,"code":21846,"language":20590,"meta":8,"style":8},"systemctl start mysqld\n",[21848],{"type":23,"tag":99,"props":21849,"children":21850},{"__ignoreMap":8},[21851],{"type":23,"tag":2161,"props":21852,"children":21853},{"class":2163,"line":2164},[21854,21858,21863],{"type":23,"tag":2161,"props":21855,"children":21856},{"style":5824},[21857],{"type":28,"value":20986},{"type":23,"tag":2161,"props":21859,"children":21860},{"style":5855},[21861],{"type":28,"value":21862}," start",{"type":23,"tag":2161,"props":21864,"children":21865},{"style":5855},[21866],{"type":28,"value":20996},{"type":23,"tag":890,"props":21868,"children":21869},{"start":2190},[21870],{"type":23,"tag":403,"props":21871,"children":21872},{},[21873],{"type":28,"value":21874},"查看mysql服务运行状态",{"type":23,"tag":2152,"props":21876,"children":21877},{"className":20588,"code":21007,"language":20590,"meta":8,"style":8},[21878],{"type":23,"tag":99,"props":21879,"children":21880},{"__ignoreMap":8},[21881],{"type":23,"tag":2161,"props":21882,"children":21883},{"class":2163,"line":2164},[21884,21888,21892],{"type":23,"tag":2161,"props":21885,"children":21886},{"style":5824},[21887],{"type":28,"value":20986},{"type":23,"tag":2161,"props":21889,"children":21890},{"style":5855},[21891],{"type":28,"value":21023},{"type":23,"tag":2161,"props":21893,"children":21894},{"style":5855},[21895],{"type":28,"value":20996},{"type":23,"tag":890,"props":21897,"children":21898},{"start":2199},[21899],{"type":23,"tag":403,"props":21900,"children":21901},{},[21902,21903,21908],{"type":28,"value":21042},{"type":23,"tag":99,"props":21904,"children":21906},{"className":21905},[],[21907],{"type":28,"value":20},{"type":28,"value":21909}," 临时密码",{"type":23,"tag":24,"props":21911,"children":21912},{},[21913,21915,21920,21922,21927],{"type":28,"value":21914},"安装完 ",{"type":23,"tag":99,"props":21916,"children":21918},{"className":21917},[],[21919],{"type":28,"value":18425},{"type":28,"value":21921}," 之后，会生成一个临时的密码让 ",{"type":23,"tag":99,"props":21923,"children":21925},{"className":21924},[],[21926],{"type":28,"value":20},{"type":28,"value":21928}," 用户登录",{"type":23,"tag":2152,"props":21930,"children":21932},{"className":20588,"code":21931,"language":20590,"meta":8,"style":8},"grep \"A temporary password\" \u002Fvar\u002Flog\u002Fmysqld.log\n",[21933],{"type":23,"tag":99,"props":21934,"children":21935},{"__ignoreMap":8},[21936],{"type":23,"tag":2161,"props":21937,"children":21938},{"class":2163,"line":2164},[21939,21943,21948],{"type":23,"tag":2161,"props":21940,"children":21941},{"style":5824},[21942],{"type":28,"value":14548},{"type":23,"tag":2161,"props":21944,"children":21945},{"style":5855},[21946],{"type":28,"value":21947}," \"A temporary password\"",{"type":23,"tag":2161,"props":21949,"children":21950},{"style":5855},[21951],{"type":28,"value":21952}," \u002Fvar\u002Flog\u002Fmysqld.log\n",{"type":23,"tag":24,"props":21954,"children":21955},{},[21956],{"type":23,"tag":65,"props":21957,"children":21959},{"alt":8,"src":21958},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-d7cf1730432d34b3.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1161\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":21961,"children":21962},{"start":2208},[21963],{"type":23,"tag":403,"props":21964,"children":21965},{},[21966],{"type":28,"value":21967},"更改临时密码",{"type":23,"tag":2152,"props":21969,"children":21971},{"className":5795,"code":21970,"language":5797,"meta":8,"style":8},"输入：mysql -uroot -p\n在Enter password：后面输入临时密码\n登录成功\n输入：ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';\n会提示：ERROR 1819 (HY000): Your password does not satisfy the current policy requirements(密码不符合当前策略)\n方案1: 设置符合策略的密码(大小写字母+数据+符号)\n方案2: 密码策略改简单一点\n",[21972],{"type":23,"tag":99,"props":21973,"children":21974},{"__ignoreMap":8},[21975,21993,22006,22014,22051,22078,22104],{"type":23,"tag":2161,"props":21976,"children":21977},{"class":2163,"line":2164},[21978,21983,21988],{"type":23,"tag":2161,"props":21979,"children":21980},{"style":5824},[21981],{"type":28,"value":21982},"输入：mysql",{"type":23,"tag":2161,"props":21984,"children":21985},{"style":5844},[21986],{"type":28,"value":21987}," -uroot",{"type":23,"tag":2161,"props":21989,"children":21990},{"style":5844},[21991],{"type":28,"value":21992}," -p\n",{"type":23,"tag":2161,"props":21994,"children":21995},{"class":2163,"line":927},[21996,22001],{"type":23,"tag":2161,"props":21997,"children":21998},{"style":5824},[21999],{"type":28,"value":22000},"在Enter",{"type":23,"tag":2161,"props":22002,"children":22003},{"style":5855},[22004],{"type":28,"value":22005}," password：后面输入临时密码\n",{"type":23,"tag":2161,"props":22007,"children":22008},{"class":2163,"line":924},[22009],{"type":23,"tag":2161,"props":22010,"children":22011},{"style":5824},[22012],{"type":28,"value":22013},"登录成功\n",{"type":23,"tag":2161,"props":22015,"children":22016},{"class":2163,"line":2190},[22017,22022,22027,22032,22037,22042,22047],{"type":23,"tag":2161,"props":22018,"children":22019},{"style":5824},[22020],{"type":28,"value":22021},"输入：ALTER",{"type":23,"tag":2161,"props":22023,"children":22024},{"style":5855},[22025],{"type":28,"value":22026}," USER",{"type":23,"tag":2161,"props":22028,"children":22029},{"style":5855},[22030],{"type":28,"value":22031}," 'root'@'localhost'",{"type":23,"tag":2161,"props":22033,"children":22034},{"style":5855},[22035],{"type":28,"value":22036}," IDENTIFIED",{"type":23,"tag":2161,"props":22038,"children":22039},{"style":5855},[22040],{"type":28,"value":22041}," BY",{"type":23,"tag":2161,"props":22043,"children":22044},{"style":5855},[22045],{"type":28,"value":22046}," 'new password'",{"type":23,"tag":2161,"props":22048,"children":22049},{"style":5830},[22050],{"type":28,"value":20434},{"type":23,"tag":2161,"props":22052,"children":22053},{"class":2163,"line":2199},[22054,22059,22064,22069,22074],{"type":23,"tag":2161,"props":22055,"children":22056},{"style":5824},[22057],{"type":28,"value":22058},"会提示：ERROR",{"type":23,"tag":2161,"props":22060,"children":22061},{"style":5844},[22062],{"type":28,"value":22063}," 1819",{"type":23,"tag":2161,"props":22065,"children":22066},{"style":5830},[22067],{"type":28,"value":22068}," (HY000): Your password does not satisfy the current policy requirements(",{"type":23,"tag":2161,"props":22070,"children":22071},{"style":5824},[22072],{"type":28,"value":22073},"密码不符合当前策略",{"type":23,"tag":2161,"props":22075,"children":22076},{"style":5830},[22077],{"type":28,"value":11451},{"type":23,"tag":2161,"props":22079,"children":22080},{"class":2163,"line":2208},[22081,22086,22091,22095,22100],{"type":23,"tag":2161,"props":22082,"children":22083},{"style":5824},[22084],{"type":28,"value":22085},"方案1:",{"type":23,"tag":2161,"props":22087,"children":22088},{"style":5855},[22089],{"type":28,"value":22090}," 设置符合策略的密码",{"type":23,"tag":2161,"props":22092,"children":22093},{"style":5830},[22094],{"type":28,"value":10486},{"type":23,"tag":2161,"props":22096,"children":22097},{"style":5824},[22098],{"type":28,"value":22099},"大小写字母+数据+符号",{"type":23,"tag":2161,"props":22101,"children":22102},{"style":5830},[22103],{"type":28,"value":11451},{"type":23,"tag":2161,"props":22105,"children":22106},{"class":2163,"line":2217},[22107,22112],{"type":23,"tag":2161,"props":22108,"children":22109},{"style":5824},[22110],{"type":28,"value":22111},"方案2:",{"type":23,"tag":2161,"props":22113,"children":22114},{"style":5855},[22115],{"type":28,"value":22116}," 密码策略改简单一点\n",{"type":23,"tag":24,"props":22118,"children":22119},{},[22120],{"type":28,"value":22121},"方案2设置方式",{"type":23,"tag":399,"props":22123,"children":22124},{},[22125],{"type":23,"tag":403,"props":22126,"children":22127},{},[22128],{"type":28,"value":22129},"查看当前密码策略",{"type":23,"tag":2152,"props":22131,"children":22133},{"className":19390,"code":22132,"language":19392,"meta":8,"style":8},"SHOW VARIABLES LIKE 'validate_password.%';\n",[22134],{"type":23,"tag":99,"props":22135,"children":22136},{"__ignoreMap":8},[22137],{"type":23,"tag":2161,"props":22138,"children":22139},{"class":2163,"line":2164},[22140,22145,22150,22155],{"type":23,"tag":2161,"props":22141,"children":22142},{"style":5830},[22143],{"type":28,"value":22144},"SHOW VARIABLES ",{"type":23,"tag":2161,"props":22146,"children":22147},{"style":5948},[22148],{"type":28,"value":22149},"LIKE",{"type":23,"tag":2161,"props":22151,"children":22152},{"style":5855},[22153],{"type":28,"value":22154}," 'validate_password.%'",{"type":23,"tag":2161,"props":22156,"children":22157},{"style":5830},[22158],{"type":28,"value":20434},{"type":23,"tag":24,"props":22160,"children":22161},{},[22162],{"type":23,"tag":65,"props":22163,"children":22165},{"alt":8,"src":22164},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-7cbc7ebf577cd08b.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F923\u002Fformat\u002Fwebp",[],{"type":23,"tag":399,"props":22167,"children":22168},{},[22169],{"type":23,"tag":403,"props":22170,"children":22171},{},[22172,22174,22180,22182,22188,22194,22196,22202,22208,22210],{"type":28,"value":22173},"修改密码策略\n",{"type":23,"tag":99,"props":22175,"children":22177},{"className":22176},[],[22178],{"type":28,"value":22179},"validate_password.length",{"type":28,"value":22181}," 是密码的最小长度，默认是8，我们把它改成6\n输入： ",{"type":23,"tag":99,"props":22183,"children":22185},{"className":22184},[],[22186],{"type":28,"value":22187},"set global validate_password.length=6;",{"type":23,"tag":99,"props":22189,"children":22191},{"className":22190},[],[22192],{"type":28,"value":22193},"validate_password.policy",{"type":28,"value":22195}," 验证密码的复杂程度，我们把它改成0\n输入： ",{"type":23,"tag":99,"props":22197,"children":22199},{"className":22198},[],[22200],{"type":28,"value":22201},"set global validate_password.policy=0;",{"type":23,"tag":99,"props":22203,"children":22205},{"className":22204},[],[22206],{"type":28,"value":22207},"validate_password.check_user_name",{"type":28,"value":22209}," 用户名检查，用户名和密码不能相同，我们也把它关掉\n输入： ",{"type":23,"tag":99,"props":22211,"children":22213},{"className":22212},[],[22214],{"type":28,"value":22215},"set global validate_password.check_user_name=off;",{"type":23,"tag":24,"props":22217,"children":22218},{},[22219],{"type":23,"tag":65,"props":22220,"children":22222},{"alt":8,"src":22221},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-0588efc96830223f.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F999\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":22224,"children":22225},{},[22226],{"type":28,"value":20971},{"type":23,"tag":2152,"props":22228,"children":22229},{"className":20588,"code":20974,"language":20590,"meta":8,"style":8},[22230],{"type":23,"tag":99,"props":22231,"children":22232},{"__ignoreMap":8},[22233],{"type":23,"tag":2161,"props":22234,"children":22235},{"class":2163,"line":2164},[22236,22240,22244],{"type":23,"tag":2161,"props":22237,"children":22238},{"style":5824},[22239],{"type":28,"value":20986},{"type":23,"tag":2161,"props":22241,"children":22242},{"style":5855},[22243],{"type":28,"value":20991},{"type":23,"tag":2161,"props":22245,"children":22246},{"style":5855},[22247],{"type":28,"value":20996},{"type":23,"tag":890,"props":22249,"children":22250},{"start":2217},[22251],{"type":23,"tag":403,"props":22252,"children":22253},{},[22254],{"type":28,"value":21227},{"type":23,"tag":2152,"props":22256,"children":22257},{"className":19390,"code":21230,"language":19392,"meta":8,"style":8},[22258],{"type":23,"tag":99,"props":22259,"children":22260},{"__ignoreMap":8},[22261],{"type":23,"tag":2161,"props":22262,"children":22263},{"class":2163,"line":2164},[22264,22268,22272,22276,22280,22284,22288,22292,22296,22300,22304,22308,22312,22316,22320,22324,22328],{"type":23,"tag":2161,"props":22265,"children":22266},{"style":5948},[22267],{"type":28,"value":21242},{"type":23,"tag":2161,"props":22269,"children":22270},{"style":5830},[22271],{"type":28,"value":21247},{"type":23,"tag":2161,"props":22273,"children":22274},{"style":5948},[22275],{"type":28,"value":21252},{"type":23,"tag":2161,"props":22277,"children":22278},{"style":5948},[22279],{"type":28,"value":21257},{"type":23,"tag":2161,"props":22281,"children":22282},{"style":5830},[22283],{"type":28,"value":19454},{"type":23,"tag":2161,"props":22285,"children":22286},{"style":5948},[22287],{"type":28,"value":21266},{"type":23,"tag":2161,"props":22289,"children":22290},{"style":5948},[22291],{"type":28,"value":21271},{"type":23,"tag":2161,"props":22293,"children":22294},{"style":5855},[22295],{"type":28,"value":21276},{"type":23,"tag":2161,"props":22297,"children":22298},{"style":5830},[22299],{"type":28,"value":21281},{"type":23,"tag":2161,"props":22301,"children":22302},{"style":5855},[22303],{"type":28,"value":21286},{"type":23,"tag":2161,"props":22305,"children":22306},{"style":5830},[22307],{"type":28,"value":21291},{"type":23,"tag":2161,"props":22309,"children":22310},{"style":5948},[22311],{"type":28,"value":21296},{"type":23,"tag":2161,"props":22313,"children":22314},{"style":5855},[22315],{"type":28,"value":21301},{"type":23,"tag":2161,"props":22317,"children":22318},{"style":5948},[22319],{"type":28,"value":21306},{"type":23,"tag":2161,"props":22321,"children":22322},{"style":5948},[22323],{"type":28,"value":21311},{"type":23,"tag":2161,"props":22325,"children":22326},{"style":5948},[22327],{"type":28,"value":21316},{"type":23,"tag":2161,"props":22329,"children":22330},{"style":5830},[22331],{"type":28,"value":20434},{"type":23,"tag":24,"props":22333,"children":22334},{},[22335],{"type":28,"value":21325},{"type":23,"tag":2152,"props":22337,"children":22338},{"className":19390,"code":21328,"language":19392,"meta":8,"style":8},[22339],{"type":23,"tag":99,"props":22340,"children":22341},{"__ignoreMap":8},[22342,22349],{"type":23,"tag":2161,"props":22343,"children":22344},{"class":2163,"line":2164},[22345],{"type":23,"tag":2161,"props":22346,"children":22347},{"style":5830},[22348],{"type":28,"value":21340},{"type":23,"tag":2161,"props":22350,"children":22351},{"class":2163,"line":927},[22352],{"type":23,"tag":2161,"props":22353,"children":22354},{"style":5830},[22355],{"type":28,"value":21348},{"type":23,"tag":890,"props":22357,"children":22358},{"start":2226},[22359],{"type":23,"tag":403,"props":22360,"children":22361},{},[22362],{"type":28,"value":21356},{"type":23,"tag":2152,"props":22364,"children":22365},{"className":20588,"code":21359,"language":20590,"meta":8,"style":8},[22366],{"type":23,"tag":99,"props":22367,"children":22368},{"__ignoreMap":8},[22369,22388,22395],{"type":23,"tag":2161,"props":22370,"children":22371},{"class":2163,"line":2164},[22372,22376,22380,22384],{"type":23,"tag":2161,"props":22373,"children":22374},{"style":5824},[22375],{"type":28,"value":21371},{"type":23,"tag":2161,"props":22377,"children":22378},{"style":5844},[22379],{"type":28,"value":21376},{"type":23,"tag":2161,"props":22381,"children":22382},{"style":5844},[22383],{"type":28,"value":21381},{"type":23,"tag":2161,"props":22385,"children":22386},{"style":5844},[22387],{"type":28,"value":21386},{"type":23,"tag":2161,"props":22389,"children":22390},{"class":2163,"line":927},[22391],{"type":23,"tag":2161,"props":22392,"children":22393},{"style":5807},[22394],{"type":28,"value":21394},{"type":23,"tag":2161,"props":22396,"children":22397},{"class":2163,"line":924},[22398,22402],{"type":23,"tag":2161,"props":22399,"children":22400},{"style":5824},[22401],{"type":28,"value":21371},{"type":23,"tag":2161,"props":22403,"children":22404},{"style":5844},[22405],{"type":28,"value":21406},{"type":23,"tag":890,"props":22407,"children":22408},{"start":2235},[22409],{"type":23,"tag":403,"props":22410,"children":22411},{},[22412],{"type":28,"value":21414},{"type":23,"tag":2152,"props":22414,"children":22415},{"className":19390,"code":21417,"language":19392,"meta":8,"style":8},[22416],{"type":23,"tag":99,"props":22417,"children":22418},{"__ignoreMap":8},[22419],{"type":23,"tag":2161,"props":22420,"children":22421},{"class":2163,"line":2164},[22422,22426,22430,22434],{"type":23,"tag":2161,"props":22423,"children":22424},{"style":5830},[22425],{"type":28,"value":21429},{"type":23,"tag":2161,"props":22427,"children":22428},{"style":5948},[22429],{"type":28,"value":21434},{"type":23,"tag":2161,"props":22431,"children":22432},{"style":5855},[22433],{"type":28,"value":21439},{"type":23,"tag":2161,"props":22435,"children":22436},{"style":5830},[22437],{"type":28,"value":20434},{"type":23,"tag":24,"props":22439,"children":22440},{},[22441],{"type":23,"tag":65,"props":22442,"children":22443},{"alt":8,"src":21449},[],{"type":23,"tag":24,"props":22445,"children":22446},{},[22447],{"type":28,"value":21455},{"type":23,"tag":2152,"props":22449,"children":22450},{"className":20722,"code":21458,"language":20724,"meta":8,"style":8},[22451],{"type":23,"tag":99,"props":22452,"children":22453},{"__ignoreMap":8},[22454,22461,22468],{"type":23,"tag":2161,"props":22455,"children":22456},{"class":2163,"line":2164},[22457],{"type":23,"tag":2161,"props":22458,"children":22459},{},[22460],{"type":28,"value":20759},{"type":23,"tag":2161,"props":22462,"children":22463},{"class":2163,"line":927},[22464],{"type":23,"tag":2161,"props":22465,"children":22466},{},[22467],{"type":28,"value":21477},{"type":23,"tag":2161,"props":22469,"children":22470},{"class":2163,"line":924},[22471],{"type":23,"tag":2161,"props":22472,"children":22473},{},[22474],{"type":28,"value":21485},{"type":23,"tag":24,"props":22476,"children":22477},{},[22478],{"type":28,"value":20971},{"type":23,"tag":2152,"props":22480,"children":22481},{"className":20588,"code":20974,"language":20590,"meta":8,"style":8},[22482],{"type":23,"tag":99,"props":22483,"children":22484},{"__ignoreMap":8},[22485],{"type":23,"tag":2161,"props":22486,"children":22487},{"class":2163,"line":2164},[22488,22492,22496],{"type":23,"tag":2161,"props":22489,"children":22490},{"style":5824},[22491],{"type":28,"value":20986},{"type":23,"tag":2161,"props":22493,"children":22494},{"style":5855},[22495],{"type":28,"value":20991},{"type":23,"tag":2161,"props":22497,"children":22498},{"style":5855},[22499],{"type":28,"value":20996},{"type":23,"tag":2730,"props":22501,"children":22502},{},[22503],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":22505},[22506,22507],{"id":21531,"depth":927,"text":21531},{"id":21746,"depth":927,"text":21746},"content:blog:2020-05-12-centos-mysql80.md","blog\u002F2020-05-12-centos-mysql80.md","blog\u002F2020-05-12-centos-mysql80",{"_path":22512,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":22513,"description":22514,"date":18422,"tags":22515,"cover":22516,"source":22517,"body":22518,"_type":937,"_id":22898,"_source":939,"_file":22899,"_stem":22900,"_extension":942},"\u002Fblog\u002F2020-05-12-mysql-binlog","MySQL 开启 binlog","MySQL 5.7 中开启和配置 binlog 的完整教程，包括 binlog 概念、配置步骤、验证方法及常用查询命令。",[16717,16718,18425,20472],"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-0899fc5e6f40a67a.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Ffd56514e3a0c",{"type":20,"children":22519,"toc":22893},[22520,22525,22530,22535,22560,22564,22572,22613,22621,22642,22656,22690,22697,22712,22719,22734,22762,22769,22782,22796,22803,22811,22835,22842,22850,22877,22884,22889],{"type":23,"tag":50,"props":22521,"children":22523},{"id":22522},"前言",[22524],{"type":28,"value":22522},{"type":23,"tag":24,"props":22526,"children":22527},{},[22528],{"type":28,"value":22529},"本文章用到的 mysql 版本为 5.7",{"type":23,"tag":50,"props":22531,"children":22533},{"id":22532},"介绍",[22534],{"type":28,"value":22532},{"type":23,"tag":24,"props":22536,"children":22537},{},[22538,22543,22545,22551,22553,22558],{"type":23,"tag":99,"props":22539,"children":22541},{"className":22540},[],[22542],{"type":28,"value":20472},{"type":28,"value":22544}," 就是 ",{"type":23,"tag":99,"props":22546,"children":22548},{"className":22547},[],[22549],{"type":28,"value":22550},"binary log",{"type":28,"value":22552}," ，二进制日志文件，这个文件记录了mysql所有的dml操作。通过 ",{"type":23,"tag":99,"props":22554,"children":22556},{"className":22555},[],[22557],{"type":28,"value":20472},{"type":28,"value":22559}," 日志我们可以做数据恢复，做主住复制和主从复制等等。对于开发者可能对`binlog 并不怎么关注，但是对于运维或者架构人员来讲是非常重要的。",{"type":23,"tag":50,"props":22561,"children":22562},{"id":4705},[22563],{"type":28,"value":4705},{"type":23,"tag":890,"props":22565,"children":22566},{},[22567],{"type":23,"tag":403,"props":22568,"children":22569},{},[22570],{"type":28,"value":22571},"在my.inf主配置文件中直接添加三行",{"type":23,"tag":2152,"props":22573,"children":22575},{"className":20588,"code":22574,"language":20590,"meta":8,"style":8},"log-bin=mysql-bin\nserver-id=1\n",[22576],{"type":23,"tag":99,"props":22577,"children":22578},{"__ignoreMap":8},[22579,22596],{"type":23,"tag":2161,"props":22580,"children":22581},{"class":2163,"line":2164},[22582,22587,22591],{"type":23,"tag":2161,"props":22583,"children":22584},{"style":5830},[22585],{"type":28,"value":22586},"log-bin",{"type":23,"tag":2161,"props":22588,"children":22589},{"style":5948},[22590],{"type":28,"value":6258},{"type":23,"tag":2161,"props":22592,"children":22593},{"style":5855},[22594],{"type":28,"value":22595},"mysql-bin\n",{"type":23,"tag":2161,"props":22597,"children":22598},{"class":2163,"line":927},[22599,22604,22608],{"type":23,"tag":2161,"props":22600,"children":22601},{"style":5830},[22602],{"type":28,"value":22603},"server-id",{"type":23,"tag":2161,"props":22605,"children":22606},{"style":5948},[22607],{"type":28,"value":6258},{"type":23,"tag":2161,"props":22609,"children":22610},{"style":5855},[22611],{"type":28,"value":22612},"1\n",{"type":23,"tag":890,"props":22614,"children":22615},{"start":927},[22616],{"type":23,"tag":403,"props":22617,"children":22618},{},[22619],{"type":28,"value":22620},"重启 MySQL",{"type":23,"tag":2152,"props":22622,"children":22623},{"className":20588,"code":20974,"language":20590,"meta":8,"style":8},[22624],{"type":23,"tag":99,"props":22625,"children":22626},{"__ignoreMap":8},[22627],{"type":23,"tag":2161,"props":22628,"children":22629},{"class":2163,"line":2164},[22630,22634,22638],{"type":23,"tag":2161,"props":22631,"children":22632},{"style":5824},[22633],{"type":28,"value":20986},{"type":23,"tag":2161,"props":22635,"children":22636},{"style":5855},[22637],{"type":28,"value":20991},{"type":23,"tag":2161,"props":22639,"children":22640},{"style":5855},[22641],{"type":28,"value":20996},{"type":23,"tag":890,"props":22643,"children":22644},{"start":924},[22645],{"type":23,"tag":403,"props":22646,"children":22647},{},[22648,22649,22654],{"type":28,"value":21042},{"type":23,"tag":99,"props":22650,"children":22652},{"className":22651},[],[22653],{"type":28,"value":20472},{"type":28,"value":22655}," 开启状态",{"type":23,"tag":2152,"props":22657,"children":22659},{"className":20588,"code":22658,"language":20590,"meta":8,"style":8},"show variables like '%log_bin%';\n",[22660],{"type":23,"tag":99,"props":22661,"children":22662},{"__ignoreMap":8},[22663],{"type":23,"tag":2161,"props":22664,"children":22665},{"class":2163,"line":2164},[22666,22671,22676,22681,22686],{"type":23,"tag":2161,"props":22667,"children":22668},{"style":5824},[22669],{"type":28,"value":22670},"show",{"type":23,"tag":2161,"props":22672,"children":22673},{"style":5855},[22674],{"type":28,"value":22675}," variables",{"type":23,"tag":2161,"props":22677,"children":22678},{"style":5855},[22679],{"type":28,"value":22680}," like",{"type":23,"tag":2161,"props":22682,"children":22683},{"style":5855},[22684],{"type":28,"value":22685}," '%log_bin%'",{"type":23,"tag":2161,"props":22687,"children":22688},{"style":5830},[22689],{"type":28,"value":20434},{"type":23,"tag":24,"props":22691,"children":22692},{},[22693],{"type":23,"tag":65,"props":22694,"children":22696},{"alt":8,"src":22695},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-0899fc5e6f40a67a.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F986\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":22698,"children":22699},{"start":2190},[22700],{"type":23,"tag":403,"props":22701,"children":22702},{},[22703,22704,22710],{"type":28,"value":21042},{"type":23,"tag":99,"props":22705,"children":22707},{"className":22706},[],[22708],{"type":28,"value":22709},"\u002Fvar\u002Flib\u002Fmysql",{"type":28,"value":22711}," 目录",{"type":23,"tag":24,"props":22713,"children":22714},{},[22715],{"type":23,"tag":65,"props":22716,"children":22718},{"alt":8,"src":22717},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-34937b22ecd97b13.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1092\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":22720,"children":22721},{"start":2199},[22722],{"type":23,"tag":403,"props":22723,"children":22724},{},[22725,22727,22732],{"type":28,"value":22726},"查看当前正在写入的 ",{"type":23,"tag":99,"props":22728,"children":22730},{"className":22729},[],[22731],{"type":28,"value":20472},{"type":28,"value":22733}," 文件",{"type":23,"tag":2152,"props":22735,"children":22737},{"className":19390,"code":22736,"language":19392,"meta":8,"style":8},"show master status;\n",[22738],{"type":23,"tag":99,"props":22739,"children":22740},{"__ignoreMap":8},[22741],{"type":23,"tag":2161,"props":22742,"children":22743},{"class":2163,"line":2164},[22744,22749,22754,22758],{"type":23,"tag":2161,"props":22745,"children":22746},{"style":5830},[22747],{"type":28,"value":22748},"show ",{"type":23,"tag":2161,"props":22750,"children":22751},{"style":5948},[22752],{"type":28,"value":22753},"master",{"type":23,"tag":2161,"props":22755,"children":22756},{"style":5948},[22757],{"type":28,"value":21023},{"type":23,"tag":2161,"props":22759,"children":22760},{"style":5830},[22761],{"type":28,"value":20434},{"type":23,"tag":24,"props":22763,"children":22764},{},[22765],{"type":23,"tag":65,"props":22766,"children":22768},{"alt":8,"src":22767},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-54e02b4a25f3e040.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F964\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":22770,"children":22771},{"start":2208},[22772],{"type":23,"tag":403,"props":22773,"children":22774},{},[22775,22776],{"type":28,"value":21042},{"type":23,"tag":99,"props":22777,"children":22779},{"className":22778},[],[22780],{"type":28,"value":22781},"binlog events",{"type":23,"tag":2152,"props":22783,"children":22785},{"className":19390,"code":22784,"language":19392,"meta":8,"style":8},"show binlog events;\n",[22786],{"type":23,"tag":99,"props":22787,"children":22788},{"__ignoreMap":8},[22789],{"type":23,"tag":2161,"props":22790,"children":22791},{"class":2163,"line":2164},[22792],{"type":23,"tag":2161,"props":22793,"children":22794},{"style":5830},[22795],{"type":28,"value":22784},{"type":23,"tag":24,"props":22797,"children":22798},{},[22799],{"type":23,"tag":65,"props":22800,"children":22802},{"alt":8,"src":22801},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-eb7d716e345c90ca.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1079\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":22804,"children":22805},{"start":2217},[22806],{"type":23,"tag":403,"props":22807,"children":22808},{},[22809],{"type":28,"value":22810},"查看指定的文件",{"type":23,"tag":2152,"props":22812,"children":22814},{"className":19390,"code":22813,"language":19392,"meta":8,"style":8},"show binary logs;\n",[22815],{"type":23,"tag":99,"props":22816,"children":22817},{"__ignoreMap":8},[22818],{"type":23,"tag":2161,"props":22819,"children":22820},{"class":2163,"line":2164},[22821,22825,22830],{"type":23,"tag":2161,"props":22822,"children":22823},{"style":5830},[22824],{"type":28,"value":22748},{"type":23,"tag":2161,"props":22826,"children":22827},{"style":5948},[22828],{"type":28,"value":22829},"binary",{"type":23,"tag":2161,"props":22831,"children":22832},{"style":5830},[22833],{"type":28,"value":22834}," logs;\n",{"type":23,"tag":24,"props":22836,"children":22837},{},[22838],{"type":23,"tag":65,"props":22839,"children":22841},{"alt":8,"src":22840},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-180ed6ae2aaa64c0.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1031\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":22843,"children":22844},{"start":2226},[22845],{"type":23,"tag":403,"props":22846,"children":22847},{},[22848],{"type":28,"value":22849},"查看binlog相关参数",{"type":23,"tag":2152,"props":22851,"children":22853},{"className":19390,"code":22852,"language":19392,"meta":8,"style":8},"show variables like \"%binlog%\";\n",[22854],{"type":23,"tag":99,"props":22855,"children":22856},{"__ignoreMap":8},[22857],{"type":23,"tag":2161,"props":22858,"children":22859},{"class":2163,"line":2164},[22860,22864,22868,22873],{"type":23,"tag":2161,"props":22861,"children":22862},{"style":5830},[22863],{"type":28,"value":21429},{"type":23,"tag":2161,"props":22865,"children":22866},{"style":5948},[22867],{"type":28,"value":21434},{"type":23,"tag":2161,"props":22869,"children":22870},{"style":5855},[22871],{"type":28,"value":22872}," \"%binlog%\"",{"type":23,"tag":2161,"props":22874,"children":22875},{"style":5830},[22876],{"type":28,"value":20434},{"type":23,"tag":24,"props":22878,"children":22879},{},[22880],{"type":23,"tag":65,"props":22881,"children":22883},{"alt":8,"src":22882},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-873cceb50e1ead5f.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1064\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":22885,"children":22886},{},[22887],{"type":28,"value":22888},"标红的都是我目前知道的，比较重要的参数。",{"type":23,"tag":2730,"props":22890,"children":22891},{},[22892],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":22894},[22895,22896,22897],{"id":22522,"depth":927,"text":22522},{"id":22532,"depth":927,"text":22532},{"id":4705,"depth":927,"text":4705},"content:blog:2020-05-12-mysql-binlog.md","blog\u002F2020-05-12-mysql-binlog.md","blog\u002F2020-05-12-mysql-binlog",{"_path":22902,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":22903,"description":22904,"date":22905,"tags":22906,"cover":22909,"source":22910,"body":22911,"_type":937,"_id":23099,"_source":939,"_file":23100,"_stem":23101,"_extension":942},"\u002Fblog\u002F2020-05-10-leetcode-vscode","力扣(LeetCode)刷题神器之Vs Code","在 VS Code 中使用 LeetCode 插件进行刷题，包括 Node.js 环境配置、插件安装、账号登录及使用全流程。","2020-05-10",[16717,16718,22907,22908],"LeetCode","VS Code","https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-06ad2576b969aad1.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002F85e8b7e84705",{"type":20,"children":22912,"toc":23093},[22913,22919,22924,22929,22934,22941,22946,22951,22956,22961,22966,22972,22985,22992,22997,23004,23010,23023,23030,23036],{"type":23,"tag":50,"props":22914,"children":22916},{"id":22915},"力扣leet-code介绍",[22917],{"type":28,"value":22918},"力扣(Leet Code)介绍",{"type":23,"tag":24,"props":22920,"children":22921},{},[22922],{"type":28,"value":22923},"相信不少学习编程的人对 LeetCode 这个网站是相当之熟悉的，这是一个专供程序员们练习编程能力的网站，主要侧重于算法方面，想进入一线大厂必备技能没有之一。",{"type":23,"tag":24,"props":22925,"children":22926},{},[22927],{"type":28,"value":22928},"作为一个最早期的、用户量也非常大的、面向大众的 OJ（Online Judge），LeetCode 在前两年年做了一个特别重大的决定 —— 正式进入中国。",{"type":23,"tag":24,"props":22930,"children":22931},{},[22932],{"type":28,"value":22933},"虽然在 LeetCode 进入中国之前我们也能使用 LeetCode，但是由于其服务器远在太平洋的对岸，以至于使用体验往往不太好，为了能给中国这个互联网大国提供服务，LeetCode 专门建了一个中国站。",{"type":23,"tag":24,"props":22935,"children":22936},{},[22937],{"type":23,"tag":65,"props":22938,"children":22940},{"alt":8,"src":22939},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-06ad2576b969aad1.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":22942,"children":22943},{},[22944],{"type":28,"value":22945},"中国站会提供一些国内互联网企业的工作机会\u002F实习机会，如果你刚好有这方面的能力，可以通过 LeetCode 直接投递简历。",{"type":23,"tag":24,"props":22947,"children":22948},{},[22949],{"type":28,"value":22950},"可是，LeetCode 虽然提供了对处于国内的我们来说更方便的中国站，但是由于 LeetCode 网页上的 IDE 并不是很便于编写代码和调试，以至于一般我们都会自己在自己常用的 IDE 里新建一个代码文件，在代码写好、调试好之后再粘贴到 LeetCode 上进行评分。",{"type":23,"tag":24,"props":22952,"children":22953},{},[22954],{"type":28,"value":22955},"这个操作虽然是在各种 OJ 上的标准操作，但是在互联网如此发达、IDE 可扩展性越来越高的今天，这种操作不够便捷。",{"type":23,"tag":24,"props":22957,"children":22958},{},[22959],{"type":28,"value":22960},"这个时候，我们就应该拿出微软开发的史上最强代码编辑器VS Code了。",{"type":23,"tag":24,"props":22962,"children":22963},{},[22964],{"type":28,"value":22965},"在 VSCode 上有一个 LeetCode 扩展在近期上架，目前还处于预览版的阶段。",{"type":23,"tag":50,"props":22967,"children":22969},{"id":22968},"nodejs-环境搭建",[22970],{"type":28,"value":22971},"Node.js 环境搭建",{"type":23,"tag":24,"props":22973,"children":22974},{},[22975,22977,22983],{"type":28,"value":22976},"Node.js官网： ",{"type":23,"tag":41,"props":22978,"children":22981},{"href":22979,"rel":22980},"https:\u002F\u002Fnodejs.org\u002Fen\u002F",[963],[22982],{"type":28,"value":22979},{"type":28,"value":22984}," ，下载自己想要的版本，建议下载稳定版本。",{"type":23,"tag":24,"props":22986,"children":22987},{},[22988],{"type":23,"tag":65,"props":22989,"children":22991},{"alt":8,"src":22990},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-7f633d1eeca8a8ed.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":24,"props":22993,"children":22994},{},[22995],{"type":28,"value":22996},"安装Node.js，安装过程基本上是傻瓜式的下一步，即可完成，然后在CMD中运行如下命令：node -v 来查询当前node.js的版本号，然后输出如图所示版本号就表示node.js环境变量设置成功",{"type":23,"tag":24,"props":22998,"children":22999},{},[23000],{"type":23,"tag":65,"props":23001,"children":23003},{"alt":8,"src":23002},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-c44ccc96e6da2f11.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F992\u002Fformat\u002Fwebp",[],{"type":23,"tag":50,"props":23005,"children":23007},{"id":23006},"leetcode插件安装",[23008],{"type":28,"value":23009},"LeetCode插件安装",{"type":23,"tag":24,"props":23011,"children":23012},{},[23013,23015,23021],{"type":28,"value":23014},"Vs Code安装这里就不再过多的赘述，请自行安装。打开 ",{"type":23,"tag":99,"props":23016,"children":23018},{"className":23017},[],[23019],{"type":28,"value":23020},"Vs Code",{"type":28,"value":23022}," 按照如下步骤进行操作",{"type":23,"tag":24,"props":23024,"children":23025},{},[23026],{"type":23,"tag":65,"props":23027,"children":23029},{"alt":8,"src":23028},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-e7fb7e8cc05d1dfd.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":50,"props":23031,"children":23033},{"id":23032},"leetcode-登录和使用",[23034],{"type":28,"value":23035},"LeetCode 登录和使用",{"type":23,"tag":890,"props":23037,"children":23038},{},[23039,23048,23057,23066,23075,23084],{"type":23,"tag":403,"props":23040,"children":23041},{},[23042,23044],{"type":28,"value":23043},"在登录账户之前一定要先选择账户来源到底是美国还是中国，因为这两种账户不互通（只需修改一次）\n",{"type":23,"tag":65,"props":23045,"children":23047},{"alt":8,"src":23046},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-5dc9bf366adbee23.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":403,"props":23049,"children":23050},{},[23051,23053],{"type":28,"value":23052},"接下来就是登陆了，选择相应的用户输入账户密码即可\n",{"type":23,"tag":65,"props":23054,"children":23056},{"alt":8,"src":23055},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-c9b65bbc92e90022.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":403,"props":23058,"children":23059},{},[23060,23062],{"type":28,"value":23061},"登陆后会显示所有的题目\n",{"type":23,"tag":65,"props":23063,"children":23065},{"alt":8,"src":23064},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-d6cf8c250eb2940c.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":403,"props":23067,"children":23068},{},[23069,23071],{"type":28,"value":23070},"选择相应的题目\n",{"type":23,"tag":65,"props":23072,"children":23074},{"alt":8,"src":23073},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-5883b39e39333f37.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":403,"props":23076,"children":23077},{},[23078,23080],{"type":28,"value":23079},"编写好代码之后点击测试按钮进行测试\n",{"type":23,"tag":65,"props":23081,"children":23083},{"alt":8,"src":23082},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-cd6d24d8867a249b.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":403,"props":23085,"children":23086},{},[23087,23089],{"type":28,"value":23088},"测试完成之后进行代码的提交\n",{"type":23,"tag":65,"props":23090,"children":23092},{"alt":8,"src":23091},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-33a7fdb2b754c3f7.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"title":8,"searchDepth":924,"depth":924,"links":23094},[23095,23096,23097,23098],{"id":22915,"depth":927,"text":22918},{"id":22968,"depth":927,"text":22971},{"id":23006,"depth":927,"text":23009},{"id":23032,"depth":927,"text":23035},"content:blog:2020-05-10-leetcode-vscode.md","blog\u002F2020-05-10-leetcode-vscode.md","blog\u002F2020-05-10-leetcode-vscode",{"_path":23103,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":23104,"description":23105,"date":23106,"tags":23107,"cover":23108,"source":23109,"body":23110,"_type":937,"_id":30178,"_source":939,"_file":30179,"_stem":30180,"_extension":942},"\u002Fblog\u002F2020-05-08-kafka-connect-mysql","Kafka Connect For MySQL 实现增量数据同步","采用 Kafka Connector 方式连接 MySQL，通过 incrementing、timestamp、timestamp+incrementing 三种模式实现端到端的增量数据同步。","2020-05-08",[16717,16718,5285,18425,15],"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-1fb3ed113eb6fb2a.png","https:\u002F\u002Fwww.jianshu.com\u002Fp\u002Ffad0e1ab9605",{"type":20,"children":23111,"toc":30165},[23112,23116,23132,23138,23169,23174,23289,23294,23387,23402,23408,23412,23420,24242,24266,24430,24445,24658,24681,24739,24754,24797,24802,24809,24825,25769,25783,25822,25827,25834,25846,25879,25899,25906,25914,26023,26030,26052,26059,26074,26213,26228,26235,26250,26257,26263,26284,26340,26346,26361,26744,26752,26767,27154,27174,27321,27335,27528,27547,27598,27611,27651,27666,28074,28120,28199,28213,28219,28232,28238,28252,28635,28649,29032,29051,29216,29229,29423,29442,29493,29506,29546,29560,29964,29978,30013,30043,30121,30135,30141,30146,30161],{"type":23,"tag":50,"props":23113,"children":23114},{"id":22522},[23115],{"type":28,"value":22522},{"type":23,"tag":17976,"props":23117,"children":23118},{},[23119,23124],{"type":23,"tag":24,"props":23120,"children":23121},{},[23122],{"type":28,"value":23123},"最近公司需要搭建基于 Flink 框架的实时数仓，为了保证数仓的稳定性，决定引用消息中间件 Kafka 。Kafka 的作用在于 \"削峰填谷\" ，所谓的\"削峰填谷\"就是指缓冲上下游瞬时突发流量，使其更平滑。特别是对于那种发送能力很强的上游系统，如果没有消息引擎的保护，\"脆弱\"的下游系统可能会直接被压垮导致全链路服务\"雪崩\"。但是，一旦有了消息引擎，它能够有效地对抗上游的流量冲击，真正做到将上游的\"峰\"填满到\"谷\"中，避免了流量的震荡。消息引擎系统的另一大好处在于发送方和接收方的松耦合，这也在一定程度上简化了应用的开发，减少了系统间不必要的交互。",{"type":23,"tag":17976,"props":23125,"children":23126},{},[23127],{"type":23,"tag":24,"props":23128,"children":23129},{},[23130],{"type":28,"value":23131},"那么问题来了，如何将源库中的全量、增量数据导入至 Kafka 主题中呢？本文章将采用 Kafka connector 的方式连接 MySQL ，来实现端到端的数据同步。",{"type":23,"tag":50,"props":23133,"children":23135},{"id":23134},"jdbc-connector",[23136],{"type":28,"value":23137},"JDBC Connector",{"type":23,"tag":24,"props":23139,"children":23140},{},[23141,23147,23149,23154,23156,23161,23162,23167],{"type":23,"tag":99,"props":23142,"children":23144},{"className":23143},[],[23145],{"type":28,"value":23146},"JDBC connector",{"type":28,"value":23148}," 允许您通过JDBC驱动程序将任何关系型数据库中的数据导入到Kafka的主题Topic中。通过使用JDBC，这个连接器可以支持各种数据库，不需要为每个数据库定制代码。\n通过定期地执行SQL查询语句并为结果集中的每一行创建输出记录来加载数据。 ",{"type":23,"tag":86,"props":23150,"children":23151},{},[23152],{"type":28,"value":23153},"在默认情况下，在一个数据库中的所有表都会被复制，每个表都复制到自己的输出主题",{"type":28,"value":23155}," 。数据库那些新的或删除的表被监视并自动适应调整。当从表中复制数据时，连接器可以仅仅加载 ",{"type":23,"tag":86,"props":23157,"children":23158},{},[23159],{"type":28,"value":23160},"新增",{"type":28,"value":2597},{"type":23,"tag":86,"props":23163,"children":23164},{},[23165],{"type":28,"value":23166},"修改",{"type":28,"value":23168}," 的行通过指定哪些列应当被用来发现新增或修改的数据。",{"type":23,"tag":50,"props":23170,"children":23172},{"id":23171},"测试环境",[23173],{"type":28,"value":23171},{"type":23,"tag":533,"props":23175,"children":23176},{},[23177,23202],{"type":23,"tag":537,"props":23178,"children":23179},{},[23180],{"type":23,"tag":541,"props":23181,"children":23182},{},[23183,23188,23193,23197],{"type":23,"tag":545,"props":23184,"children":23185},{},[23186],{"type":28,"value":23187},"IP",{"type":23,"tag":545,"props":23189,"children":23190},{},[23191],{"type":28,"value":23192},"操作系统",{"type":23,"tag":545,"props":23194,"children":23195},{},[23196],{"type":28,"value":4705},{"type":23,"tag":545,"props":23198,"children":23199},{},[23200],{"type":28,"value":23201},"服务器用途",{"type":23,"tag":561,"props":23203,"children":23204},{},[23205,23228,23248,23268],{"type":23,"tag":541,"props":23206,"children":23207},{},[23208,23213,23218,23223],{"type":23,"tag":568,"props":23209,"children":23210},{},[23211],{"type":28,"value":23212},"172.21.22.186",{"type":23,"tag":568,"props":23214,"children":23215},{},[23216],{"type":28,"value":23217},"CentOS Linux release 7.3.1611 (Core)",{"type":23,"tag":568,"props":23219,"children":23220},{},[23221],{"type":28,"value":23222},"4vC\u002F8Gb\u002F400Gb",{"type":23,"tag":568,"props":23224,"children":23225},{},[23226],{"type":28,"value":23227},"测试集群",{"type":23,"tag":541,"props":23229,"children":23230},{},[23231,23236,23240,23244],{"type":23,"tag":568,"props":23232,"children":23233},{},[23234],{"type":28,"value":23235},"172.21.22.187",{"type":23,"tag":568,"props":23237,"children":23238},{},[23239],{"type":28,"value":23217},{"type":23,"tag":568,"props":23241,"children":23242},{},[23243],{"type":28,"value":23222},{"type":23,"tag":568,"props":23245,"children":23246},{},[23247],{"type":28,"value":23227},{"type":23,"tag":541,"props":23249,"children":23250},{},[23251,23256,23260,23264],{"type":23,"tag":568,"props":23252,"children":23253},{},[23254],{"type":28,"value":23255},"172.21.22.188",{"type":23,"tag":568,"props":23257,"children":23258},{},[23259],{"type":28,"value":23217},{"type":23,"tag":568,"props":23261,"children":23262},{},[23263],{"type":28,"value":23222},{"type":23,"tag":568,"props":23265,"children":23266},{},[23267],{"type":28,"value":23227},{"type":23,"tag":541,"props":23269,"children":23270},{},[23271,23276,23280,23284],{"type":23,"tag":568,"props":23272,"children":23273},{},[23274],{"type":28,"value":23275},"172.21.23.238",{"type":23,"tag":568,"props":23277,"children":23278},{},[23279],{"type":28,"value":23217},{"type":23,"tag":568,"props":23281,"children":23282},{},[23283],{"type":28,"value":23222},{"type":23,"tag":568,"props":23285,"children":23286},{},[23287],{"type":28,"value":23288},"MySQL\u002F1",{"type":23,"tag":50,"props":23290,"children":23292},{"id":23291},"前置条件",[23293],{"type":28,"value":23291},{"type":23,"tag":533,"props":23295,"children":23296},{},[23297,23322],{"type":23,"tag":537,"props":23298,"children":23299},{},[23300],{"type":23,"tag":541,"props":23301,"children":23302},{},[23303,23308,23313,23318],{"type":23,"tag":545,"props":23304,"children":23305},{},[23306],{"type":28,"value":23307},"主机名",{"type":23,"tag":545,"props":23309,"children":23310},{},[23311],{"type":28,"value":23312},"JDK",{"type":23,"tag":545,"props":23314,"children":23315},{},[23316],{"type":28,"value":23317},"ZK",{"type":23,"tag":545,"props":23319,"children":23320},{},[23321],{"type":28,"value":5285},{"type":23,"tag":561,"props":23323,"children":23324},{},[23325,23347,23367],{"type":23,"tag":541,"props":23326,"children":23327},{},[23328,23332,23337,23342],{"type":23,"tag":568,"props":23329,"children":23330},{},[23331],{"type":28,"value":22753},{"type":23,"tag":568,"props":23333,"children":23334},{},[23335],{"type":28,"value":23336},"jdk1.8.0_251",{"type":23,"tag":568,"props":23338,"children":23339},{},[23340],{"type":28,"value":23341},"zookeeper-3.4.14",{"type":23,"tag":568,"props":23343,"children":23344},{},[23345],{"type":28,"value":23346},"kafka_2.11-2.2.0",{"type":23,"tag":541,"props":23348,"children":23349},{},[23350,23355,23359,23363],{"type":23,"tag":568,"props":23351,"children":23352},{},[23353],{"type":28,"value":23354},"slave1",{"type":23,"tag":568,"props":23356,"children":23357},{},[23358],{"type":28,"value":23336},{"type":23,"tag":568,"props":23360,"children":23361},{},[23362],{"type":28,"value":23341},{"type":23,"tag":568,"props":23364,"children":23365},{},[23366],{"type":28,"value":23346},{"type":23,"tag":541,"props":23368,"children":23369},{},[23370,23375,23379,23383],{"type":23,"tag":568,"props":23371,"children":23372},{},[23373],{"type":28,"value":23374},"slave2",{"type":23,"tag":568,"props":23376,"children":23377},{},[23378],{"type":28,"value":23336},{"type":23,"tag":568,"props":23380,"children":23381},{},[23382],{"type":28,"value":23341},{"type":23,"tag":568,"props":23384,"children":23385},{},[23386],{"type":28,"value":23346},{"type":23,"tag":17976,"props":23388,"children":23389},{},[23390],{"type":23,"tag":24,"props":23391,"children":23392},{},[23393,23395,23400],{"type":28,"value":23394},"以下测试请在能够正常生产消费的 ",{"type":23,"tag":99,"props":23396,"children":23398},{"className":23397},[],[23399],{"type":28,"value":19027},{"type":28,"value":23401}," 集群中进行",{"type":23,"tag":50,"props":23403,"children":23405},{"id":23404},"_1-incrementing-自增模式",[23406],{"type":28,"value":23407},"1. incrementing 自增模式",{"type":23,"tag":50,"props":23409,"children":23410},{"id":21531},[23411],{"type":28,"value":21531},{"type":23,"tag":890,"props":23413,"children":23414},{},[23415],{"type":23,"tag":403,"props":23416,"children":23417},{},[23418],{"type":28,"value":23419},"连接 mysql 创建测试库、表",{"type":23,"tag":2152,"props":23421,"children":23423},{"className":19390,"code":23422,"language":19392,"meta":8,"style":8},"mysql> create database test_kafka_connector;\nmysql> use test_kafka_connector;\n\n# 创建 `test_kafka_connector` 库 omneo_incrementing测试表\nCREATE TABLE IF NOT EXISTS test_kafka_connector.omneo_incrementing(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    PRIMARY KEY (pid)\n)ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n# 创建 `kafka_connector` 库 kafka_omneo_incrementing测试表\nCREATE TABLE IF NOT EXISTS kafka_connector.kafka_omneo_incrementing(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    PRIMARY KEY (pid)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;\n",[23424],{"type":23,"tag":99,"props":23425,"children":23426},{"__ignoreMap":8},[23427,23453,23473,23480,23498,23539,23570,23601,23648,23695,23718,23741,23764,23787,23810,23821,23852,23859,23876,23917,23948,23979,24026,24073,24096,24119,24142,24165,24188,24199],{"type":23,"tag":2161,"props":23428,"children":23429},{"class":2163,"line":2164},[23430,23434,23438,23443,23448],{"type":23,"tag":2161,"props":23431,"children":23432},{"style":5830},[23433],{"type":28,"value":21741},{"type":23,"tag":2161,"props":23435,"children":23436},{"style":5948},[23437],{"type":28,"value":12556},{"type":23,"tag":2161,"props":23439,"children":23440},{"style":5948},[23441],{"type":28,"value":23442}," create",{"type":23,"tag":2161,"props":23444,"children":23445},{"style":5948},[23446],{"type":28,"value":23447}," database",{"type":23,"tag":2161,"props":23449,"children":23450},{"style":5830},[23451],{"type":28,"value":23452}," test_kafka_connector;\n",{"type":23,"tag":2161,"props":23454,"children":23455},{"class":2163,"line":927},[23456,23460,23464,23469],{"type":23,"tag":2161,"props":23457,"children":23458},{"style":5830},[23459],{"type":28,"value":21741},{"type":23,"tag":2161,"props":23461,"children":23462},{"style":5948},[23463],{"type":28,"value":12556},{"type":23,"tag":2161,"props":23465,"children":23466},{"style":5948},[23467],{"type":28,"value":23468}," use",{"type":23,"tag":2161,"props":23470,"children":23471},{"style":5830},[23472],{"type":28,"value":23452},{"type":23,"tag":2161,"props":23474,"children":23475},{"class":2163,"line":924},[23476],{"type":23,"tag":2161,"props":23477,"children":23478},{"emptyLinePlaceholder":2176},[23479],{"type":28,"value":2179},{"type":23,"tag":2161,"props":23481,"children":23482},{"class":2163,"line":2190},[23483,23488,23493],{"type":23,"tag":2161,"props":23484,"children":23485},{"style":5830},[23486],{"type":28,"value":23487},"# 创建 ",{"type":23,"tag":2161,"props":23489,"children":23490},{"style":5855},[23491],{"type":28,"value":23492},"`test_kafka_connector`",{"type":23,"tag":2161,"props":23494,"children":23495},{"style":5830},[23496],{"type":28,"value":23497}," 库 omneo_incrementing测试表\n",{"type":23,"tag":2161,"props":23499,"children":23500},{"class":2163,"line":2199},[23501,23505,23509,23513,23517,23521,23526,23530,23535],{"type":23,"tag":2161,"props":23502,"children":23503},{"style":5948},[23504],{"type":28,"value":19424},{"type":23,"tag":2161,"props":23506,"children":23507},{"style":5948},[23508],{"type":28,"value":19429},{"type":23,"tag":2161,"props":23510,"children":23511},{"style":5824},[23512],{"type":28,"value":19434},{"type":23,"tag":2161,"props":23514,"children":23515},{"style":5948},[23516],{"type":28,"value":19439},{"type":23,"tag":2161,"props":23518,"children":23519},{"style":5948},[23520],{"type":28,"value":19444},{"type":23,"tag":2161,"props":23522,"children":23523},{"style":5844},[23524],{"type":28,"value":23525}," test_kafka_connector",{"type":23,"tag":2161,"props":23527,"children":23528},{"style":5830},[23529],{"type":28,"value":19454},{"type":23,"tag":2161,"props":23531,"children":23532},{"style":5844},[23533],{"type":28,"value":23534},"omneo_incrementing",{"type":23,"tag":2161,"props":23536,"children":23537},{"style":5830},[23538],{"type":28,"value":19464},{"type":23,"tag":2161,"props":23540,"children":23541},{"class":2163,"line":2208},[23542,23546,23550,23554,23558,23562,23566],{"type":23,"tag":2161,"props":23543,"children":23544},{"style":5830},[23545],{"type":28,"value":19472},{"type":23,"tag":2161,"props":23547,"children":23548},{"style":5948},[23549],{"type":28,"value":19477},{"type":23,"tag":2161,"props":23551,"children":23552},{"style":5830},[23553],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23555,"children":23556},{"style":5844},[23557],{"type":28,"value":19486},{"type":23,"tag":2161,"props":23559,"children":23560},{"style":5830},[23561],{"type":28,"value":11049},{"type":23,"tag":2161,"props":23563,"children":23564},{"style":5948},[23565],{"type":28,"value":19495},{"type":23,"tag":2161,"props":23567,"children":23568},{"style":5830},[23569],{"type":28,"value":19500},{"type":23,"tag":2161,"props":23571,"children":23572},{"class":2163,"line":2217},[23573,23577,23581,23585,23589,23593,23597],{"type":23,"tag":2161,"props":23574,"children":23575},{"style":5830},[23576],{"type":28,"value":19508},{"type":23,"tag":2161,"props":23578,"children":23579},{"style":5948},[23580],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23582,"children":23583},{"style":5830},[23584],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23586,"children":23587},{"style":5844},[23588],{"type":28,"value":11446},{"type":23,"tag":2161,"props":23590,"children":23591},{"style":5830},[23592],{"type":28,"value":11049},{"type":23,"tag":2161,"props":23594,"children":23595},{"style":5948},[23596],{"type":28,"value":19495},{"type":23,"tag":2161,"props":23598,"children":23599},{"style":5830},[23600],{"type":28,"value":15751},{"type":23,"tag":2161,"props":23602,"children":23603},{"class":2163,"line":2226},[23604,23608,23612,23616,23620,23624,23628,23632,23636,23640,23644],{"type":23,"tag":2161,"props":23605,"children":23606},{"style":5830},[23607],{"type":28,"value":19541},{"type":23,"tag":2161,"props":23609,"children":23610},{"style":5948},[23611],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23613,"children":23614},{"style":5830},[23615],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23617,"children":23618},{"style":5844},[23619],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23621,"children":23622},{"style":5830},[23623],{"type":28,"value":11049},{"type":23,"tag":2161,"props":23625,"children":23626},{"style":5948},[23627],{"type":28,"value":19563},{"type":23,"tag":2161,"props":23629,"children":23630},{"style":5948},[23631],{"type":28,"value":19568},{"type":23,"tag":2161,"props":23633,"children":23634},{"style":5830},[23635],{"type":28,"value":19573},{"type":23,"tag":2161,"props":23637,"children":23638},{"style":5948},[23639],{"type":28,"value":19578},{"type":23,"tag":2161,"props":23641,"children":23642},{"style":5948},[23643],{"type":28,"value":19583},{"type":23,"tag":2161,"props":23645,"children":23646},{"style":5830},[23647],{"type":28,"value":15751},{"type":23,"tag":2161,"props":23649,"children":23650},{"class":2163,"line":2235},[23651,23655,23659,23663,23667,23671,23675,23679,23683,23687,23691],{"type":23,"tag":2161,"props":23652,"children":23653},{"style":5830},[23654],{"type":28,"value":19595},{"type":23,"tag":2161,"props":23656,"children":23657},{"style":5948},[23658],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23660,"children":23661},{"style":5830},[23662],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23664,"children":23665},{"style":5844},[23666],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23668,"children":23669},{"style":5830},[23670],{"type":28,"value":11049},{"type":23,"tag":2161,"props":23672,"children":23673},{"style":5948},[23674],{"type":28,"value":19563},{"type":23,"tag":2161,"props":23676,"children":23677},{"style":5948},[23678],{"type":28,"value":19568},{"type":23,"tag":2161,"props":23680,"children":23681},{"style":5830},[23682],{"type":28,"value":19573},{"type":23,"tag":2161,"props":23684,"children":23685},{"style":5948},[23686],{"type":28,"value":19578},{"type":23,"tag":2161,"props":23688,"children":23689},{"style":5948},[23690],{"type":28,"value":19583},{"type":23,"tag":2161,"props":23692,"children":23693},{"style":5830},[23694],{"type":28,"value":15751},{"type":23,"tag":2161,"props":23696,"children":23697},{"class":2163,"line":2244},[23698,23702,23706,23710,23714],{"type":23,"tag":2161,"props":23699,"children":23700},{"style":5830},[23701],{"type":28,"value":19643},{"type":23,"tag":2161,"props":23703,"children":23704},{"style":5948},[23705],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23707,"children":23708},{"style":5830},[23709],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23711,"children":23712},{"style":5844},[23713],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23715,"children":23716},{"style":5830},[23717],{"type":28,"value":19660},{"type":23,"tag":2161,"props":23719,"children":23720},{"class":2163,"line":2253},[23721,23725,23729,23733,23737],{"type":23,"tag":2161,"props":23722,"children":23723},{"style":5830},[23724],{"type":28,"value":19668},{"type":23,"tag":2161,"props":23726,"children":23727},{"style":5948},[23728],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23730,"children":23731},{"style":5830},[23732],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23734,"children":23735},{"style":5844},[23736],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23738,"children":23739},{"style":5830},[23740],{"type":28,"value":19660},{"type":23,"tag":2161,"props":23742,"children":23743},{"class":2163,"line":6337},[23744,23748,23752,23756,23760],{"type":23,"tag":2161,"props":23745,"children":23746},{"style":5830},[23747],{"type":28,"value":19692},{"type":23,"tag":2161,"props":23749,"children":23750},{"style":5948},[23751],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23753,"children":23754},{"style":5830},[23755],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23757,"children":23758},{"style":5844},[23759],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23761,"children":23762},{"style":5830},[23763],{"type":28,"value":19660},{"type":23,"tag":2161,"props":23765,"children":23766},{"class":2163,"line":6365},[23767,23771,23775,23779,23783],{"type":23,"tag":2161,"props":23768,"children":23769},{"style":5830},[23770],{"type":28,"value":19716},{"type":23,"tag":2161,"props":23772,"children":23773},{"style":5948},[23774],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23776,"children":23777},{"style":5830},[23778],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23780,"children":23781},{"style":5844},[23782],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23784,"children":23785},{"style":5830},[23786],{"type":28,"value":19660},{"type":23,"tag":2161,"props":23788,"children":23789},{"class":2163,"line":6405},[23790,23794,23798,23802,23806],{"type":23,"tag":2161,"props":23791,"children":23792},{"style":5948},[23793],{"type":28,"value":19740},{"type":23,"tag":2161,"props":23795,"children":23796},{"style":5948},[23797],{"type":28,"value":19745},{"type":23,"tag":2161,"props":23799,"children":23800},{"style":5830},[23801],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23803,"children":23804},{"style":5844},[23805],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23807,"children":23808},{"style":5830},[23809],{"type":28,"value":19660},{"type":23,"tag":2161,"props":23811,"children":23812},{"class":2163,"line":19801},[23813,23817],{"type":23,"tag":2161,"props":23814,"children":23815},{"style":5948},[23816],{"type":28,"value":19793},{"type":23,"tag":2161,"props":23818,"children":23819},{"style":5830},[23820],{"type":28,"value":19798},{"type":23,"tag":2161,"props":23822,"children":23823},{"class":2163,"line":19837},[23824,23828,23832,23836,23840,23844,23848],{"type":23,"tag":2161,"props":23825,"children":23826},{"style":5830},[23827],{"type":28,"value":19807},{"type":23,"tag":2161,"props":23829,"children":23830},{"style":5948},[23831],{"type":28,"value":6258},{"type":23,"tag":2161,"props":23833,"children":23834},{"style":5830},[23835],{"type":28,"value":19816},{"type":23,"tag":2161,"props":23837,"children":23838},{"style":5948},[23839],{"type":28,"value":19578},{"type":23,"tag":2161,"props":23841,"children":23842},{"style":5830},[23843],{"type":28,"value":19825},{"type":23,"tag":2161,"props":23845,"children":23846},{"style":5948},[23847],{"type":28,"value":6258},{"type":23,"tag":2161,"props":23849,"children":23850},{"style":5830},[23851],{"type":28,"value":19834},{"type":23,"tag":2161,"props":23853,"children":23854},{"class":2163,"line":19845},[23855],{"type":23,"tag":2161,"props":23856,"children":23857},{"emptyLinePlaceholder":2176},[23858],{"type":28,"value":2179},{"type":23,"tag":2161,"props":23860,"children":23861},{"class":2163,"line":19863},[23862,23866,23871],{"type":23,"tag":2161,"props":23863,"children":23864},{"style":5830},[23865],{"type":28,"value":23487},{"type":23,"tag":2161,"props":23867,"children":23868},{"style":5855},[23869],{"type":28,"value":23870},"`kafka_connector`",{"type":23,"tag":2161,"props":23872,"children":23873},{"style":5830},[23874],{"type":28,"value":23875}," 库 kafka_omneo_incrementing测试表\n",{"type":23,"tag":2161,"props":23877,"children":23878},{"class":2163,"line":19976},[23879,23883,23887,23891,23895,23899,23904,23908,23913],{"type":23,"tag":2161,"props":23880,"children":23881},{"style":5948},[23882],{"type":28,"value":19424},{"type":23,"tag":2161,"props":23884,"children":23885},{"style":5948},[23886],{"type":28,"value":19429},{"type":23,"tag":2161,"props":23888,"children":23889},{"style":5824},[23890],{"type":28,"value":19434},{"type":23,"tag":2161,"props":23892,"children":23893},{"style":5948},[23894],{"type":28,"value":19439},{"type":23,"tag":2161,"props":23896,"children":23897},{"style":5948},[23898],{"type":28,"value":19444},{"type":23,"tag":2161,"props":23900,"children":23901},{"style":5844},[23902],{"type":28,"value":23903}," kafka_connector",{"type":23,"tag":2161,"props":23905,"children":23906},{"style":5830},[23907],{"type":28,"value":19454},{"type":23,"tag":2161,"props":23909,"children":23910},{"style":5844},[23911],{"type":28,"value":23912},"kafka_omneo_incrementing",{"type":23,"tag":2161,"props":23914,"children":23915},{"style":5830},[23916],{"type":28,"value":19464},{"type":23,"tag":2161,"props":23918,"children":23919},{"class":2163,"line":20084},[23920,23924,23928,23932,23936,23940,23944],{"type":23,"tag":2161,"props":23921,"children":23922},{"style":5830},[23923],{"type":28,"value":19472},{"type":23,"tag":2161,"props":23925,"children":23926},{"style":5948},[23927],{"type":28,"value":19477},{"type":23,"tag":2161,"props":23929,"children":23930},{"style":5830},[23931],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23933,"children":23934},{"style":5844},[23935],{"type":28,"value":19486},{"type":23,"tag":2161,"props":23937,"children":23938},{"style":5830},[23939],{"type":28,"value":11049},{"type":23,"tag":2161,"props":23941,"children":23942},{"style":5948},[23943],{"type":28,"value":19495},{"type":23,"tag":2161,"props":23945,"children":23946},{"style":5830},[23947],{"type":28,"value":19500},{"type":23,"tag":2161,"props":23949,"children":23950},{"class":2163,"line":20187},[23951,23955,23959,23963,23967,23971,23975],{"type":23,"tag":2161,"props":23952,"children":23953},{"style":5830},[23954],{"type":28,"value":19508},{"type":23,"tag":2161,"props":23956,"children":23957},{"style":5948},[23958],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23960,"children":23961},{"style":5830},[23962],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23964,"children":23965},{"style":5844},[23966],{"type":28,"value":11446},{"type":23,"tag":2161,"props":23968,"children":23969},{"style":5830},[23970],{"type":28,"value":11049},{"type":23,"tag":2161,"props":23972,"children":23973},{"style":5948},[23974],{"type":28,"value":19495},{"type":23,"tag":2161,"props":23976,"children":23977},{"style":5830},[23978],{"type":28,"value":15751},{"type":23,"tag":2161,"props":23980,"children":23981},{"class":2163,"line":20292},[23982,23986,23990,23994,23998,24002,24006,24010,24014,24018,24022],{"type":23,"tag":2161,"props":23983,"children":23984},{"style":5830},[23985],{"type":28,"value":19541},{"type":23,"tag":2161,"props":23987,"children":23988},{"style":5948},[23989],{"type":28,"value":19513},{"type":23,"tag":2161,"props":23991,"children":23992},{"style":5830},[23993],{"type":28,"value":10486},{"type":23,"tag":2161,"props":23995,"children":23996},{"style":5844},[23997],{"type":28,"value":19554},{"type":23,"tag":2161,"props":23999,"children":24000},{"style":5830},[24001],{"type":28,"value":11049},{"type":23,"tag":2161,"props":24003,"children":24004},{"style":5948},[24005],{"type":28,"value":19563},{"type":23,"tag":2161,"props":24007,"children":24008},{"style":5948},[24009],{"type":28,"value":19568},{"type":23,"tag":2161,"props":24011,"children":24012},{"style":5830},[24013],{"type":28,"value":19573},{"type":23,"tag":2161,"props":24015,"children":24016},{"style":5948},[24017],{"type":28,"value":19578},{"type":23,"tag":2161,"props":24019,"children":24020},{"style":5948},[24021],{"type":28,"value":19583},{"type":23,"tag":2161,"props":24023,"children":24024},{"style":5830},[24025],{"type":28,"value":15751},{"type":23,"tag":2161,"props":24027,"children":24028},{"class":2163,"line":20300},[24029,24033,24037,24041,24045,24049,24053,24057,24061,24065,24069],{"type":23,"tag":2161,"props":24030,"children":24031},{"style":5830},[24032],{"type":28,"value":19595},{"type":23,"tag":2161,"props":24034,"children":24035},{"style":5948},[24036],{"type":28,"value":19513},{"type":23,"tag":2161,"props":24038,"children":24039},{"style":5830},[24040],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24042,"children":24043},{"style":5844},[24044],{"type":28,"value":19554},{"type":23,"tag":2161,"props":24046,"children":24047},{"style":5830},[24048],{"type":28,"value":11049},{"type":23,"tag":2161,"props":24050,"children":24051},{"style":5948},[24052],{"type":28,"value":19563},{"type":23,"tag":2161,"props":24054,"children":24055},{"style":5948},[24056],{"type":28,"value":19568},{"type":23,"tag":2161,"props":24058,"children":24059},{"style":5830},[24060],{"type":28,"value":19573},{"type":23,"tag":2161,"props":24062,"children":24063},{"style":5948},[24064],{"type":28,"value":19578},{"type":23,"tag":2161,"props":24066,"children":24067},{"style":5948},[24068],{"type":28,"value":19583},{"type":23,"tag":2161,"props":24070,"children":24071},{"style":5830},[24072],{"type":28,"value":15751},{"type":23,"tag":2161,"props":24074,"children":24075},{"class":2163,"line":20309},[24076,24080,24084,24088,24092],{"type":23,"tag":2161,"props":24077,"children":24078},{"style":5830},[24079],{"type":28,"value":19643},{"type":23,"tag":2161,"props":24081,"children":24082},{"style":5948},[24083],{"type":28,"value":19513},{"type":23,"tag":2161,"props":24085,"children":24086},{"style":5830},[24087],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24089,"children":24090},{"style":5844},[24091],{"type":28,"value":19554},{"type":23,"tag":2161,"props":24093,"children":24094},{"style":5830},[24095],{"type":28,"value":19660},{"type":23,"tag":2161,"props":24097,"children":24098},{"class":2163,"line":20389},[24099,24103,24107,24111,24115],{"type":23,"tag":2161,"props":24100,"children":24101},{"style":5830},[24102],{"type":28,"value":19668},{"type":23,"tag":2161,"props":24104,"children":24105},{"style":5948},[24106],{"type":28,"value":19513},{"type":23,"tag":2161,"props":24108,"children":24109},{"style":5830},[24110],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24112,"children":24113},{"style":5844},[24114],{"type":28,"value":19554},{"type":23,"tag":2161,"props":24116,"children":24117},{"style":5830},[24118],{"type":28,"value":19660},{"type":23,"tag":2161,"props":24120,"children":24121},{"class":2163,"line":20398},[24122,24126,24130,24134,24138],{"type":23,"tag":2161,"props":24123,"children":24124},{"style":5830},[24125],{"type":28,"value":19692},{"type":23,"tag":2161,"props":24127,"children":24128},{"style":5948},[24129],{"type":28,"value":19513},{"type":23,"tag":2161,"props":24131,"children":24132},{"style":5830},[24133],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24135,"children":24136},{"style":5844},[24137],{"type":28,"value":19554},{"type":23,"tag":2161,"props":24139,"children":24140},{"style":5830},[24141],{"type":28,"value":19660},{"type":23,"tag":2161,"props":24143,"children":24144},{"class":2163,"line":20934},[24145,24149,24153,24157,24161],{"type":23,"tag":2161,"props":24146,"children":24147},{"style":5830},[24148],{"type":28,"value":19716},{"type":23,"tag":2161,"props":24150,"children":24151},{"style":5948},[24152],{"type":28,"value":19513},{"type":23,"tag":2161,"props":24154,"children":24155},{"style":5830},[24156],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24158,"children":24159},{"style":5844},[24160],{"type":28,"value":19554},{"type":23,"tag":2161,"props":24162,"children":24163},{"style":5830},[24164],{"type":28,"value":19660},{"type":23,"tag":2161,"props":24166,"children":24167},{"class":2163,"line":20943},[24168,24172,24176,24180,24184],{"type":23,"tag":2161,"props":24169,"children":24170},{"style":5948},[24171],{"type":28,"value":19740},{"type":23,"tag":2161,"props":24173,"children":24174},{"style":5948},[24175],{"type":28,"value":19745},{"type":23,"tag":2161,"props":24177,"children":24178},{"style":5830},[24179],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24181,"children":24182},{"style":5844},[24183],{"type":28,"value":19554},{"type":23,"tag":2161,"props":24185,"children":24186},{"style":5830},[24187],{"type":28,"value":19660},{"type":23,"tag":2161,"props":24189,"children":24190},{"class":2163,"line":20951},[24191,24195],{"type":23,"tag":2161,"props":24192,"children":24193},{"style":5948},[24194],{"type":28,"value":19793},{"type":23,"tag":2161,"props":24196,"children":24197},{"style":5830},[24198],{"type":28,"value":19798},{"type":23,"tag":2161,"props":24200,"children":24201},{"class":2163,"line":20960},[24202,24207,24211,24215,24219,24223,24227,24232,24237],{"type":23,"tag":2161,"props":24203,"children":24204},{"style":5830},[24205],{"type":28,"value":24206},") ENGINE",{"type":23,"tag":2161,"props":24208,"children":24209},{"style":5948},[24210],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24212,"children":24213},{"style":5830},[24214],{"type":28,"value":19816},{"type":23,"tag":2161,"props":24216,"children":24217},{"style":5948},[24218],{"type":28,"value":19578},{"type":23,"tag":2161,"props":24220,"children":24221},{"style":5830},[24222],{"type":28,"value":19825},{"type":23,"tag":2161,"props":24224,"children":24225},{"style":5948},[24226],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24228,"children":24229},{"style":5830},[24230],{"type":28,"value":24231},"utf8 ",{"type":23,"tag":2161,"props":24233,"children":24234},{"style":5948},[24235],{"type":28,"value":24236},"COLLATE=",{"type":23,"tag":2161,"props":24238,"children":24239},{"style":5830},[24240],{"type":28,"value":24241},"utf8_bin;\n",{"type":23,"tag":890,"props":24243,"children":24244},{"start":927},[24245],{"type":23,"tag":403,"props":24246,"children":24247},{},[24248,24250,24256,24258,24264],{"type":28,"value":24249},"切换至 ",{"type":23,"tag":99,"props":24251,"children":24253},{"className":24252},[],[24254],{"type":28,"value":24255},"$KAFKA_HOME\u002Fconfig",{"type":28,"value":24257}," 目录，修改\u002F新增 ",{"type":23,"tag":99,"props":24259,"children":24261},{"className":24260},[],[24262],{"type":28,"value":24263},"source-incrementing-mysql.properties",{"type":28,"value":24265}," ，内容如下：",{"type":23,"tag":2152,"props":24267,"children":24269},{"className":20588,"code":24268,"language":20590,"meta":8,"style":8},"name=mysql-a-source-omneo\nconnector.class=io.confluent.connect.jdbc.JdbcSourceConnector\ntasks.max=1\nconnection.url=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Ftest_kafka_connector?user=root&password=1qaz@WSX\n# incrementing  自增\nmode=incrementing\n# 自增字段  pid\nincrementing.column.name=pid\n# 白名单表  person\ntable.whitelist=omneo_incrementing\n# topic前缀   mysql-kafka-\ntopic.prefix=mysql-kafka-\n",[24270],{"type":23,"tag":99,"props":24271,"children":24272},{"__ignoreMap":8},[24273,24289,24302,24315,24342,24350,24367,24375,24388,24396,24409,24417],{"type":23,"tag":2161,"props":24274,"children":24275},{"class":2163,"line":2164},[24276,24280,24284],{"type":23,"tag":2161,"props":24277,"children":24278},{"style":5830},[24279],{"type":28,"value":15227},{"type":23,"tag":2161,"props":24281,"children":24282},{"style":5948},[24283],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24285,"children":24286},{"style":5855},[24287],{"type":28,"value":24288},"mysql-a-source-omneo\n",{"type":23,"tag":2161,"props":24290,"children":24291},{"class":2163,"line":927},[24292,24297],{"type":23,"tag":2161,"props":24293,"children":24294},{"style":5824},[24295],{"type":28,"value":24296},"connector.class",{"type":23,"tag":2161,"props":24298,"children":24299},{"style":5855},[24300],{"type":28,"value":24301},"=io.confluent.connect.jdbc.JdbcSourceConnector\n",{"type":23,"tag":2161,"props":24303,"children":24304},{"class":2163,"line":924},[24305,24310],{"type":23,"tag":2161,"props":24306,"children":24307},{"style":5824},[24308],{"type":28,"value":24309},"tasks.max",{"type":23,"tag":2161,"props":24311,"children":24312},{"style":5855},[24313],{"type":28,"value":24314},"=1\n",{"type":23,"tag":2161,"props":24316,"children":24317},{"class":2163,"line":2190},[24318,24323,24328,24333,24337],{"type":23,"tag":2161,"props":24319,"children":24320},{"style":5824},[24321],{"type":28,"value":24322},"connection.url",{"type":23,"tag":2161,"props":24324,"children":24325},{"style":5855},[24326],{"type":28,"value":24327},"=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Ftest_kafka_connector?user=root",{"type":23,"tag":2161,"props":24329,"children":24330},{"style":5830},[24331],{"type":28,"value":24332},"&password",{"type":23,"tag":2161,"props":24334,"children":24335},{"style":5948},[24336],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24338,"children":24339},{"style":5855},[24340],{"type":28,"value":24341},"1qaz@WSX\n",{"type":23,"tag":2161,"props":24343,"children":24344},{"class":2163,"line":2199},[24345],{"type":23,"tag":2161,"props":24346,"children":24347},{"style":5807},[24348],{"type":28,"value":24349},"# incrementing  自增\n",{"type":23,"tag":2161,"props":24351,"children":24352},{"class":2163,"line":2208},[24353,24358,24362],{"type":23,"tag":2161,"props":24354,"children":24355},{"style":5830},[24356],{"type":28,"value":24357},"mode",{"type":23,"tag":2161,"props":24359,"children":24360},{"style":5948},[24361],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24363,"children":24364},{"style":5855},[24365],{"type":28,"value":24366},"incrementing\n",{"type":23,"tag":2161,"props":24368,"children":24369},{"class":2163,"line":2217},[24370],{"type":23,"tag":2161,"props":24371,"children":24372},{"style":5807},[24373],{"type":28,"value":24374},"# 自增字段  pid\n",{"type":23,"tag":2161,"props":24376,"children":24377},{"class":2163,"line":2226},[24378,24383],{"type":23,"tag":2161,"props":24379,"children":24380},{"style":5824},[24381],{"type":28,"value":24382},"incrementing.column.name",{"type":23,"tag":2161,"props":24384,"children":24385},{"style":5855},[24386],{"type":28,"value":24387},"=pid\n",{"type":23,"tag":2161,"props":24389,"children":24390},{"class":2163,"line":2235},[24391],{"type":23,"tag":2161,"props":24392,"children":24393},{"style":5807},[24394],{"type":28,"value":24395},"# 白名单表  person\n",{"type":23,"tag":2161,"props":24397,"children":24398},{"class":2163,"line":2244},[24399,24404],{"type":23,"tag":2161,"props":24400,"children":24401},{"style":5824},[24402],{"type":28,"value":24403},"table.whitelist",{"type":23,"tag":2161,"props":24405,"children":24406},{"style":5855},[24407],{"type":28,"value":24408},"=omneo_incrementing\n",{"type":23,"tag":2161,"props":24410,"children":24411},{"class":2163,"line":2253},[24412],{"type":23,"tag":2161,"props":24413,"children":24414},{"style":5807},[24415],{"type":28,"value":24416},"# topic前缀   mysql-kafka-\n",{"type":23,"tag":2161,"props":24418,"children":24419},{"class":2163,"line":6337},[24420,24425],{"type":23,"tag":2161,"props":24421,"children":24422},{"style":5824},[24423],{"type":28,"value":24424},"topic.prefix",{"type":23,"tag":2161,"props":24426,"children":24427},{"style":5855},[24428],{"type":28,"value":24429},"=mysql-kafka-\n",{"type":23,"tag":890,"props":24431,"children":24432},{"start":924},[24433],{"type":23,"tag":403,"props":24434,"children":24435},{},[24436,24438,24444],{"type":28,"value":24437},"修改、新增 ",{"type":23,"tag":99,"props":24439,"children":24441},{"className":24440},[],[24442],{"type":28,"value":24443},"sink-incrementing-mysql.properties",{"type":28,"value":24265},{"type":23,"tag":2152,"props":24446,"children":24448},{"className":20588,"code":24447,"language":20590,"meta":8,"style":8},"name=mysql-a-sink-omneo\nconnector.class=io.confluent.connect.jdbc.JdbcSinkConnector\ntasks.max=1\n#kafka的topic名称\ntopics=mysql-kafka-omneo_incrementing\n# 配置JDBC链接\nconnection.url=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Fkafka_connector?user=root&password=1qaz@WSX\n# 不自动创建表，如果为true，会自动创建表，表名为topic名称\nauto.create=false\n# upsert model更新和插入\ninsert.mode=upsert\n# 下面两个参数配置了以pid为主键更新\npk.mode = record_value\npk.fields = pid\n#表名为kafkatable\ntable.name.format=kafka_omneo_incrementing\n",[24449],{"type":23,"tag":99,"props":24450,"children":24451},{"__ignoreMap":8},[24452,24468,24480,24491,24499,24516,24524,24548,24556,24573,24581,24594,24602,24620,24637,24645],{"type":23,"tag":2161,"props":24453,"children":24454},{"class":2163,"line":2164},[24455,24459,24463],{"type":23,"tag":2161,"props":24456,"children":24457},{"style":5830},[24458],{"type":28,"value":15227},{"type":23,"tag":2161,"props":24460,"children":24461},{"style":5948},[24462],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24464,"children":24465},{"style":5855},[24466],{"type":28,"value":24467},"mysql-a-sink-omneo\n",{"type":23,"tag":2161,"props":24469,"children":24470},{"class":2163,"line":927},[24471,24475],{"type":23,"tag":2161,"props":24472,"children":24473},{"style":5824},[24474],{"type":28,"value":24296},{"type":23,"tag":2161,"props":24476,"children":24477},{"style":5855},[24478],{"type":28,"value":24479},"=io.confluent.connect.jdbc.JdbcSinkConnector\n",{"type":23,"tag":2161,"props":24481,"children":24482},{"class":2163,"line":924},[24483,24487],{"type":23,"tag":2161,"props":24484,"children":24485},{"style":5824},[24486],{"type":28,"value":24309},{"type":23,"tag":2161,"props":24488,"children":24489},{"style":5855},[24490],{"type":28,"value":24314},{"type":23,"tag":2161,"props":24492,"children":24493},{"class":2163,"line":2190},[24494],{"type":23,"tag":2161,"props":24495,"children":24496},{"style":5807},[24497],{"type":28,"value":24498},"#kafka的topic名称\n",{"type":23,"tag":2161,"props":24500,"children":24501},{"class":2163,"line":2199},[24502,24507,24511],{"type":23,"tag":2161,"props":24503,"children":24504},{"style":5830},[24505],{"type":28,"value":24506},"topics",{"type":23,"tag":2161,"props":24508,"children":24509},{"style":5948},[24510],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24512,"children":24513},{"style":5855},[24514],{"type":28,"value":24515},"mysql-kafka-omneo_incrementing\n",{"type":23,"tag":2161,"props":24517,"children":24518},{"class":2163,"line":2208},[24519],{"type":23,"tag":2161,"props":24520,"children":24521},{"style":5807},[24522],{"type":28,"value":24523},"# 配置JDBC链接\n",{"type":23,"tag":2161,"props":24525,"children":24526},{"class":2163,"line":2217},[24527,24531,24536,24540,24544],{"type":23,"tag":2161,"props":24528,"children":24529},{"style":5824},[24530],{"type":28,"value":24322},{"type":23,"tag":2161,"props":24532,"children":24533},{"style":5855},[24534],{"type":28,"value":24535},"=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Fkafka_connector?user=root",{"type":23,"tag":2161,"props":24537,"children":24538},{"style":5830},[24539],{"type":28,"value":24332},{"type":23,"tag":2161,"props":24541,"children":24542},{"style":5948},[24543],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24545,"children":24546},{"style":5855},[24547],{"type":28,"value":24341},{"type":23,"tag":2161,"props":24549,"children":24550},{"class":2163,"line":2226},[24551],{"type":23,"tag":2161,"props":24552,"children":24553},{"style":5807},[24554],{"type":28,"value":24555},"# 不自动创建表，如果为true，会自动创建表，表名为topic名称\n",{"type":23,"tag":2161,"props":24557,"children":24558},{"class":2163,"line":2235},[24559,24564,24568],{"type":23,"tag":2161,"props":24560,"children":24561},{"style":5824},[24562],{"type":28,"value":24563},"auto.create",{"type":23,"tag":2161,"props":24565,"children":24566},{"style":5855},[24567],{"type":28,"value":6258},{"type":23,"tag":2161,"props":24569,"children":24570},{"style":5844},[24571],{"type":28,"value":24572},"false\n",{"type":23,"tag":2161,"props":24574,"children":24575},{"class":2163,"line":2244},[24576],{"type":23,"tag":2161,"props":24577,"children":24578},{"style":5807},[24579],{"type":28,"value":24580},"# upsert model更新和插入\n",{"type":23,"tag":2161,"props":24582,"children":24583},{"class":2163,"line":2253},[24584,24589],{"type":23,"tag":2161,"props":24585,"children":24586},{"style":5824},[24587],{"type":28,"value":24588},"insert.mode",{"type":23,"tag":2161,"props":24590,"children":24591},{"style":5855},[24592],{"type":28,"value":24593},"=upsert\n",{"type":23,"tag":2161,"props":24595,"children":24596},{"class":2163,"line":6337},[24597],{"type":23,"tag":2161,"props":24598,"children":24599},{"style":5807},[24600],{"type":28,"value":24601},"# 下面两个参数配置了以pid为主键更新\n",{"type":23,"tag":2161,"props":24603,"children":24604},{"class":2163,"line":6365},[24605,24610,24615],{"type":23,"tag":2161,"props":24606,"children":24607},{"style":5824},[24608],{"type":28,"value":24609},"pk.mode",{"type":23,"tag":2161,"props":24611,"children":24612},{"style":5855},[24613],{"type":28,"value":24614}," =",{"type":23,"tag":2161,"props":24616,"children":24617},{"style":5855},[24618],{"type":28,"value":24619}," record_value\n",{"type":23,"tag":2161,"props":24621,"children":24622},{"class":2163,"line":6405},[24623,24628,24632],{"type":23,"tag":2161,"props":24624,"children":24625},{"style":5824},[24626],{"type":28,"value":24627},"pk.fields",{"type":23,"tag":2161,"props":24629,"children":24630},{"style":5855},[24631],{"type":28,"value":24614},{"type":23,"tag":2161,"props":24633,"children":24634},{"style":5855},[24635],{"type":28,"value":24636}," pid\n",{"type":23,"tag":2161,"props":24638,"children":24639},{"class":2163,"line":19801},[24640],{"type":23,"tag":2161,"props":24641,"children":24642},{"style":5807},[24643],{"type":28,"value":24644},"#表名为kafkatable\n",{"type":23,"tag":2161,"props":24646,"children":24647},{"class":2163,"line":19837},[24648,24653],{"type":23,"tag":2161,"props":24649,"children":24650},{"style":5824},[24651],{"type":28,"value":24652},"table.name.format",{"type":23,"tag":2161,"props":24654,"children":24655},{"style":5855},[24656],{"type":28,"value":24657},"=kafka_omneo_incrementing\n",{"type":23,"tag":890,"props":24659,"children":24660},{"start":2190},[24661],{"type":23,"tag":403,"props":24662,"children":24663},{},[24664,24666,24671,24673,24679],{"type":28,"value":24665},"创建 ",{"type":23,"tag":86,"props":24667,"children":24668},{},[24669],{"type":28,"value":24670},"kafka topic",{"type":28,"value":24672}," ",{"type":23,"tag":99,"props":24674,"children":24676},{"className":24675},[],[24677],{"type":28,"value":24678},"mysql-kafka-omneo-incrementing",{"type":28,"value":24680}," ，命令如下",{"type":23,"tag":2152,"props":24682,"children":24684},{"className":20588,"code":24683,"language":20590,"meta":8,"style":8},"kafka-topics.sh --create --zookeeper master:2181 --replication-factor 1 --partitions 1 --topic mysql-kafka-omneo-incrementing\n",[24685],{"type":23,"tag":99,"props":24686,"children":24687},{"__ignoreMap":8},[24688],{"type":23,"tag":2161,"props":24689,"children":24690},{"class":2163,"line":2164},[24691,24696,24701,24706,24711,24716,24720,24725,24729,24734],{"type":23,"tag":2161,"props":24692,"children":24693},{"style":5824},[24694],{"type":28,"value":24695},"kafka-topics.sh",{"type":23,"tag":2161,"props":24697,"children":24698},{"style":5844},[24699],{"type":28,"value":24700}," --create",{"type":23,"tag":2161,"props":24702,"children":24703},{"style":5844},[24704],{"type":28,"value":24705}," --zookeeper",{"type":23,"tag":2161,"props":24707,"children":24708},{"style":5855},[24709],{"type":28,"value":24710}," master:2181",{"type":23,"tag":2161,"props":24712,"children":24713},{"style":5844},[24714],{"type":28,"value":24715}," --replication-factor",{"type":23,"tag":2161,"props":24717,"children":24718},{"style":5844},[24719],{"type":28,"value":6175},{"type":23,"tag":2161,"props":24721,"children":24722},{"style":5844},[24723],{"type":28,"value":24724}," --partitions",{"type":23,"tag":2161,"props":24726,"children":24727},{"style":5844},[24728],{"type":28,"value":6175},{"type":23,"tag":2161,"props":24730,"children":24731},{"style":5844},[24732],{"type":28,"value":24733}," --topic",{"type":23,"tag":2161,"props":24735,"children":24736},{"style":5855},[24737],{"type":28,"value":24738}," mysql-kafka-omneo-incrementing\n",{"type":23,"tag":890,"props":24740,"children":24741},{"start":2199},[24742],{"type":23,"tag":403,"props":24743,"children":24744},{},[24745,24747,24753],{"type":28,"value":24746},"启动 ",{"type":23,"tag":99,"props":24748,"children":24750},{"className":24749},[],[24751],{"type":28,"value":24752},"kafka connect",{"type":28,"value":24680},{"type":23,"tag":2152,"props":24755,"children":24757},{"className":20588,"code":24756,"language":20590,"meta":8,"style":8},"connect-standalone.sh $KAFKA_HOME\u002Fconfig\u002Fconnect-standalone.properties $KAFKA_HOME\u002Fconfig\u002Fsource-incrementing-mysql.properties $KAFKA_HOME\u002Fconfig\u002Fsink-incrementing-mysql.properties\n",[24758],{"type":23,"tag":99,"props":24759,"children":24760},{"__ignoreMap":8},[24761],{"type":23,"tag":2161,"props":24762,"children":24763},{"class":2163,"line":2164},[24764,24769,24774,24779,24783,24788,24792],{"type":23,"tag":2161,"props":24765,"children":24766},{"style":5824},[24767],{"type":28,"value":24768},"connect-standalone.sh",{"type":23,"tag":2161,"props":24770,"children":24771},{"style":5830},[24772],{"type":28,"value":24773}," $KAFKA_HOME",{"type":23,"tag":2161,"props":24775,"children":24776},{"style":5855},[24777],{"type":28,"value":24778},"\u002Fconfig\u002Fconnect-standalone.properties",{"type":23,"tag":2161,"props":24780,"children":24781},{"style":5830},[24782],{"type":28,"value":24773},{"type":23,"tag":2161,"props":24784,"children":24785},{"style":5855},[24786],{"type":28,"value":24787},"\u002Fconfig\u002Fsource-incrementing-mysql.properties",{"type":23,"tag":2161,"props":24789,"children":24790},{"style":5830},[24791],{"type":28,"value":24773},{"type":23,"tag":2161,"props":24793,"children":24794},{"style":5855},[24795],{"type":28,"value":24796},"\u002Fconfig\u002Fsink-incrementing-mysql.properties\n",{"type":23,"tag":24,"props":24798,"children":24799},{},[24800],{"type":28,"value":24801},"启动成功如下图所示",{"type":23,"tag":24,"props":24803,"children":24804},{},[24805],{"type":23,"tag":65,"props":24806,"children":24808},{"alt":8,"src":24807},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-1fb3ed113eb6fb2a.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":24810,"children":24811},{"start":2208},[24812],{"type":23,"tag":403,"props":24813,"children":24814},{},[24815,24817,24823],{"type":28,"value":24816},"向 ",{"type":23,"tag":99,"props":24818,"children":24820},{"className":24819},[],[24821],{"type":28,"value":24822},"test_kafka_connector.omneo_incrementing",{"type":28,"value":24824}," 插入10条测试数据",{"type":23,"tag":2152,"props":24826,"children":24828},{"className":19390,"code":24827,"language":19392,"meta":8,"style":8},"insert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(1,'3280983542a7-5bdb-d564-3133-276ae3ce','Nicole','Spaggiari','06\u002F03\u002F1942','34270','Miami','female','maried');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(2,'9089753542a7-5bdb-d564-3133-276ae3ce','Gaelle','O''Dell','23\u002F09\u002F2002','05274','Ottawa','unknown','en couple');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(3,'8939383542a7-5bdb-d564-3133-276ae3ce','Kevin','Spaggiari','23\u002F05\u002F1965','H2M1N6','Maugio','unknown','single');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(4,'8379693542a7-5bdb-d564-3133-276ae3ce','Gauthier','O''Dell','30\u002F06\u002F1998','05274','Cocagne','male','maried');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(5,'9186073542a7-5bdb-d564-3133-276ae3ce','Gauthier','Garbuet','20\u002F03\u002F2000','34920','Ballancourt','female','en couple');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(6,'8983983542a7-5bdb-d564-3133-276ae3ce','Gaelle','Berrouard','20\u002F05\u002F1946','91610','Cocagne','female','en couple');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(7,'4518023542a7-5bdb-d564-3133-276ae3ce','Nicole','Spaggiari','30\u002F06\u002F1998','34920','Le Cres','male','veuve');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(8,'9721973542a7-5bdb-d564-3133-276ae3ce','Maurice','Berrouard','23\u002F05\u002F1965','H2M1N6','Ballancourt','male','en couple');\ninsert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(9,'4037673542a7-5bdb-d564-3133-276ae3ce','Gaelle','Berrouard','30\u002F06\u002F1998','H2M2V5','Ballancourt','male','single');\n",[24829],{"type":23,"tag":99,"props":24830,"children":24831},{"__ignoreMap":8},[24832,24940,25047,25152,25256,25360,25463,25566,25667],{"type":23,"tag":2161,"props":24833,"children":24834},{"class":2163,"line":2164},[24835,24839,24844,24848,24852,24856,24860,24864,24868,24873,24877,24882,24886,24891,24895,24900,24904,24909,24913,24918,24922,24927,24931,24936],{"type":23,"tag":2161,"props":24836,"children":24837},{"style":5948},[24838],{"type":28,"value":19869},{"type":23,"tag":2161,"props":24840,"children":24841},{"style":5830},[24842],{"type":28,"value":24843}," omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, ",{"type":23,"tag":2161,"props":24845,"children":24846},{"style":5948},[24847],{"type":28,"value":11551},{"type":23,"tag":2161,"props":24849,"children":24850},{"style":5830},[24851],{"type":28,"value":11049},{"type":23,"tag":2161,"props":24853,"children":24854},{"style":5948},[24855],{"type":28,"value":19879},{"type":23,"tag":2161,"props":24857,"children":24858},{"style":5830},[24859],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24861,"children":24862},{"style":5844},[24863],{"type":28,"value":3641},{"type":23,"tag":2161,"props":24865,"children":24866},{"style":5830},[24867],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24869,"children":24870},{"style":5855},[24871],{"type":28,"value":24872},"'3280983542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":24874,"children":24875},{"style":5830},[24876],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24878,"children":24879},{"style":5855},[24880],{"type":28,"value":24881},"'Nicole'",{"type":23,"tag":2161,"props":24883,"children":24884},{"style":5830},[24885],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24887,"children":24888},{"style":5855},[24889],{"type":28,"value":24890},"'Spaggiari'",{"type":23,"tag":2161,"props":24892,"children":24893},{"style":5830},[24894],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24896,"children":24897},{"style":5855},[24898],{"type":28,"value":24899},"'06\u002F03\u002F1942'",{"type":23,"tag":2161,"props":24901,"children":24902},{"style":5830},[24903],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24905,"children":24906},{"style":5855},[24907],{"type":28,"value":24908},"'34270'",{"type":23,"tag":2161,"props":24910,"children":24911},{"style":5830},[24912],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24914,"children":24915},{"style":5855},[24916],{"type":28,"value":24917},"'Miami'",{"type":23,"tag":2161,"props":24919,"children":24920},{"style":5830},[24921],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24923,"children":24924},{"style":5855},[24925],{"type":28,"value":24926},"'female'",{"type":23,"tag":2161,"props":24928,"children":24929},{"style":5830},[24930],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24932,"children":24933},{"style":5855},[24934],{"type":28,"value":24935},"'maried'",{"type":23,"tag":2161,"props":24937,"children":24938},{"style":5830},[24939],{"type":28,"value":10626},{"type":23,"tag":2161,"props":24941,"children":24942},{"class":2163,"line":927},[24943,24947,24951,24955,24959,24963,24967,24971,24975,24980,24984,24989,24993,24998,25002,25007,25011,25016,25020,25025,25029,25034,25038,25043],{"type":23,"tag":2161,"props":24944,"children":24945},{"style":5948},[24946],{"type":28,"value":19869},{"type":23,"tag":2161,"props":24948,"children":24949},{"style":5830},[24950],{"type":28,"value":24843},{"type":23,"tag":2161,"props":24952,"children":24953},{"style":5948},[24954],{"type":28,"value":11551},{"type":23,"tag":2161,"props":24956,"children":24957},{"style":5830},[24958],{"type":28,"value":11049},{"type":23,"tag":2161,"props":24960,"children":24961},{"style":5948},[24962],{"type":28,"value":19879},{"type":23,"tag":2161,"props":24964,"children":24965},{"style":5830},[24966],{"type":28,"value":10486},{"type":23,"tag":2161,"props":24968,"children":24969},{"style":5844},[24970],{"type":28,"value":3664},{"type":23,"tag":2161,"props":24972,"children":24973},{"style":5830},[24974],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24976,"children":24977},{"style":5855},[24978],{"type":28,"value":24979},"'9089753542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":24981,"children":24982},{"style":5830},[24983],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24985,"children":24986},{"style":5855},[24987],{"type":28,"value":24988},"'Gaelle'",{"type":23,"tag":2161,"props":24990,"children":24991},{"style":5830},[24992],{"type":28,"value":19892},{"type":23,"tag":2161,"props":24994,"children":24995},{"style":5855},[24996],{"type":28,"value":24997},"'O''Dell'",{"type":23,"tag":2161,"props":24999,"children":25000},{"style":5830},[25001],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25003,"children":25004},{"style":5855},[25005],{"type":28,"value":25006},"'23\u002F09\u002F2002'",{"type":23,"tag":2161,"props":25008,"children":25009},{"style":5830},[25010],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25012,"children":25013},{"style":5855},[25014],{"type":28,"value":25015},"'05274'",{"type":23,"tag":2161,"props":25017,"children":25018},{"style":5830},[25019],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25021,"children":25022},{"style":5855},[25023],{"type":28,"value":25024},"'Ottawa'",{"type":23,"tag":2161,"props":25026,"children":25027},{"style":5830},[25028],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25030,"children":25031},{"style":5855},[25032],{"type":28,"value":25033},"'unknown'",{"type":23,"tag":2161,"props":25035,"children":25036},{"style":5830},[25037],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25039,"children":25040},{"style":5855},[25041],{"type":28,"value":25042},"'en couple'",{"type":23,"tag":2161,"props":25044,"children":25045},{"style":5830},[25046],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25048,"children":25049},{"class":2163,"line":924},[25050,25054,25058,25062,25066,25070,25074,25078,25082,25087,25091,25096,25100,25104,25108,25113,25117,25122,25126,25131,25135,25139,25143,25148],{"type":23,"tag":2161,"props":25051,"children":25052},{"style":5948},[25053],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25055,"children":25056},{"style":5830},[25057],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25059,"children":25060},{"style":5948},[25061],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25063,"children":25064},{"style":5830},[25065],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25067,"children":25068},{"style":5948},[25069],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25071,"children":25072},{"style":5830},[25073],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25075,"children":25076},{"style":5844},[25077],{"type":28,"value":3687},{"type":23,"tag":2161,"props":25079,"children":25080},{"style":5830},[25081],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25083,"children":25084},{"style":5855},[25085],{"type":28,"value":25086},"'8939383542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25088,"children":25089},{"style":5830},[25090],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25092,"children":25093},{"style":5855},[25094],{"type":28,"value":25095},"'Kevin'",{"type":23,"tag":2161,"props":25097,"children":25098},{"style":5830},[25099],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25101,"children":25102},{"style":5855},[25103],{"type":28,"value":24890},{"type":23,"tag":2161,"props":25105,"children":25106},{"style":5830},[25107],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25109,"children":25110},{"style":5855},[25111],{"type":28,"value":25112},"'23\u002F05\u002F1965'",{"type":23,"tag":2161,"props":25114,"children":25115},{"style":5830},[25116],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25118,"children":25119},{"style":5855},[25120],{"type":28,"value":25121},"'H2M1N6'",{"type":23,"tag":2161,"props":25123,"children":25124},{"style":5830},[25125],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25127,"children":25128},{"style":5855},[25129],{"type":28,"value":25130},"'Maugio'",{"type":23,"tag":2161,"props":25132,"children":25133},{"style":5830},[25134],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25136,"children":25137},{"style":5855},[25138],{"type":28,"value":25033},{"type":23,"tag":2161,"props":25140,"children":25141},{"style":5830},[25142],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25144,"children":25145},{"style":5855},[25146],{"type":28,"value":25147},"'single'",{"type":23,"tag":2161,"props":25149,"children":25150},{"style":5830},[25151],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25153,"children":25154},{"class":2163,"line":2190},[25155,25159,25163,25167,25171,25175,25179,25183,25187,25192,25196,25201,25205,25209,25213,25218,25222,25226,25230,25235,25239,25244,25248,25252],{"type":23,"tag":2161,"props":25156,"children":25157},{"style":5948},[25158],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25160,"children":25161},{"style":5830},[25162],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25164,"children":25165},{"style":5948},[25166],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25168,"children":25169},{"style":5830},[25170],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25172,"children":25173},{"style":5948},[25174],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25176,"children":25177},{"style":5830},[25178],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25180,"children":25181},{"style":5844},[25182],{"type":28,"value":3710},{"type":23,"tag":2161,"props":25184,"children":25185},{"style":5830},[25186],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25188,"children":25189},{"style":5855},[25190],{"type":28,"value":25191},"'8379693542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25193,"children":25194},{"style":5830},[25195],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25197,"children":25198},{"style":5855},[25199],{"type":28,"value":25200},"'Gauthier'",{"type":23,"tag":2161,"props":25202,"children":25203},{"style":5830},[25204],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25206,"children":25207},{"style":5855},[25208],{"type":28,"value":24997},{"type":23,"tag":2161,"props":25210,"children":25211},{"style":5830},[25212],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25214,"children":25215},{"style":5855},[25216],{"type":28,"value":25217},"'30\u002F06\u002F1998'",{"type":23,"tag":2161,"props":25219,"children":25220},{"style":5830},[25221],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25223,"children":25224},{"style":5855},[25225],{"type":28,"value":25015},{"type":23,"tag":2161,"props":25227,"children":25228},{"style":5830},[25229],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25231,"children":25232},{"style":5855},[25233],{"type":28,"value":25234},"'Cocagne'",{"type":23,"tag":2161,"props":25236,"children":25237},{"style":5830},[25238],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25240,"children":25241},{"style":5855},[25242],{"type":28,"value":25243},"'male'",{"type":23,"tag":2161,"props":25245,"children":25246},{"style":5830},[25247],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25249,"children":25250},{"style":5855},[25251],{"type":28,"value":24935},{"type":23,"tag":2161,"props":25253,"children":25254},{"style":5830},[25255],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25257,"children":25258},{"class":2163,"line":2199},[25259,25263,25267,25271,25275,25279,25283,25287,25291,25296,25300,25304,25308,25313,25317,25322,25326,25331,25335,25340,25344,25348,25352,25356],{"type":23,"tag":2161,"props":25260,"children":25261},{"style":5948},[25262],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25264,"children":25265},{"style":5830},[25266],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25268,"children":25269},{"style":5948},[25270],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25272,"children":25273},{"style":5830},[25274],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25276,"children":25277},{"style":5948},[25278],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25280,"children":25281},{"style":5830},[25282],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25284,"children":25285},{"style":5844},[25286],{"type":28,"value":3741},{"type":23,"tag":2161,"props":25288,"children":25289},{"style":5830},[25290],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25292,"children":25293},{"style":5855},[25294],{"type":28,"value":25295},"'9186073542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25297,"children":25298},{"style":5830},[25299],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25301,"children":25302},{"style":5855},[25303],{"type":28,"value":25200},{"type":23,"tag":2161,"props":25305,"children":25306},{"style":5830},[25307],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25309,"children":25310},{"style":5855},[25311],{"type":28,"value":25312},"'Garbuet'",{"type":23,"tag":2161,"props":25314,"children":25315},{"style":5830},[25316],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25318,"children":25319},{"style":5855},[25320],{"type":28,"value":25321},"'20\u002F03\u002F2000'",{"type":23,"tag":2161,"props":25323,"children":25324},{"style":5830},[25325],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25327,"children":25328},{"style":5855},[25329],{"type":28,"value":25330},"'34920'",{"type":23,"tag":2161,"props":25332,"children":25333},{"style":5830},[25334],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25336,"children":25337},{"style":5855},[25338],{"type":28,"value":25339},"'Ballancourt'",{"type":23,"tag":2161,"props":25341,"children":25342},{"style":5830},[25343],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25345,"children":25346},{"style":5855},[25347],{"type":28,"value":24926},{"type":23,"tag":2161,"props":25349,"children":25350},{"style":5830},[25351],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25353,"children":25354},{"style":5855},[25355],{"type":28,"value":25042},{"type":23,"tag":2161,"props":25357,"children":25358},{"style":5830},[25359],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25361,"children":25362},{"class":2163,"line":2208},[25363,25367,25371,25375,25379,25383,25387,25391,25395,25400,25404,25408,25412,25417,25421,25426,25430,25435,25439,25443,25447,25451,25455,25459],{"type":23,"tag":2161,"props":25364,"children":25365},{"style":5948},[25366],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25368,"children":25369},{"style":5830},[25370],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25372,"children":25373},{"style":5948},[25374],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25376,"children":25377},{"style":5830},[25378],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25380,"children":25381},{"style":5948},[25382],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25384,"children":25385},{"style":5830},[25386],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25388,"children":25389},{"style":5844},[25390],{"type":28,"value":3763},{"type":23,"tag":2161,"props":25392,"children":25393},{"style":5830},[25394],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25396,"children":25397},{"style":5855},[25398],{"type":28,"value":25399},"'8983983542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25401,"children":25402},{"style":5830},[25403],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25405,"children":25406},{"style":5855},[25407],{"type":28,"value":24988},{"type":23,"tag":2161,"props":25409,"children":25410},{"style":5830},[25411],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25413,"children":25414},{"style":5855},[25415],{"type":28,"value":25416},"'Berrouard'",{"type":23,"tag":2161,"props":25418,"children":25419},{"style":5830},[25420],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25422,"children":25423},{"style":5855},[25424],{"type":28,"value":25425},"'20\u002F05\u002F1946'",{"type":23,"tag":2161,"props":25427,"children":25428},{"style":5830},[25429],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25431,"children":25432},{"style":5855},[25433],{"type":28,"value":25434},"'91610'",{"type":23,"tag":2161,"props":25436,"children":25437},{"style":5830},[25438],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25440,"children":25441},{"style":5855},[25442],{"type":28,"value":25234},{"type":23,"tag":2161,"props":25444,"children":25445},{"style":5830},[25446],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25448,"children":25449},{"style":5855},[25450],{"type":28,"value":24926},{"type":23,"tag":2161,"props":25452,"children":25453},{"style":5830},[25454],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25456,"children":25457},{"style":5855},[25458],{"type":28,"value":25042},{"type":23,"tag":2161,"props":25460,"children":25461},{"style":5830},[25462],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25464,"children":25465},{"class":2163,"line":2217},[25466,25470,25474,25478,25482,25486,25490,25495,25499,25504,25508,25512,25516,25520,25524,25528,25532,25536,25540,25545,25549,25553,25557,25562],{"type":23,"tag":2161,"props":25467,"children":25468},{"style":5948},[25469],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25471,"children":25472},{"style":5830},[25473],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25475,"children":25476},{"style":5948},[25477],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25479,"children":25480},{"style":5830},[25481],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25483,"children":25484},{"style":5948},[25485],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25487,"children":25488},{"style":5830},[25489],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25491,"children":25492},{"style":5844},[25493],{"type":28,"value":25494},"7",{"type":23,"tag":2161,"props":25496,"children":25497},{"style":5830},[25498],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25500,"children":25501},{"style":5855},[25502],{"type":28,"value":25503},"'4518023542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25505,"children":25506},{"style":5830},[25507],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25509,"children":25510},{"style":5855},[25511],{"type":28,"value":24881},{"type":23,"tag":2161,"props":25513,"children":25514},{"style":5830},[25515],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25517,"children":25518},{"style":5855},[25519],{"type":28,"value":24890},{"type":23,"tag":2161,"props":25521,"children":25522},{"style":5830},[25523],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25525,"children":25526},{"style":5855},[25527],{"type":28,"value":25217},{"type":23,"tag":2161,"props":25529,"children":25530},{"style":5830},[25531],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25533,"children":25534},{"style":5855},[25535],{"type":28,"value":25330},{"type":23,"tag":2161,"props":25537,"children":25538},{"style":5830},[25539],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25541,"children":25542},{"style":5855},[25543],{"type":28,"value":25544},"'Le Cres'",{"type":23,"tag":2161,"props":25546,"children":25547},{"style":5830},[25548],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25550,"children":25551},{"style":5855},[25552],{"type":28,"value":25243},{"type":23,"tag":2161,"props":25554,"children":25555},{"style":5830},[25556],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25558,"children":25559},{"style":5855},[25560],{"type":28,"value":25561},"'veuve'",{"type":23,"tag":2161,"props":25563,"children":25564},{"style":5830},[25565],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25567,"children":25568},{"class":2163,"line":2226},[25569,25573,25577,25581,25585,25589,25593,25597,25601,25606,25610,25615,25619,25623,25627,25631,25635,25639,25643,25647,25651,25655,25659,25663],{"type":23,"tag":2161,"props":25570,"children":25571},{"style":5948},[25572],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25574,"children":25575},{"style":5830},[25576],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25578,"children":25579},{"style":5948},[25580],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25582,"children":25583},{"style":5830},[25584],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25586,"children":25587},{"style":5948},[25588],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25590,"children":25591},{"style":5830},[25592],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25594,"children":25595},{"style":5844},[25596],{"type":28,"value":11134},{"type":23,"tag":2161,"props":25598,"children":25599},{"style":5830},[25600],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25602,"children":25603},{"style":5855},[25604],{"type":28,"value":25605},"'9721973542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25607,"children":25608},{"style":5830},[25609],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25611,"children":25612},{"style":5855},[25613],{"type":28,"value":25614},"'Maurice'",{"type":23,"tag":2161,"props":25616,"children":25617},{"style":5830},[25618],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25620,"children":25621},{"style":5855},[25622],{"type":28,"value":25416},{"type":23,"tag":2161,"props":25624,"children":25625},{"style":5830},[25626],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25628,"children":25629},{"style":5855},[25630],{"type":28,"value":25112},{"type":23,"tag":2161,"props":25632,"children":25633},{"style":5830},[25634],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25636,"children":25637},{"style":5855},[25638],{"type":28,"value":25121},{"type":23,"tag":2161,"props":25640,"children":25641},{"style":5830},[25642],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25644,"children":25645},{"style":5855},[25646],{"type":28,"value":25339},{"type":23,"tag":2161,"props":25648,"children":25649},{"style":5830},[25650],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25652,"children":25653},{"style":5855},[25654],{"type":28,"value":25243},{"type":23,"tag":2161,"props":25656,"children":25657},{"style":5830},[25658],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25660,"children":25661},{"style":5855},[25662],{"type":28,"value":25042},{"type":23,"tag":2161,"props":25664,"children":25665},{"style":5830},[25666],{"type":28,"value":10626},{"type":23,"tag":2161,"props":25668,"children":25669},{"class":2163,"line":2235},[25670,25674,25678,25682,25686,25690,25694,25699,25703,25708,25712,25716,25720,25724,25728,25732,25736,25741,25745,25749,25753,25757,25761,25765],{"type":23,"tag":2161,"props":25671,"children":25672},{"style":5948},[25673],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25675,"children":25676},{"style":5830},[25677],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25679,"children":25680},{"style":5948},[25681],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25683,"children":25684},{"style":5830},[25685],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25687,"children":25688},{"style":5948},[25689],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25691,"children":25692},{"style":5830},[25693],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25695,"children":25696},{"style":5844},[25697],{"type":28,"value":25698},"9",{"type":23,"tag":2161,"props":25700,"children":25701},{"style":5830},[25702],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25704,"children":25705},{"style":5855},[25706],{"type":28,"value":25707},"'4037673542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25709,"children":25710},{"style":5830},[25711],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25713,"children":25714},{"style":5855},[25715],{"type":28,"value":24988},{"type":23,"tag":2161,"props":25717,"children":25718},{"style":5830},[25719],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25721,"children":25722},{"style":5855},[25723],{"type":28,"value":25416},{"type":23,"tag":2161,"props":25725,"children":25726},{"style":5830},[25727],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25729,"children":25730},{"style":5855},[25731],{"type":28,"value":25217},{"type":23,"tag":2161,"props":25733,"children":25734},{"style":5830},[25735],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25737,"children":25738},{"style":5855},[25739],{"type":28,"value":25740},"'H2M2V5'",{"type":23,"tag":2161,"props":25742,"children":25743},{"style":5830},[25744],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25746,"children":25747},{"style":5855},[25748],{"type":28,"value":25339},{"type":23,"tag":2161,"props":25750,"children":25751},{"style":5830},[25752],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25754,"children":25755},{"style":5855},[25756],{"type":28,"value":25243},{"type":23,"tag":2161,"props":25758,"children":25759},{"style":5830},[25760],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25762,"children":25763},{"style":5855},[25764],{"type":28,"value":25147},{"type":23,"tag":2161,"props":25766,"children":25767},{"style":5830},[25768],{"type":28,"value":10626},{"type":23,"tag":890,"props":25770,"children":25771},{"start":2217},[25772],{"type":23,"tag":403,"props":25773,"children":25774},{},[25775,25777],{"type":28,"value":25776},"启动 kafka consumer 消费 ",{"type":23,"tag":99,"props":25778,"children":25780},{"className":25779},[],[25781],{"type":28,"value":25782},"mysql-kafka-omneo_incrementing",{"type":23,"tag":2152,"props":25784,"children":25786},{"className":20588,"code":25785,"language":20590,"meta":8,"style":8},"kafka-console-consumer.sh --bootstrap-server master:9092 --topic mysql-kafka-omneo_incrementing --from-beginning\n",[25787],{"type":23,"tag":99,"props":25788,"children":25789},{"__ignoreMap":8},[25790],{"type":23,"tag":2161,"props":25791,"children":25792},{"class":2163,"line":2164},[25793,25798,25803,25808,25812,25817],{"type":23,"tag":2161,"props":25794,"children":25795},{"style":5824},[25796],{"type":28,"value":25797},"kafka-console-consumer.sh",{"type":23,"tag":2161,"props":25799,"children":25800},{"style":5844},[25801],{"type":28,"value":25802}," --bootstrap-server",{"type":23,"tag":2161,"props":25804,"children":25805},{"style":5855},[25806],{"type":28,"value":25807}," master:9092",{"type":23,"tag":2161,"props":25809,"children":25810},{"style":5844},[25811],{"type":28,"value":24733},{"type":23,"tag":2161,"props":25813,"children":25814},{"style":5855},[25815],{"type":28,"value":25816}," mysql-kafka-omneo_incrementing",{"type":23,"tag":2161,"props":25818,"children":25819},{"style":5844},[25820],{"type":28,"value":25821}," --from-beginning\n",{"type":23,"tag":24,"props":25823,"children":25824},{},[25825],{"type":28,"value":25826},"插入成功如下图所示",{"type":23,"tag":24,"props":25828,"children":25829},{},[25830],{"type":23,"tag":65,"props":25831,"children":25833},{"alt":8,"src":25832},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-1d8fb2b45a89dc3f.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":25835,"children":25836},{"start":2217},[25837],{"type":23,"tag":403,"props":25838,"children":25839},{},[25840,25841],{"type":28,"value":25776},{"type":23,"tag":99,"props":25842,"children":25844},{"className":25843},[],[25845],{"type":28,"value":25782},{"type":23,"tag":2152,"props":25847,"children":25848},{"className":20588,"code":25785,"language":20590,"meta":8,"style":8},[25849],{"type":23,"tag":99,"props":25850,"children":25851},{"__ignoreMap":8},[25852],{"type":23,"tag":2161,"props":25853,"children":25854},{"class":2163,"line":2164},[25855,25859,25863,25867,25871,25875],{"type":23,"tag":2161,"props":25856,"children":25857},{"style":5824},[25858],{"type":28,"value":25797},{"type":23,"tag":2161,"props":25860,"children":25861},{"style":5844},[25862],{"type":28,"value":25802},{"type":23,"tag":2161,"props":25864,"children":25865},{"style":5855},[25866],{"type":28,"value":25807},{"type":23,"tag":2161,"props":25868,"children":25869},{"style":5844},[25870],{"type":28,"value":24733},{"type":23,"tag":2161,"props":25872,"children":25873},{"style":5855},[25874],{"type":28,"value":25816},{"type":23,"tag":2161,"props":25876,"children":25877},{"style":5844},[25878],{"type":28,"value":25821},{"type":23,"tag":24,"props":25880,"children":25881},{},[25882,25884,25889,25891,25897],{"type":28,"value":25883},"观察 consumer 控制台，发现 ",{"type":23,"tag":99,"props":25885,"children":25887},{"className":25886},[],[25888],{"type":28,"value":19459},{"type":28,"value":25890}," 表中的10条数据已经生产至了 ",{"type":23,"tag":99,"props":25892,"children":25894},{"className":25893},[],[25895],{"type":28,"value":25896},"mysql-kafka_omneo",{"type":28,"value":25898}," 主题当中",{"type":23,"tag":24,"props":25900,"children":25901},{},[25902],{"type":23,"tag":65,"props":25903,"children":25905},{"alt":8,"src":25904},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-fe16c75b10c51727.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":25907,"children":25908},{"start":2226},[25909],{"type":23,"tag":403,"props":25910,"children":25911},{},[25912],{"type":28,"value":25913},"再插入一条数据",{"type":23,"tag":2152,"props":25915,"children":25917},{"className":19390,"code":25916,"language":19392,"meta":8,"style":8},"insert into omneo_incrementing(pid, uuid, firstname, lastname, birthdate, postalcode, city, sexe, status) values(10,'6633863542a7-5bdb-d564-3133-276ae3ce','Gauthier',\"O'Dell\",'23\u002F09\u002F2002','H2M2V5','Maugio','female','veuve');\n",[25918],{"type":23,"tag":99,"props":25919,"children":25920},{"__ignoreMap":8},[25921],{"type":23,"tag":2161,"props":25922,"children":25923},{"class":2163,"line":2164},[25924,25928,25932,25936,25940,25944,25948,25953,25957,25962,25966,25970,25974,25979,25983,25987,25991,25995,25999,26003,26007,26011,26015,26019],{"type":23,"tag":2161,"props":25925,"children":25926},{"style":5948},[25927],{"type":28,"value":19869},{"type":23,"tag":2161,"props":25929,"children":25930},{"style":5830},[25931],{"type":28,"value":24843},{"type":23,"tag":2161,"props":25933,"children":25934},{"style":5948},[25935],{"type":28,"value":11551},{"type":23,"tag":2161,"props":25937,"children":25938},{"style":5830},[25939],{"type":28,"value":11049},{"type":23,"tag":2161,"props":25941,"children":25942},{"style":5948},[25943],{"type":28,"value":19879},{"type":23,"tag":2161,"props":25945,"children":25946},{"style":5830},[25947],{"type":28,"value":10486},{"type":23,"tag":2161,"props":25949,"children":25950},{"style":5844},[25951],{"type":28,"value":25952},"10",{"type":23,"tag":2161,"props":25954,"children":25955},{"style":5830},[25956],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25958,"children":25959},{"style":5855},[25960],{"type":28,"value":25961},"'6633863542a7-5bdb-d564-3133-276ae3ce'",{"type":23,"tag":2161,"props":25963,"children":25964},{"style":5830},[25965],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25967,"children":25968},{"style":5855},[25969],{"type":28,"value":25200},{"type":23,"tag":2161,"props":25971,"children":25972},{"style":5830},[25973],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25975,"children":25976},{"style":5855},[25977],{"type":28,"value":25978},"\"O'Dell\"",{"type":23,"tag":2161,"props":25980,"children":25981},{"style":5830},[25982],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25984,"children":25985},{"style":5855},[25986],{"type":28,"value":25006},{"type":23,"tag":2161,"props":25988,"children":25989},{"style":5830},[25990],{"type":28,"value":19892},{"type":23,"tag":2161,"props":25992,"children":25993},{"style":5855},[25994],{"type":28,"value":25740},{"type":23,"tag":2161,"props":25996,"children":25997},{"style":5830},[25998],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26000,"children":26001},{"style":5855},[26002],{"type":28,"value":25130},{"type":23,"tag":2161,"props":26004,"children":26005},{"style":5830},[26006],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26008,"children":26009},{"style":5855},[26010],{"type":28,"value":24926},{"type":23,"tag":2161,"props":26012,"children":26013},{"style":5830},[26014],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26016,"children":26017},{"style":5855},[26018],{"type":28,"value":25561},{"type":23,"tag":2161,"props":26020,"children":26021},{"style":5830},[26022],{"type":28,"value":10626},{"type":23,"tag":24,"props":26024,"children":26025},{},[26026],{"type":23,"tag":65,"props":26027,"children":26029},{"alt":8,"src":26028},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-4b99f9e083b1582f.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":26031,"children":26032},{"start":2235},[26033],{"type":23,"tag":403,"props":26034,"children":26035},{},[26036,26037,26042,26044,26050],{"type":28,"value":25883},{"type":23,"tag":99,"props":26038,"children":26040},{"className":26039},[],[26041],{"type":28,"value":25896},{"type":28,"value":26043}," 主题中 ",{"type":23,"tag":99,"props":26045,"children":26047},{"className":26046},[],[26048],{"type":28,"value":26049},"pid=10",{"type":28,"value":26051}," 条数据被消费到了控制台。",{"type":23,"tag":24,"props":26053,"children":26054},{},[26055],{"type":23,"tag":65,"props":26056,"children":26058},{"alt":8,"src":26057},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-b031b4e34f24cba6.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":26060,"children":26061},{"start":2244},[26062],{"type":23,"tag":403,"props":26063,"children":26064},{},[26065,26067,26072],{"type":28,"value":26066},"更新 ",{"type":23,"tag":99,"props":26068,"children":26070},{"className":26069},[],[26071],{"type":28,"value":26049},{"type":28,"value":26073}," 的 firstname=\"world\"",{"type":23,"tag":2152,"props":26075,"children":26077},{"className":19390,"code":26076,"language":19392,"meta":8,"style":8},"INSERT INTO omneo VALUES (10,'6633863542a7-5bdb-d564-3133-276ae3ce','Gauthier',\"O'Dell\",'23\u002F09\u002F2002','H2M2V5','Maugio','female','veuve') ON DUPLICATE KEY UPDATE firstname=\"world\";\n",[26078],{"type":23,"tag":99,"props":26079,"children":26080},{"__ignoreMap":8},[26081],{"type":23,"tag":2161,"props":26082,"children":26083},{"class":2163,"line":2164},[26084,26089,26093,26098,26103,26107,26111,26115,26119,26123,26127,26131,26135,26139,26143,26147,26151,26155,26159,26163,26167,26171,26175,26180,26185,26190,26195,26200,26204,26209],{"type":23,"tag":2161,"props":26085,"children":26086},{"style":5948},[26087],{"type":28,"value":26088},"INSERT INTO",{"type":23,"tag":2161,"props":26090,"children":26091},{"style":5830},[26092],{"type":28,"value":19874},{"type":23,"tag":2161,"props":26094,"children":26095},{"style":5948},[26096],{"type":28,"value":26097},"VALUES",{"type":23,"tag":2161,"props":26099,"children":26100},{"style":5830},[26101],{"type":28,"value":26102}," (",{"type":23,"tag":2161,"props":26104,"children":26105},{"style":5844},[26106],{"type":28,"value":25952},{"type":23,"tag":2161,"props":26108,"children":26109},{"style":5830},[26110],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26112,"children":26113},{"style":5855},[26114],{"type":28,"value":25961},{"type":23,"tag":2161,"props":26116,"children":26117},{"style":5830},[26118],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26120,"children":26121},{"style":5855},[26122],{"type":28,"value":25200},{"type":23,"tag":2161,"props":26124,"children":26125},{"style":5830},[26126],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26128,"children":26129},{"style":5855},[26130],{"type":28,"value":25978},{"type":23,"tag":2161,"props":26132,"children":26133},{"style":5830},[26134],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26136,"children":26137},{"style":5855},[26138],{"type":28,"value":25006},{"type":23,"tag":2161,"props":26140,"children":26141},{"style":5830},[26142],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26144,"children":26145},{"style":5855},[26146],{"type":28,"value":25740},{"type":23,"tag":2161,"props":26148,"children":26149},{"style":5830},[26150],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26152,"children":26153},{"style":5855},[26154],{"type":28,"value":25130},{"type":23,"tag":2161,"props":26156,"children":26157},{"style":5830},[26158],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26160,"children":26161},{"style":5855},[26162],{"type":28,"value":24926},{"type":23,"tag":2161,"props":26164,"children":26165},{"style":5830},[26166],{"type":28,"value":19892},{"type":23,"tag":2161,"props":26168,"children":26169},{"style":5855},[26170],{"type":28,"value":25561},{"type":23,"tag":2161,"props":26172,"children":26173},{"style":5830},[26174],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26176,"children":26177},{"style":5948},[26178],{"type":28,"value":26179},"ON",{"type":23,"tag":2161,"props":26181,"children":26182},{"style":5830},[26183],{"type":28,"value":26184}," DUPLICATE ",{"type":23,"tag":2161,"props":26186,"children":26187},{"style":5948},[26188],{"type":28,"value":26189},"KEY",{"type":23,"tag":2161,"props":26191,"children":26192},{"style":5948},[26193],{"type":28,"value":26194}," UPDATE",{"type":23,"tag":2161,"props":26196,"children":26197},{"style":5830},[26198],{"type":28,"value":26199}," firstname",{"type":23,"tag":2161,"props":26201,"children":26202},{"style":5948},[26203],{"type":28,"value":6258},{"type":23,"tag":2161,"props":26205,"children":26206},{"style":5855},[26207],{"type":28,"value":26208},"\"world\"",{"type":23,"tag":2161,"props":26210,"children":26211},{"style":5830},[26212],{"type":28,"value":20434},{"type":23,"tag":890,"props":26214,"children":26215},{"start":2253},[26216],{"type":23,"tag":403,"props":26217,"children":26218},{},[26219,26221,26226],{"type":28,"value":26220},"查看 mysql 中的 ",{"type":23,"tag":99,"props":26222,"children":26224},{"className":26223},[],[26225],{"type":28,"value":19459},{"type":28,"value":26227}," 表发现值已经被改变",{"type":23,"tag":24,"props":26229,"children":26230},{},[26231],{"type":23,"tag":65,"props":26232,"children":26234},{"alt":8,"src":26233},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-0af78b480ceaa435.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":890,"props":26236,"children":26237},{"start":6337},[26238],{"type":23,"tag":403,"props":26239,"children":26240},{},[26241,26243,26248],{"type":28,"value":26242},"consumer 控制台 ",{"type":23,"tag":99,"props":26244,"children":26246},{"className":26245},[],[26247],{"type":28,"value":26049},{"type":28,"value":26249}," 的记录值并没有被更新",{"type":23,"tag":24,"props":26251,"children":26252},{},[26253],{"type":23,"tag":65,"props":26254,"children":26256},{"alt":8,"src":26255},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-6dff0673a078b8f7.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":23,"tag":50,"props":26258,"children":26260},{"id":26259},"incrementing-结论",[26261],{"type":28,"value":26262},"incrementing 结论",{"type":23,"tag":24,"props":26264,"children":26265},{},[26266,26268,26274,26276,26282],{"type":28,"value":26267},"在 JDBC Sink Connector 官网中指出insert.mode有且仅有两个值 ",{"type":23,"tag":99,"props":26269,"children":26271},{"className":26270},[],[26272],{"type":28,"value":26273},"insert.mode=insert",{"type":28,"value":26275}," 只接收标准的INSERT SQL新增语句。而 ",{"type":23,"tag":99,"props":26277,"children":26279},{"className":26278},[],[26280],{"type":28,"value":26281},"insert.mode=upsert",{"type":28,"value":26283}," 接收新增和更新，当对主键修改时也可以洞察并且输出。而insert是无法满足此要求的，因此根据实际业务使用的场景选择insert.mode。",{"type":23,"tag":17976,"props":26285,"children":26286},{},[26287],{"type":23,"tag":24,"props":26288,"children":26289},{},[26290,26292,26297,26299,26304,26306,26311,26313,26317,26319,26323,26325,26331,26332,26338],{"type":28,"value":26291},"我将 ",{"type":23,"tag":99,"props":26293,"children":26295},{"className":26294},[],[26296],{"type":28,"value":26273},{"type":28,"value":26298}," 修改为 ",{"type":23,"tag":99,"props":26300,"children":26302},{"className":26301},[],[26303],{"type":28,"value":26281},{"type":28,"value":26305}," ，再次运行修改过后的数据并没有将修改过后的最新数据生产至 ",{"type":23,"tag":99,"props":26307,"children":26309},{"className":26308},[],[26310],{"type":28,"value":24670},{"type":28,"value":26312},"\n修改字段值之前\n",{"type":23,"tag":65,"props":26314,"children":26316},{"alt":8,"src":26315},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-a41dc2d2cc83d052.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":28,"value":26318},"\n修改字段值之后\n",{"type":23,"tag":65,"props":26320,"children":26322},{"alt":8,"src":26321},"https:\u002F\u002Fupload-images.jianshu.io\u002Fupload_images\u002F16281566-75ac995cf2876ced.png?imageMogr2\u002Fauto-orient\u002Fstrip%7CimageView2\u002F2\u002Fw\u002F1200\u002Fformat\u002Fwebp",[],{"type":28,"value":26324},"\n我并没看出 ",{"type":23,"tag":99,"props":26326,"children":26328},{"className":26327},[],[26329],{"type":28,"value":26330},"insert",{"type":28,"value":1148},{"type":23,"tag":99,"props":26333,"children":26335},{"className":26334},[],[26336],{"type":28,"value":26337},"upsert",{"type":28,"value":26339}," 两个参数的区别，希望测试成功的人留言指正或者微信指正，感谢！！！",{"type":23,"tag":50,"props":26341,"children":26343},{"id":26342},"_2-timestamp-时间戳模式",[26344],{"type":28,"value":26345},"2. timestamp 时间戳模式",{"type":23,"tag":890,"props":26347,"children":26348},{},[26349],{"type":23,"tag":403,"props":26350,"children":26351},{},[26352,26353,26359],{"type":28,"value":24665},{"type":23,"tag":99,"props":26354,"children":26356},{"className":26355},[],[26357],{"type":28,"value":26358},"test_kafka_connector",{"type":28,"value":26360}," 库 omneo_timestamp 测试表",{"type":23,"tag":2152,"props":26362,"children":26364},{"className":19390,"code":26363,"language":19392,"meta":8,"style":8},"CREATE TABLE IF NOT EXISTS test_kafka_connector.omneo_timestamp(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    commenttime timestamp NOT NULL DEFAULT current_timestamp,\n    PRIMARY KEY (pid)\n)ENGINE=InnoDB DEFAULT CHARSET=utf8;\n",[26365],{"type":23,"tag":99,"props":26366,"children":26367},{"__ignoreMap":8},[26368,26408,26439,26470,26517,26564,26587,26610,26633,26656,26679,26702,26713],{"type":23,"tag":2161,"props":26369,"children":26370},{"class":2163,"line":2164},[26371,26375,26379,26383,26387,26391,26395,26399,26404],{"type":23,"tag":2161,"props":26372,"children":26373},{"style":5948},[26374],{"type":28,"value":19424},{"type":23,"tag":2161,"props":26376,"children":26377},{"style":5948},[26378],{"type":28,"value":19429},{"type":23,"tag":2161,"props":26380,"children":26381},{"style":5824},[26382],{"type":28,"value":19434},{"type":23,"tag":2161,"props":26384,"children":26385},{"style":5948},[26386],{"type":28,"value":19439},{"type":23,"tag":2161,"props":26388,"children":26389},{"style":5948},[26390],{"type":28,"value":19444},{"type":23,"tag":2161,"props":26392,"children":26393},{"style":5844},[26394],{"type":28,"value":23525},{"type":23,"tag":2161,"props":26396,"children":26397},{"style":5830},[26398],{"type":28,"value":19454},{"type":23,"tag":2161,"props":26400,"children":26401},{"style":5844},[26402],{"type":28,"value":26403},"omneo_timestamp",{"type":23,"tag":2161,"props":26405,"children":26406},{"style":5830},[26407],{"type":28,"value":19464},{"type":23,"tag":2161,"props":26409,"children":26410},{"class":2163,"line":927},[26411,26415,26419,26423,26427,26431,26435],{"type":23,"tag":2161,"props":26412,"children":26413},{"style":5830},[26414],{"type":28,"value":19472},{"type":23,"tag":2161,"props":26416,"children":26417},{"style":5948},[26418],{"type":28,"value":19477},{"type":23,"tag":2161,"props":26420,"children":26421},{"style":5830},[26422],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26424,"children":26425},{"style":5844},[26426],{"type":28,"value":19486},{"type":23,"tag":2161,"props":26428,"children":26429},{"style":5830},[26430],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26432,"children":26433},{"style":5948},[26434],{"type":28,"value":19495},{"type":23,"tag":2161,"props":26436,"children":26437},{"style":5830},[26438],{"type":28,"value":19500},{"type":23,"tag":2161,"props":26440,"children":26441},{"class":2163,"line":924},[26442,26446,26450,26454,26458,26462,26466],{"type":23,"tag":2161,"props":26443,"children":26444},{"style":5830},[26445],{"type":28,"value":19508},{"type":23,"tag":2161,"props":26447,"children":26448},{"style":5948},[26449],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26451,"children":26452},{"style":5830},[26453],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26455,"children":26456},{"style":5844},[26457],{"type":28,"value":11446},{"type":23,"tag":2161,"props":26459,"children":26460},{"style":5830},[26461],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26463,"children":26464},{"style":5948},[26465],{"type":28,"value":19495},{"type":23,"tag":2161,"props":26467,"children":26468},{"style":5830},[26469],{"type":28,"value":15751},{"type":23,"tag":2161,"props":26471,"children":26472},{"class":2163,"line":2190},[26473,26477,26481,26485,26489,26493,26497,26501,26505,26509,26513],{"type":23,"tag":2161,"props":26474,"children":26475},{"style":5830},[26476],{"type":28,"value":19541},{"type":23,"tag":2161,"props":26478,"children":26479},{"style":5948},[26480],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26482,"children":26483},{"style":5830},[26484],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26486,"children":26487},{"style":5844},[26488],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26490,"children":26491},{"style":5830},[26492],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26494,"children":26495},{"style":5948},[26496],{"type":28,"value":19563},{"type":23,"tag":2161,"props":26498,"children":26499},{"style":5948},[26500],{"type":28,"value":19568},{"type":23,"tag":2161,"props":26502,"children":26503},{"style":5830},[26504],{"type":28,"value":19573},{"type":23,"tag":2161,"props":26506,"children":26507},{"style":5948},[26508],{"type":28,"value":19578},{"type":23,"tag":2161,"props":26510,"children":26511},{"style":5948},[26512],{"type":28,"value":19583},{"type":23,"tag":2161,"props":26514,"children":26515},{"style":5830},[26516],{"type":28,"value":15751},{"type":23,"tag":2161,"props":26518,"children":26519},{"class":2163,"line":2199},[26520,26524,26528,26532,26536,26540,26544,26548,26552,26556,26560],{"type":23,"tag":2161,"props":26521,"children":26522},{"style":5830},[26523],{"type":28,"value":19595},{"type":23,"tag":2161,"props":26525,"children":26526},{"style":5948},[26527],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26529,"children":26530},{"style":5830},[26531],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26533,"children":26534},{"style":5844},[26535],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26537,"children":26538},{"style":5830},[26539],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26541,"children":26542},{"style":5948},[26543],{"type":28,"value":19563},{"type":23,"tag":2161,"props":26545,"children":26546},{"style":5948},[26547],{"type":28,"value":19568},{"type":23,"tag":2161,"props":26549,"children":26550},{"style":5830},[26551],{"type":28,"value":19573},{"type":23,"tag":2161,"props":26553,"children":26554},{"style":5948},[26555],{"type":28,"value":19578},{"type":23,"tag":2161,"props":26557,"children":26558},{"style":5948},[26559],{"type":28,"value":19583},{"type":23,"tag":2161,"props":26561,"children":26562},{"style":5830},[26563],{"type":28,"value":15751},{"type":23,"tag":2161,"props":26565,"children":26566},{"class":2163,"line":2208},[26567,26571,26575,26579,26583],{"type":23,"tag":2161,"props":26568,"children":26569},{"style":5830},[26570],{"type":28,"value":19643},{"type":23,"tag":2161,"props":26572,"children":26573},{"style":5948},[26574],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26576,"children":26577},{"style":5830},[26578],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26580,"children":26581},{"style":5844},[26582],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26584,"children":26585},{"style":5830},[26586],{"type":28,"value":19660},{"type":23,"tag":2161,"props":26588,"children":26589},{"class":2163,"line":2217},[26590,26594,26598,26602,26606],{"type":23,"tag":2161,"props":26591,"children":26592},{"style":5830},[26593],{"type":28,"value":19668},{"type":23,"tag":2161,"props":26595,"children":26596},{"style":5948},[26597],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26599,"children":26600},{"style":5830},[26601],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26603,"children":26604},{"style":5844},[26605],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26607,"children":26608},{"style":5830},[26609],{"type":28,"value":19660},{"type":23,"tag":2161,"props":26611,"children":26612},{"class":2163,"line":2226},[26613,26617,26621,26625,26629],{"type":23,"tag":2161,"props":26614,"children":26615},{"style":5830},[26616],{"type":28,"value":19692},{"type":23,"tag":2161,"props":26618,"children":26619},{"style":5948},[26620],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26622,"children":26623},{"style":5830},[26624],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26626,"children":26627},{"style":5844},[26628],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26630,"children":26631},{"style":5830},[26632],{"type":28,"value":19660},{"type":23,"tag":2161,"props":26634,"children":26635},{"class":2163,"line":2235},[26636,26640,26644,26648,26652],{"type":23,"tag":2161,"props":26637,"children":26638},{"style":5830},[26639],{"type":28,"value":19716},{"type":23,"tag":2161,"props":26641,"children":26642},{"style":5948},[26643],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26645,"children":26646},{"style":5830},[26647],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26649,"children":26650},{"style":5844},[26651],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26653,"children":26654},{"style":5830},[26655],{"type":28,"value":19660},{"type":23,"tag":2161,"props":26657,"children":26658},{"class":2163,"line":2244},[26659,26663,26667,26671,26675],{"type":23,"tag":2161,"props":26660,"children":26661},{"style":5948},[26662],{"type":28,"value":19740},{"type":23,"tag":2161,"props":26664,"children":26665},{"style":5948},[26666],{"type":28,"value":19745},{"type":23,"tag":2161,"props":26668,"children":26669},{"style":5830},[26670],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26672,"children":26673},{"style":5844},[26674],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26676,"children":26677},{"style":5830},[26678],{"type":28,"value":19660},{"type":23,"tag":2161,"props":26680,"children":26681},{"class":2163,"line":2253},[26682,26686,26690,26694,26698],{"type":23,"tag":2161,"props":26683,"children":26684},{"style":5830},[26685],{"type":28,"value":19765},{"type":23,"tag":2161,"props":26687,"children":26688},{"style":5948},[26689],{"type":28,"value":19770},{"type":23,"tag":2161,"props":26691,"children":26692},{"style":5948},[26693],{"type":28,"value":19775},{"type":23,"tag":2161,"props":26695,"children":26696},{"style":5948},[26697],{"type":28,"value":19780},{"type":23,"tag":2161,"props":26699,"children":26700},{"style":5830},[26701],{"type":28,"value":19785},{"type":23,"tag":2161,"props":26703,"children":26704},{"class":2163,"line":6337},[26705,26709],{"type":23,"tag":2161,"props":26706,"children":26707},{"style":5948},[26708],{"type":28,"value":19793},{"type":23,"tag":2161,"props":26710,"children":26711},{"style":5830},[26712],{"type":28,"value":19798},{"type":23,"tag":2161,"props":26714,"children":26715},{"class":2163,"line":6365},[26716,26720,26724,26728,26732,26736,26740],{"type":23,"tag":2161,"props":26717,"children":26718},{"style":5830},[26719],{"type":28,"value":19807},{"type":23,"tag":2161,"props":26721,"children":26722},{"style":5948},[26723],{"type":28,"value":6258},{"type":23,"tag":2161,"props":26725,"children":26726},{"style":5830},[26727],{"type":28,"value":19816},{"type":23,"tag":2161,"props":26729,"children":26730},{"style":5948},[26731],{"type":28,"value":19578},{"type":23,"tag":2161,"props":26733,"children":26734},{"style":5830},[26735],{"type":28,"value":19825},{"type":23,"tag":2161,"props":26737,"children":26738},{"style":5948},[26739],{"type":28,"value":6258},{"type":23,"tag":2161,"props":26741,"children":26742},{"style":5830},[26743],{"type":28,"value":19834},{"type":23,"tag":17976,"props":26745,"children":26746},{},[26747],{"type":23,"tag":24,"props":26748,"children":26749},{},[26750],{"type":28,"value":26751},"注意timestamp必须指定not null，否则会报错! (无法使用时间戳列进行增量查询因为时间戳字段是可为空的)",{"type":23,"tag":890,"props":26753,"children":26754},{"start":927},[26755],{"type":23,"tag":403,"props":26756,"children":26757},{},[26758,26759,26765],{"type":28,"value":24665},{"type":23,"tag":99,"props":26760,"children":26762},{"className":26761},[],[26763],{"type":28,"value":26764},"kafka_connector",{"type":28,"value":26766}," 库 kafka_omneo_timestamp 测试表",{"type":23,"tag":2152,"props":26768,"children":26770},{"className":19390,"code":26769,"language":19392,"meta":8,"style":8},"CREATE TABLE IF NOT EXISTS kafka_connector.kafka_omneo_timestamp(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    commenttime timestamp NULL DEFAULT NULL,\n    PRIMARY KEY (pid)\n)ENGINE=InnoDB DEFAULT CHARSET=utf8;\n",[26771],{"type":23,"tag":99,"props":26772,"children":26773},{"__ignoreMap":8},[26774,26814,26845,26876,26923,26970,26993,27016,27039,27062,27085,27112,27123],{"type":23,"tag":2161,"props":26775,"children":26776},{"class":2163,"line":2164},[26777,26781,26785,26789,26793,26797,26801,26805,26810],{"type":23,"tag":2161,"props":26778,"children":26779},{"style":5948},[26780],{"type":28,"value":19424},{"type":23,"tag":2161,"props":26782,"children":26783},{"style":5948},[26784],{"type":28,"value":19429},{"type":23,"tag":2161,"props":26786,"children":26787},{"style":5824},[26788],{"type":28,"value":19434},{"type":23,"tag":2161,"props":26790,"children":26791},{"style":5948},[26792],{"type":28,"value":19439},{"type":23,"tag":2161,"props":26794,"children":26795},{"style":5948},[26796],{"type":28,"value":19444},{"type":23,"tag":2161,"props":26798,"children":26799},{"style":5844},[26800],{"type":28,"value":23903},{"type":23,"tag":2161,"props":26802,"children":26803},{"style":5830},[26804],{"type":28,"value":19454},{"type":23,"tag":2161,"props":26806,"children":26807},{"style":5844},[26808],{"type":28,"value":26809},"kafka_omneo_timestamp",{"type":23,"tag":2161,"props":26811,"children":26812},{"style":5830},[26813],{"type":28,"value":19464},{"type":23,"tag":2161,"props":26815,"children":26816},{"class":2163,"line":927},[26817,26821,26825,26829,26833,26837,26841],{"type":23,"tag":2161,"props":26818,"children":26819},{"style":5830},[26820],{"type":28,"value":19472},{"type":23,"tag":2161,"props":26822,"children":26823},{"style":5948},[26824],{"type":28,"value":19477},{"type":23,"tag":2161,"props":26826,"children":26827},{"style":5830},[26828],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26830,"children":26831},{"style":5844},[26832],{"type":28,"value":19486},{"type":23,"tag":2161,"props":26834,"children":26835},{"style":5830},[26836],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26838,"children":26839},{"style":5948},[26840],{"type":28,"value":19495},{"type":23,"tag":2161,"props":26842,"children":26843},{"style":5830},[26844],{"type":28,"value":19500},{"type":23,"tag":2161,"props":26846,"children":26847},{"class":2163,"line":924},[26848,26852,26856,26860,26864,26868,26872],{"type":23,"tag":2161,"props":26849,"children":26850},{"style":5830},[26851],{"type":28,"value":19508},{"type":23,"tag":2161,"props":26853,"children":26854},{"style":5948},[26855],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26857,"children":26858},{"style":5830},[26859],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26861,"children":26862},{"style":5844},[26863],{"type":28,"value":11446},{"type":23,"tag":2161,"props":26865,"children":26866},{"style":5830},[26867],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26869,"children":26870},{"style":5948},[26871],{"type":28,"value":19495},{"type":23,"tag":2161,"props":26873,"children":26874},{"style":5830},[26875],{"type":28,"value":15751},{"type":23,"tag":2161,"props":26877,"children":26878},{"class":2163,"line":2190},[26879,26883,26887,26891,26895,26899,26903,26907,26911,26915,26919],{"type":23,"tag":2161,"props":26880,"children":26881},{"style":5830},[26882],{"type":28,"value":19541},{"type":23,"tag":2161,"props":26884,"children":26885},{"style":5948},[26886],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26888,"children":26889},{"style":5830},[26890],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26892,"children":26893},{"style":5844},[26894],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26896,"children":26897},{"style":5830},[26898],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26900,"children":26901},{"style":5948},[26902],{"type":28,"value":19563},{"type":23,"tag":2161,"props":26904,"children":26905},{"style":5948},[26906],{"type":28,"value":19568},{"type":23,"tag":2161,"props":26908,"children":26909},{"style":5830},[26910],{"type":28,"value":19573},{"type":23,"tag":2161,"props":26912,"children":26913},{"style":5948},[26914],{"type":28,"value":19578},{"type":23,"tag":2161,"props":26916,"children":26917},{"style":5948},[26918],{"type":28,"value":19583},{"type":23,"tag":2161,"props":26920,"children":26921},{"style":5830},[26922],{"type":28,"value":15751},{"type":23,"tag":2161,"props":26924,"children":26925},{"class":2163,"line":2199},[26926,26930,26934,26938,26942,26946,26950,26954,26958,26962,26966],{"type":23,"tag":2161,"props":26927,"children":26928},{"style":5830},[26929],{"type":28,"value":19595},{"type":23,"tag":2161,"props":26931,"children":26932},{"style":5948},[26933],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26935,"children":26936},{"style":5830},[26937],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26939,"children":26940},{"style":5844},[26941],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26943,"children":26944},{"style":5830},[26945],{"type":28,"value":11049},{"type":23,"tag":2161,"props":26947,"children":26948},{"style":5948},[26949],{"type":28,"value":19563},{"type":23,"tag":2161,"props":26951,"children":26952},{"style":5948},[26953],{"type":28,"value":19568},{"type":23,"tag":2161,"props":26955,"children":26956},{"style":5830},[26957],{"type":28,"value":19573},{"type":23,"tag":2161,"props":26959,"children":26960},{"style":5948},[26961],{"type":28,"value":19578},{"type":23,"tag":2161,"props":26963,"children":26964},{"style":5948},[26965],{"type":28,"value":19583},{"type":23,"tag":2161,"props":26967,"children":26968},{"style":5830},[26969],{"type":28,"value":15751},{"type":23,"tag":2161,"props":26971,"children":26972},{"class":2163,"line":2208},[26973,26977,26981,26985,26989],{"type":23,"tag":2161,"props":26974,"children":26975},{"style":5830},[26976],{"type":28,"value":19643},{"type":23,"tag":2161,"props":26978,"children":26979},{"style":5948},[26980],{"type":28,"value":19513},{"type":23,"tag":2161,"props":26982,"children":26983},{"style":5830},[26984],{"type":28,"value":10486},{"type":23,"tag":2161,"props":26986,"children":26987},{"style":5844},[26988],{"type":28,"value":19554},{"type":23,"tag":2161,"props":26990,"children":26991},{"style":5830},[26992],{"type":28,"value":19660},{"type":23,"tag":2161,"props":26994,"children":26995},{"class":2163,"line":2217},[26996,27000,27004,27008,27012],{"type":23,"tag":2161,"props":26997,"children":26998},{"style":5830},[26999],{"type":28,"value":19668},{"type":23,"tag":2161,"props":27001,"children":27002},{"style":5948},[27003],{"type":28,"value":19513},{"type":23,"tag":2161,"props":27005,"children":27006},{"style":5830},[27007],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27009,"children":27010},{"style":5844},[27011],{"type":28,"value":19554},{"type":23,"tag":2161,"props":27013,"children":27014},{"style":5830},[27015],{"type":28,"value":19660},{"type":23,"tag":2161,"props":27017,"children":27018},{"class":2163,"line":2226},[27019,27023,27027,27031,27035],{"type":23,"tag":2161,"props":27020,"children":27021},{"style":5830},[27022],{"type":28,"value":19692},{"type":23,"tag":2161,"props":27024,"children":27025},{"style":5948},[27026],{"type":28,"value":19513},{"type":23,"tag":2161,"props":27028,"children":27029},{"style":5830},[27030],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27032,"children":27033},{"style":5844},[27034],{"type":28,"value":19554},{"type":23,"tag":2161,"props":27036,"children":27037},{"style":5830},[27038],{"type":28,"value":19660},{"type":23,"tag":2161,"props":27040,"children":27041},{"class":2163,"line":2235},[27042,27046,27050,27054,27058],{"type":23,"tag":2161,"props":27043,"children":27044},{"style":5830},[27045],{"type":28,"value":19716},{"type":23,"tag":2161,"props":27047,"children":27048},{"style":5948},[27049],{"type":28,"value":19513},{"type":23,"tag":2161,"props":27051,"children":27052},{"style":5830},[27053],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27055,"children":27056},{"style":5844},[27057],{"type":28,"value":19554},{"type":23,"tag":2161,"props":27059,"children":27060},{"style":5830},[27061],{"type":28,"value":19660},{"type":23,"tag":2161,"props":27063,"children":27064},{"class":2163,"line":2244},[27065,27069,27073,27077,27081],{"type":23,"tag":2161,"props":27066,"children":27067},{"style":5948},[27068],{"type":28,"value":19740},{"type":23,"tag":2161,"props":27070,"children":27071},{"style":5948},[27072],{"type":28,"value":19745},{"type":23,"tag":2161,"props":27074,"children":27075},{"style":5830},[27076],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27078,"children":27079},{"style":5844},[27080],{"type":28,"value":19554},{"type":23,"tag":2161,"props":27082,"children":27083},{"style":5830},[27084],{"type":28,"value":19660},{"type":23,"tag":2161,"props":27086,"children":27087},{"class":2163,"line":2253},[27088,27092,27096,27100,27104,27108],{"type":23,"tag":2161,"props":27089,"children":27090},{"style":5830},[27091],{"type":28,"value":19765},{"type":23,"tag":2161,"props":27093,"children":27094},{"style":5948},[27095],{"type":28,"value":19770},{"type":23,"tag":2161,"props":27097,"children":27098},{"style":5948},[27099],{"type":28,"value":19583},{"type":23,"tag":2161,"props":27101,"children":27102},{"style":5948},[27103],{"type":28,"value":19780},{"type":23,"tag":2161,"props":27105,"children":27106},{"style":5948},[27107],{"type":28,"value":19583},{"type":23,"tag":2161,"props":27109,"children":27110},{"style":5830},[27111],{"type":28,"value":15751},{"type":23,"tag":2161,"props":27113,"children":27114},{"class":2163,"line":6337},[27115,27119],{"type":23,"tag":2161,"props":27116,"children":27117},{"style":5948},[27118],{"type":28,"value":19793},{"type":23,"tag":2161,"props":27120,"children":27121},{"style":5830},[27122],{"type":28,"value":19798},{"type":23,"tag":2161,"props":27124,"children":27125},{"class":2163,"line":6365},[27126,27130,27134,27138,27142,27146,27150],{"type":23,"tag":2161,"props":27127,"children":27128},{"style":5830},[27129],{"type":28,"value":19807},{"type":23,"tag":2161,"props":27131,"children":27132},{"style":5948},[27133],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27135,"children":27136},{"style":5830},[27137],{"type":28,"value":19816},{"type":23,"tag":2161,"props":27139,"children":27140},{"style":5948},[27141],{"type":28,"value":19578},{"type":23,"tag":2161,"props":27143,"children":27144},{"style":5830},[27145],{"type":28,"value":19825},{"type":23,"tag":2161,"props":27147,"children":27148},{"style":5948},[27149],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27151,"children":27152},{"style":5830},[27153],{"type":28,"value":19834},{"type":23,"tag":890,"props":27155,"children":27156},{"start":924},[27157],{"type":23,"tag":403,"props":27158,"children":27159},{},[27160,27161,27166,27167,27173],{"type":28,"value":24249},{"type":23,"tag":99,"props":27162,"children":27164},{"className":27163},[],[27165],{"type":28,"value":24255},{"type":28,"value":24257},{"type":23,"tag":99,"props":27168,"children":27170},{"className":27169},[],[27171],{"type":28,"value":27172},"source-timestamp-mysql.properties",{"type":28,"value":24265},{"type":23,"tag":2152,"props":27175,"children":27177},{"className":20588,"code":27176,"language":20590,"meta":8,"style":8},"name=mysql-a-source-omneo\nconnector.class=io.confluent.connect.jdbc.JdbcSourceConnector\ntasks.max=1\nconnection.url=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Ftest_kafka_connector?user=root&password=1qaz@WSX\n# incrementing  自增\nmode=timestamp\n# 自增字段  pid\ntimestamp.column.name=commenttime\n# 白名单表  person\ntable.whitelist=omneo_timestamp\n# topic前缀   mysql-kafka-\ntopic.prefix=mysql-kafka-\n",[27178],{"type":23,"tag":99,"props":27179,"children":27180},{"__ignoreMap":8},[27181,27196,27207,27218,27241,27248,27264,27271,27284,27291,27303,27310],{"type":23,"tag":2161,"props":27182,"children":27183},{"class":2163,"line":2164},[27184,27188,27192],{"type":23,"tag":2161,"props":27185,"children":27186},{"style":5830},[27187],{"type":28,"value":15227},{"type":23,"tag":2161,"props":27189,"children":27190},{"style":5948},[27191],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27193,"children":27194},{"style":5855},[27195],{"type":28,"value":24288},{"type":23,"tag":2161,"props":27197,"children":27198},{"class":2163,"line":927},[27199,27203],{"type":23,"tag":2161,"props":27200,"children":27201},{"style":5824},[27202],{"type":28,"value":24296},{"type":23,"tag":2161,"props":27204,"children":27205},{"style":5855},[27206],{"type":28,"value":24301},{"type":23,"tag":2161,"props":27208,"children":27209},{"class":2163,"line":924},[27210,27214],{"type":23,"tag":2161,"props":27211,"children":27212},{"style":5824},[27213],{"type":28,"value":24309},{"type":23,"tag":2161,"props":27215,"children":27216},{"style":5855},[27217],{"type":28,"value":24314},{"type":23,"tag":2161,"props":27219,"children":27220},{"class":2163,"line":2190},[27221,27225,27229,27233,27237],{"type":23,"tag":2161,"props":27222,"children":27223},{"style":5824},[27224],{"type":28,"value":24322},{"type":23,"tag":2161,"props":27226,"children":27227},{"style":5855},[27228],{"type":28,"value":24327},{"type":23,"tag":2161,"props":27230,"children":27231},{"style":5830},[27232],{"type":28,"value":24332},{"type":23,"tag":2161,"props":27234,"children":27235},{"style":5948},[27236],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27238,"children":27239},{"style":5855},[27240],{"type":28,"value":24341},{"type":23,"tag":2161,"props":27242,"children":27243},{"class":2163,"line":2199},[27244],{"type":23,"tag":2161,"props":27245,"children":27246},{"style":5807},[27247],{"type":28,"value":24349},{"type":23,"tag":2161,"props":27249,"children":27250},{"class":2163,"line":2208},[27251,27255,27259],{"type":23,"tag":2161,"props":27252,"children":27253},{"style":5830},[27254],{"type":28,"value":24357},{"type":23,"tag":2161,"props":27256,"children":27257},{"style":5948},[27258],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27260,"children":27261},{"style":5855},[27262],{"type":28,"value":27263},"timestamp\n",{"type":23,"tag":2161,"props":27265,"children":27266},{"class":2163,"line":2217},[27267],{"type":23,"tag":2161,"props":27268,"children":27269},{"style":5807},[27270],{"type":28,"value":24374},{"type":23,"tag":2161,"props":27272,"children":27273},{"class":2163,"line":2226},[27274,27279],{"type":23,"tag":2161,"props":27275,"children":27276},{"style":5824},[27277],{"type":28,"value":27278},"timestamp.column.name",{"type":23,"tag":2161,"props":27280,"children":27281},{"style":5855},[27282],{"type":28,"value":27283},"=commenttime\n",{"type":23,"tag":2161,"props":27285,"children":27286},{"class":2163,"line":2235},[27287],{"type":23,"tag":2161,"props":27288,"children":27289},{"style":5807},[27290],{"type":28,"value":24395},{"type":23,"tag":2161,"props":27292,"children":27293},{"class":2163,"line":2244},[27294,27298],{"type":23,"tag":2161,"props":27295,"children":27296},{"style":5824},[27297],{"type":28,"value":24403},{"type":23,"tag":2161,"props":27299,"children":27300},{"style":5855},[27301],{"type":28,"value":27302},"=omneo_timestamp\n",{"type":23,"tag":2161,"props":27304,"children":27305},{"class":2163,"line":2253},[27306],{"type":23,"tag":2161,"props":27307,"children":27308},{"style":5807},[27309],{"type":28,"value":24416},{"type":23,"tag":2161,"props":27311,"children":27312},{"class":2163,"line":6337},[27313,27317],{"type":23,"tag":2161,"props":27314,"children":27315},{"style":5824},[27316],{"type":28,"value":24424},{"type":23,"tag":2161,"props":27318,"children":27319},{"style":5855},[27320],{"type":28,"value":24429},{"type":23,"tag":890,"props":27322,"children":27323},{"start":2190},[27324],{"type":23,"tag":403,"props":27325,"children":27326},{},[27327,27328,27334],{"type":28,"value":24437},{"type":23,"tag":99,"props":27329,"children":27331},{"className":27330},[],[27332],{"type":28,"value":27333},"sink-timestamp-mysql.properties",{"type":28,"value":24265},{"type":23,"tag":2152,"props":27336,"children":27338},{"className":20588,"code":27337,"language":20590,"meta":8,"style":8},"name=mysql-a-sink-omneo\nconnector.class=io.confluent.connect.jdbc.JdbcSinkConnector\ntasks.max=1\n#kafka的topic名称\ntopics=mysql-kafka-omneo\n# 配置JDBC链接\nconnection.url=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Fkafka_connector?user=root&password=1qaz@WSX\n# 不自动创建表，如果为true，会自动创建表，表名为topic名称\nauto.create=false\n# upsert model更新和插入\ninsert.mode=upsert\n# 下面两个参数配置了以pid为主键更新\npk.mode = record_value\npk.fields = pid\n#表名为kafkatable\ntable.name.format=kafka_omneo_timestamp\n",[27339],{"type":23,"tag":99,"props":27340,"children":27341},{"__ignoreMap":8},[27342,27357,27368,27379,27386,27402,27409,27432,27439,27454,27461,27472,27479,27494,27509,27516],{"type":23,"tag":2161,"props":27343,"children":27344},{"class":2163,"line":2164},[27345,27349,27353],{"type":23,"tag":2161,"props":27346,"children":27347},{"style":5830},[27348],{"type":28,"value":15227},{"type":23,"tag":2161,"props":27350,"children":27351},{"style":5948},[27352],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27354,"children":27355},{"style":5855},[27356],{"type":28,"value":24467},{"type":23,"tag":2161,"props":27358,"children":27359},{"class":2163,"line":927},[27360,27364],{"type":23,"tag":2161,"props":27361,"children":27362},{"style":5824},[27363],{"type":28,"value":24296},{"type":23,"tag":2161,"props":27365,"children":27366},{"style":5855},[27367],{"type":28,"value":24479},{"type":23,"tag":2161,"props":27369,"children":27370},{"class":2163,"line":924},[27371,27375],{"type":23,"tag":2161,"props":27372,"children":27373},{"style":5824},[27374],{"type":28,"value":24309},{"type":23,"tag":2161,"props":27376,"children":27377},{"style":5855},[27378],{"type":28,"value":24314},{"type":23,"tag":2161,"props":27380,"children":27381},{"class":2163,"line":2190},[27382],{"type":23,"tag":2161,"props":27383,"children":27384},{"style":5807},[27385],{"type":28,"value":24498},{"type":23,"tag":2161,"props":27387,"children":27388},{"class":2163,"line":2199},[27389,27393,27397],{"type":23,"tag":2161,"props":27390,"children":27391},{"style":5830},[27392],{"type":28,"value":24506},{"type":23,"tag":2161,"props":27394,"children":27395},{"style":5948},[27396],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27398,"children":27399},{"style":5855},[27400],{"type":28,"value":27401},"mysql-kafka-omneo\n",{"type":23,"tag":2161,"props":27403,"children":27404},{"class":2163,"line":2208},[27405],{"type":23,"tag":2161,"props":27406,"children":27407},{"style":5807},[27408],{"type":28,"value":24523},{"type":23,"tag":2161,"props":27410,"children":27411},{"class":2163,"line":2217},[27412,27416,27420,27424,27428],{"type":23,"tag":2161,"props":27413,"children":27414},{"style":5824},[27415],{"type":28,"value":24322},{"type":23,"tag":2161,"props":27417,"children":27418},{"style":5855},[27419],{"type":28,"value":24535},{"type":23,"tag":2161,"props":27421,"children":27422},{"style":5830},[27423],{"type":28,"value":24332},{"type":23,"tag":2161,"props":27425,"children":27426},{"style":5948},[27427],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27429,"children":27430},{"style":5855},[27431],{"type":28,"value":24341},{"type":23,"tag":2161,"props":27433,"children":27434},{"class":2163,"line":2226},[27435],{"type":23,"tag":2161,"props":27436,"children":27437},{"style":5807},[27438],{"type":28,"value":24555},{"type":23,"tag":2161,"props":27440,"children":27441},{"class":2163,"line":2235},[27442,27446,27450],{"type":23,"tag":2161,"props":27443,"children":27444},{"style":5824},[27445],{"type":28,"value":24563},{"type":23,"tag":2161,"props":27447,"children":27448},{"style":5855},[27449],{"type":28,"value":6258},{"type":23,"tag":2161,"props":27451,"children":27452},{"style":5844},[27453],{"type":28,"value":24572},{"type":23,"tag":2161,"props":27455,"children":27456},{"class":2163,"line":2244},[27457],{"type":23,"tag":2161,"props":27458,"children":27459},{"style":5807},[27460],{"type":28,"value":24580},{"type":23,"tag":2161,"props":27462,"children":27463},{"class":2163,"line":2253},[27464,27468],{"type":23,"tag":2161,"props":27465,"children":27466},{"style":5824},[27467],{"type":28,"value":24588},{"type":23,"tag":2161,"props":27469,"children":27470},{"style":5855},[27471],{"type":28,"value":24593},{"type":23,"tag":2161,"props":27473,"children":27474},{"class":2163,"line":6337},[27475],{"type":23,"tag":2161,"props":27476,"children":27477},{"style":5807},[27478],{"type":28,"value":24601},{"type":23,"tag":2161,"props":27480,"children":27481},{"class":2163,"line":6365},[27482,27486,27490],{"type":23,"tag":2161,"props":27483,"children":27484},{"style":5824},[27485],{"type":28,"value":24609},{"type":23,"tag":2161,"props":27487,"children":27488},{"style":5855},[27489],{"type":28,"value":24614},{"type":23,"tag":2161,"props":27491,"children":27492},{"style":5855},[27493],{"type":28,"value":24619},{"type":23,"tag":2161,"props":27495,"children":27496},{"class":2163,"line":6405},[27497,27501,27505],{"type":23,"tag":2161,"props":27498,"children":27499},{"style":5824},[27500],{"type":28,"value":24627},{"type":23,"tag":2161,"props":27502,"children":27503},{"style":5855},[27504],{"type":28,"value":24614},{"type":23,"tag":2161,"props":27506,"children":27507},{"style":5855},[27508],{"type":28,"value":24636},{"type":23,"tag":2161,"props":27510,"children":27511},{"class":2163,"line":19801},[27512],{"type":23,"tag":2161,"props":27513,"children":27514},{"style":5807},[27515],{"type":28,"value":24644},{"type":23,"tag":2161,"props":27517,"children":27518},{"class":2163,"line":19837},[27519,27523],{"type":23,"tag":2161,"props":27520,"children":27521},{"style":5824},[27522],{"type":28,"value":24652},{"type":23,"tag":2161,"props":27524,"children":27525},{"style":5855},[27526],{"type":28,"value":27527},"=kafka_omneo_timestamp\n",{"type":23,"tag":890,"props":27529,"children":27530},{"start":2199},[27531],{"type":23,"tag":403,"props":27532,"children":27533},{},[27534,27535,27539,27540,27546],{"type":28,"value":24665},{"type":23,"tag":86,"props":27536,"children":27537},{},[27538],{"type":28,"value":24670},{"type":28,"value":24672},{"type":23,"tag":99,"props":27541,"children":27543},{"className":27542},[],[27544],{"type":28,"value":27545},"mysql-kafka-omneo-timestamp",{"type":28,"value":24680},{"type":23,"tag":2152,"props":27548,"children":27550},{"className":20588,"code":27549,"language":20590,"meta":8,"style":8},"kafka-topics.sh --create --zookeeper master:2181 --replication-factor 1 --partitions 1 --topic mysql-kafka-omneo_timestamp\n",[27551],{"type":23,"tag":99,"props":27552,"children":27553},{"__ignoreMap":8},[27554],{"type":23,"tag":2161,"props":27555,"children":27556},{"class":2163,"line":2164},[27557,27561,27565,27569,27573,27577,27581,27585,27589,27593],{"type":23,"tag":2161,"props":27558,"children":27559},{"style":5824},[27560],{"type":28,"value":24695},{"type":23,"tag":2161,"props":27562,"children":27563},{"style":5844},[27564],{"type":28,"value":24700},{"type":23,"tag":2161,"props":27566,"children":27567},{"style":5844},[27568],{"type":28,"value":24705},{"type":23,"tag":2161,"props":27570,"children":27571},{"style":5855},[27572],{"type":28,"value":24710},{"type":23,"tag":2161,"props":27574,"children":27575},{"style":5844},[27576],{"type":28,"value":24715},{"type":23,"tag":2161,"props":27578,"children":27579},{"style":5844},[27580],{"type":28,"value":6175},{"type":23,"tag":2161,"props":27582,"children":27583},{"style":5844},[27584],{"type":28,"value":24724},{"type":23,"tag":2161,"props":27586,"children":27587},{"style":5844},[27588],{"type":28,"value":6175},{"type":23,"tag":2161,"props":27590,"children":27591},{"style":5844},[27592],{"type":28,"value":24733},{"type":23,"tag":2161,"props":27594,"children":27595},{"style":5855},[27596],{"type":28,"value":27597}," mysql-kafka-omneo_timestamp\n",{"type":23,"tag":890,"props":27599,"children":27600},{"start":2208},[27601],{"type":23,"tag":403,"props":27602,"children":27603},{},[27604,27605,27610],{"type":28,"value":24746},{"type":23,"tag":99,"props":27606,"children":27608},{"className":27607},[],[27609],{"type":28,"value":24752},{"type":28,"value":24680},{"type":23,"tag":2152,"props":27612,"children":27614},{"className":20588,"code":27613,"language":20590,"meta":8,"style":8},"connect-standalone.sh $KAFKA_HOME\u002Fconfig\u002Fconnect-standalone.properties $KAFKA_HOME\u002Fconfig\u002Fsource-timestamp-mysql.properties $KAFKA_HOME\u002Fconfig\u002Fsink-timestamp-mysql.properties\n",[27615],{"type":23,"tag":99,"props":27616,"children":27617},{"__ignoreMap":8},[27618],{"type":23,"tag":2161,"props":27619,"children":27620},{"class":2163,"line":2164},[27621,27625,27629,27633,27637,27642,27646],{"type":23,"tag":2161,"props":27622,"children":27623},{"style":5824},[27624],{"type":28,"value":24768},{"type":23,"tag":2161,"props":27626,"children":27627},{"style":5830},[27628],{"type":28,"value":24773},{"type":23,"tag":2161,"props":27630,"children":27631},{"style":5855},[27632],{"type":28,"value":24778},{"type":23,"tag":2161,"props":27634,"children":27635},{"style":5830},[27636],{"type":28,"value":24773},{"type":23,"tag":2161,"props":27638,"children":27639},{"style":5855},[27640],{"type":28,"value":27641},"\u002Fconfig\u002Fsource-timestamp-mysql.properties",{"type":23,"tag":2161,"props":27643,"children":27644},{"style":5830},[27645],{"type":28,"value":24773},{"type":23,"tag":2161,"props":27647,"children":27648},{"style":5855},[27649],{"type":28,"value":27650},"\u002Fconfig\u002Fsink-timestamp-mysql.properties\n",{"type":23,"tag":890,"props":27652,"children":27653},{"start":2217},[27654],{"type":23,"tag":403,"props":27655,"children":27656},{},[27657,27658,27664],{"type":28,"value":24816},{"type":23,"tag":99,"props":27659,"children":27661},{"className":27660},[],[27662],{"type":28,"value":27663},"test_kafka_connector.omneo_timestamp",{"type":28,"value":27665}," 插入4条测试数据",{"type":23,"tag":2152,"props":27667,"children":27669},{"className":19390,"code":27668,"language":19392,"meta":8,"style":8},"insert into omneo_timestamp values(1,'8379693542a7-5bdb-d564-3133-276ae3ce','Gauthier',\"O'Dell\",'30\u002F06\u002F1998','05274','Cocagne','male','maried','2018-01-01 00:00:01');\ninsert into omneo_timestamp values(2,'8379693542a7-5bdb-d564-3133-276ae3ce','Gauthier',\"O'Dell\",'30\u002F06\u002F1998','05274','Cocagne','male','maried','2018-01-01 00:03:45');\ninsert into omneo_timestamp values(3,'8379693542a7-5bdb-d564-3133-276ae3ce','Gauthier',\"O'Dell\",'30\u002F06\u002F1998','05274','Cocagne','male','maried','2018-01-01 00:06:01');\ninsert into omneo_timestamp values(4,'8379693542a7-5bdb-d564-3133-276ae3ce','Gauthier',\"O'Dell\",'30\u002F06\u002F1998','05274','Cocagne','male','maried','2018-01-01 00:10:01');\n",[27670],{"type":23,"tag":99,"props":27671,"children":27672},{"__ignoreMap":8},[27673,27774,27874,27974],{"type":23,"tag":2161,"props":27674,"children":27675},{"class":2163,"line":2164},[27676,27680,27685,27689,27693,27697,27701,27705,27709,27713,27717,27721,27725,27729,27733,27737,27741,27745,27749,27753,27757,27761,27765,27770],{"type":23,"tag":2161,"props":27677,"children":27678},{"style":5948},[27679],{"type":28,"value":19869},{"type":23,"tag":2161,"props":27681,"children":27682},{"style":5830},[27683],{"type":28,"value":27684}," omneo_timestamp ",{"type":23,"tag":2161,"props":27686,"children":27687},{"style":5948},[27688],{"type":28,"value":19879},{"type":23,"tag":2161,"props":27690,"children":27691},{"style":5830},[27692],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27694,"children":27695},{"style":5844},[27696],{"type":28,"value":3641},{"type":23,"tag":2161,"props":27698,"children":27699},{"style":5830},[27700],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27702,"children":27703},{"style":5855},[27704],{"type":28,"value":25191},{"type":23,"tag":2161,"props":27706,"children":27707},{"style":5830},[27708],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27710,"children":27711},{"style":5855},[27712],{"type":28,"value":25200},{"type":23,"tag":2161,"props":27714,"children":27715},{"style":5830},[27716],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27718,"children":27719},{"style":5855},[27720],{"type":28,"value":25978},{"type":23,"tag":2161,"props":27722,"children":27723},{"style":5830},[27724],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27726,"children":27727},{"style":5855},[27728],{"type":28,"value":25217},{"type":23,"tag":2161,"props":27730,"children":27731},{"style":5830},[27732],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27734,"children":27735},{"style":5855},[27736],{"type":28,"value":25015},{"type":23,"tag":2161,"props":27738,"children":27739},{"style":5830},[27740],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27742,"children":27743},{"style":5855},[27744],{"type":28,"value":25234},{"type":23,"tag":2161,"props":27746,"children":27747},{"style":5830},[27748],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27750,"children":27751},{"style":5855},[27752],{"type":28,"value":25243},{"type":23,"tag":2161,"props":27754,"children":27755},{"style":5830},[27756],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27758,"children":27759},{"style":5855},[27760],{"type":28,"value":24935},{"type":23,"tag":2161,"props":27762,"children":27763},{"style":5830},[27764],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27766,"children":27767},{"style":5855},[27768],{"type":28,"value":27769},"'2018-01-01 00:00:01'",{"type":23,"tag":2161,"props":27771,"children":27772},{"style":5830},[27773],{"type":28,"value":10626},{"type":23,"tag":2161,"props":27775,"children":27776},{"class":2163,"line":927},[27777,27781,27785,27789,27793,27797,27801,27805,27809,27813,27817,27821,27825,27829,27833,27837,27841,27845,27849,27853,27857,27861,27865,27870],{"type":23,"tag":2161,"props":27778,"children":27779},{"style":5948},[27780],{"type":28,"value":19869},{"type":23,"tag":2161,"props":27782,"children":27783},{"style":5830},[27784],{"type":28,"value":27684},{"type":23,"tag":2161,"props":27786,"children":27787},{"style":5948},[27788],{"type":28,"value":19879},{"type":23,"tag":2161,"props":27790,"children":27791},{"style":5830},[27792],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27794,"children":27795},{"style":5844},[27796],{"type":28,"value":3664},{"type":23,"tag":2161,"props":27798,"children":27799},{"style":5830},[27800],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27802,"children":27803},{"style":5855},[27804],{"type":28,"value":25191},{"type":23,"tag":2161,"props":27806,"children":27807},{"style":5830},[27808],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27810,"children":27811},{"style":5855},[27812],{"type":28,"value":25200},{"type":23,"tag":2161,"props":27814,"children":27815},{"style":5830},[27816],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27818,"children":27819},{"style":5855},[27820],{"type":28,"value":25978},{"type":23,"tag":2161,"props":27822,"children":27823},{"style":5830},[27824],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27826,"children":27827},{"style":5855},[27828],{"type":28,"value":25217},{"type":23,"tag":2161,"props":27830,"children":27831},{"style":5830},[27832],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27834,"children":27835},{"style":5855},[27836],{"type":28,"value":25015},{"type":23,"tag":2161,"props":27838,"children":27839},{"style":5830},[27840],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27842,"children":27843},{"style":5855},[27844],{"type":28,"value":25234},{"type":23,"tag":2161,"props":27846,"children":27847},{"style":5830},[27848],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27850,"children":27851},{"style":5855},[27852],{"type":28,"value":25243},{"type":23,"tag":2161,"props":27854,"children":27855},{"style":5830},[27856],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27858,"children":27859},{"style":5855},[27860],{"type":28,"value":24935},{"type":23,"tag":2161,"props":27862,"children":27863},{"style":5830},[27864],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27866,"children":27867},{"style":5855},[27868],{"type":28,"value":27869},"'2018-01-01 00:03:45'",{"type":23,"tag":2161,"props":27871,"children":27872},{"style":5830},[27873],{"type":28,"value":10626},{"type":23,"tag":2161,"props":27875,"children":27876},{"class":2163,"line":924},[27877,27881,27885,27889,27893,27897,27901,27905,27909,27913,27917,27921,27925,27929,27933,27937,27941,27945,27949,27953,27957,27961,27965,27970],{"type":23,"tag":2161,"props":27878,"children":27879},{"style":5948},[27880],{"type":28,"value":19869},{"type":23,"tag":2161,"props":27882,"children":27883},{"style":5830},[27884],{"type":28,"value":27684},{"type":23,"tag":2161,"props":27886,"children":27887},{"style":5948},[27888],{"type":28,"value":19879},{"type":23,"tag":2161,"props":27890,"children":27891},{"style":5830},[27892],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27894,"children":27895},{"style":5844},[27896],{"type":28,"value":3687},{"type":23,"tag":2161,"props":27898,"children":27899},{"style":5830},[27900],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27902,"children":27903},{"style":5855},[27904],{"type":28,"value":25191},{"type":23,"tag":2161,"props":27906,"children":27907},{"style":5830},[27908],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27910,"children":27911},{"style":5855},[27912],{"type":28,"value":25200},{"type":23,"tag":2161,"props":27914,"children":27915},{"style":5830},[27916],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27918,"children":27919},{"style":5855},[27920],{"type":28,"value":25978},{"type":23,"tag":2161,"props":27922,"children":27923},{"style":5830},[27924],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27926,"children":27927},{"style":5855},[27928],{"type":28,"value":25217},{"type":23,"tag":2161,"props":27930,"children":27931},{"style":5830},[27932],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27934,"children":27935},{"style":5855},[27936],{"type":28,"value":25015},{"type":23,"tag":2161,"props":27938,"children":27939},{"style":5830},[27940],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27942,"children":27943},{"style":5855},[27944],{"type":28,"value":25234},{"type":23,"tag":2161,"props":27946,"children":27947},{"style":5830},[27948],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27950,"children":27951},{"style":5855},[27952],{"type":28,"value":25243},{"type":23,"tag":2161,"props":27954,"children":27955},{"style":5830},[27956],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27958,"children":27959},{"style":5855},[27960],{"type":28,"value":24935},{"type":23,"tag":2161,"props":27962,"children":27963},{"style":5830},[27964],{"type":28,"value":19892},{"type":23,"tag":2161,"props":27966,"children":27967},{"style":5855},[27968],{"type":28,"value":27969},"'2018-01-01 00:06:01'",{"type":23,"tag":2161,"props":27971,"children":27972},{"style":5830},[27973],{"type":28,"value":10626},{"type":23,"tag":2161,"props":27975,"children":27976},{"class":2163,"line":2190},[27977,27981,27985,27989,27993,27997,28001,28005,28009,28013,28017,28021,28025,28029,28033,28037,28041,28045,28049,28053,28057,28061,28065,28070],{"type":23,"tag":2161,"props":27978,"children":27979},{"style":5948},[27980],{"type":28,"value":19869},{"type":23,"tag":2161,"props":27982,"children":27983},{"style":5830},[27984],{"type":28,"value":27684},{"type":23,"tag":2161,"props":27986,"children":27987},{"style":5948},[27988],{"type":28,"value":19879},{"type":23,"tag":2161,"props":27990,"children":27991},{"style":5830},[27992],{"type":28,"value":10486},{"type":23,"tag":2161,"props":27994,"children":27995},{"style":5844},[27996],{"type":28,"value":3710},{"type":23,"tag":2161,"props":27998,"children":27999},{"style":5830},[28000],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28002,"children":28003},{"style":5855},[28004],{"type":28,"value":25191},{"type":23,"tag":2161,"props":28006,"children":28007},{"style":5830},[28008],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28010,"children":28011},{"style":5855},[28012],{"type":28,"value":25200},{"type":23,"tag":2161,"props":28014,"children":28015},{"style":5830},[28016],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28018,"children":28019},{"style":5855},[28020],{"type":28,"value":25978},{"type":23,"tag":2161,"props":28022,"children":28023},{"style":5830},[28024],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28026,"children":28027},{"style":5855},[28028],{"type":28,"value":25217},{"type":23,"tag":2161,"props":28030,"children":28031},{"style":5830},[28032],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28034,"children":28035},{"style":5855},[28036],{"type":28,"value":25015},{"type":23,"tag":2161,"props":28038,"children":28039},{"style":5830},[28040],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28042,"children":28043},{"style":5855},[28044],{"type":28,"value":25234},{"type":23,"tag":2161,"props":28046,"children":28047},{"style":5830},[28048],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28050,"children":28051},{"style":5855},[28052],{"type":28,"value":25243},{"type":23,"tag":2161,"props":28054,"children":28055},{"style":5830},[28056],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28058,"children":28059},{"style":5855},[28060],{"type":28,"value":24935},{"type":23,"tag":2161,"props":28062,"children":28063},{"style":5830},[28064],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28066,"children":28067},{"style":5855},[28068],{"type":28,"value":28069},"'2018-01-01 00:10:01'",{"type":23,"tag":2161,"props":28071,"children":28072},{"style":5830},[28073],{"type":28,"value":10626},{"type":23,"tag":890,"props":28075,"children":28076},{"start":2226},[28077,28089],{"type":23,"tag":403,"props":28078,"children":28079},{},[28080,28081,28087],{"type":28,"value":25883},{"type":23,"tag":99,"props":28082,"children":28084},{"className":28083},[],[28085],{"type":28,"value":28086},"mysql-kafka-omneo_timestamp",{"type":28,"value":28088}," 主题数据被消费到了控制台。",{"type":23,"tag":403,"props":28090,"children":28091},{},[28092,28094,28099,28100,28105,28106,28112,28114],{"type":28,"value":28093},"修改 pid 为 ",{"type":23,"tag":99,"props":28095,"children":28097},{"className":28096},[],[28098],{"type":28,"value":3664},{"type":28,"value":1148},{"type":23,"tag":99,"props":28101,"children":28103},{"className":28102},[],[28104],{"type":28,"value":3710},{"type":28,"value":9348},{"type":23,"tag":99,"props":28107,"children":28109},{"className":28108},[],[28110],{"type":28,"value":28111},"firstname",{"type":28,"value":28113}," ，并修改业务时间字段 ",{"type":23,"tag":99,"props":28115,"children":28117},{"className":28116},[],[28118],{"type":28,"value":28119},"commenttime",{"type":23,"tag":2152,"props":28121,"children":28123},{"className":19390,"code":28122,"language":19392,"meta":8,"style":8},"update omneo_timestamp set firstname = \"world\" ,commenttime=\"2018-12-20 15:55:10\" where pid in(2,4);\n",[28124],{"type":23,"tag":99,"props":28125,"children":28126},{"__ignoreMap":8},[28127],{"type":23,"tag":2161,"props":28128,"children":28129},{"class":2163,"line":2164},[28130,28134,28138,28142,28146,28150,28154,28158,28162,28167,28171,28175,28179,28183,28187,28191,28195],{"type":23,"tag":2161,"props":28131,"children":28132},{"style":5948},[28133],{"type":28,"value":20315},{"type":23,"tag":2161,"props":28135,"children":28136},{"style":5830},[28137],{"type":28,"value":27684},{"type":23,"tag":2161,"props":28139,"children":28140},{"style":5948},[28141],{"type":28,"value":17812},{"type":23,"tag":2161,"props":28143,"children":28144},{"style":5830},[28145],{"type":28,"value":20328},{"type":23,"tag":2161,"props":28147,"children":28148},{"style":5948},[28149],{"type":28,"value":6258},{"type":23,"tag":2161,"props":28151,"children":28152},{"style":5855},[28153],{"type":28,"value":20337},{"type":23,"tag":2161,"props":28155,"children":28156},{"style":5830},[28157],{"type":28,"value":20342},{"type":23,"tag":2161,"props":28159,"children":28160},{"style":5948},[28161],{"type":28,"value":6258},{"type":23,"tag":2161,"props":28163,"children":28164},{"style":5855},[28165],{"type":28,"value":28166},"\"2018-12-20 15:55:10\"",{"type":23,"tag":2161,"props":28168,"children":28169},{"style":5948},[28170],{"type":28,"value":20356},{"type":23,"tag":2161,"props":28172,"children":28173},{"style":5830},[28174],{"type":28,"value":20361},{"type":23,"tag":2161,"props":28176,"children":28177},{"style":5948},[28178],{"type":28,"value":20366},{"type":23,"tag":2161,"props":28180,"children":28181},{"style":5830},[28182],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28184,"children":28185},{"style":5844},[28186],{"type":28,"value":3664},{"type":23,"tag":2161,"props":28188,"children":28189},{"style":5830},[28190],{"type":28,"value":19892},{"type":23,"tag":2161,"props":28192,"children":28193},{"style":5844},[28194],{"type":28,"value":3710},{"type":23,"tag":2161,"props":28196,"children":28197},{"style":5830},[28198],{"type":28,"value":10626},{"type":23,"tag":890,"props":28200,"children":28201},{"start":2244},[28202],{"type":23,"tag":403,"props":28203,"children":28204},{},[28205,28206,28211],{"type":28,"value":25883},{"type":23,"tag":99,"props":28207,"children":28209},{"className":28208},[],[28210],{"type":28,"value":28086},{"type":28,"value":28212}," 主题数据产生了变化",{"type":23,"tag":50,"props":28214,"children":28216},{"id":28215},"timestamp-结论",[28217],{"type":28,"value":28218},"timestamp 结论",{"type":23,"tag":890,"props":28220,"children":28221},{},[28222,28227],{"type":23,"tag":403,"props":28223,"children":28224},{},[28225],{"type":28,"value":28226},"如果修改的时间戳早于latest time ，则不会洞察到更新。例如MySQL中的now()获取当前时间就是很好的能被获取到的例子。",{"type":23,"tag":403,"props":28228,"children":28229},{},[28230],{"type":28,"value":28231},"源表向目标表传输数据，假设有两条（或以上）的数据行拥有同样的时间戳，如果在传输第二条的过程中崩溃，恢复过后第二条将会被丢失，因为latest time已经被记录过了，他只会去找更新的下一次时间。这种方式虽然能获取到update更新，但是不够稳健。而如果使用自增字段加时间戳字段混合的方式，即使崩溃也能记录到更新的最大ID,恢复之后可以被找到不会丢失。因此我们更推荐第三种方式！timestamp+incrementing",{"type":23,"tag":50,"props":28233,"children":28235},{"id":28234},"incrementing-timestamp-混合模式",[28236],{"type":28,"value":28237},"incrementing + timestamp 混合模式",{"type":23,"tag":890,"props":28239,"children":28240},{},[28241],{"type":23,"tag":403,"props":28242,"children":28243},{},[28244,28245,28250],{"type":28,"value":24665},{"type":23,"tag":99,"props":28246,"children":28248},{"className":28247},[],[28249],{"type":28,"value":26358},{"type":28,"value":28251}," 库 omneo_incrementing_timestamp 测试表",{"type":23,"tag":2152,"props":28253,"children":28255},{"className":19390,"code":28254,"language":19392,"meta":8,"style":8},"CREATE TABLE IF NOT EXISTS test_kafka_connector.omneo_incrementing_timestamp(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    commenttime timestamp NOT NULL DEFAULT current_timestamp,\n    PRIMARY KEY (pid)\n)ENGINE=InnoDB DEFAULT CHARSET=utf8;\n",[28256],{"type":23,"tag":99,"props":28257,"children":28258},{"__ignoreMap":8},[28259,28299,28330,28361,28408,28455,28478,28501,28524,28547,28570,28593,28604],{"type":23,"tag":2161,"props":28260,"children":28261},{"class":2163,"line":2164},[28262,28266,28270,28274,28278,28282,28286,28290,28295],{"type":23,"tag":2161,"props":28263,"children":28264},{"style":5948},[28265],{"type":28,"value":19424},{"type":23,"tag":2161,"props":28267,"children":28268},{"style":5948},[28269],{"type":28,"value":19429},{"type":23,"tag":2161,"props":28271,"children":28272},{"style":5824},[28273],{"type":28,"value":19434},{"type":23,"tag":2161,"props":28275,"children":28276},{"style":5948},[28277],{"type":28,"value":19439},{"type":23,"tag":2161,"props":28279,"children":28280},{"style":5948},[28281],{"type":28,"value":19444},{"type":23,"tag":2161,"props":28283,"children":28284},{"style":5844},[28285],{"type":28,"value":23525},{"type":23,"tag":2161,"props":28287,"children":28288},{"style":5830},[28289],{"type":28,"value":19454},{"type":23,"tag":2161,"props":28291,"children":28292},{"style":5844},[28293],{"type":28,"value":28294},"omneo_incrementing_timestamp",{"type":23,"tag":2161,"props":28296,"children":28297},{"style":5830},[28298],{"type":28,"value":19464},{"type":23,"tag":2161,"props":28300,"children":28301},{"class":2163,"line":927},[28302,28306,28310,28314,28318,28322,28326],{"type":23,"tag":2161,"props":28303,"children":28304},{"style":5830},[28305],{"type":28,"value":19472},{"type":23,"tag":2161,"props":28307,"children":28308},{"style":5948},[28309],{"type":28,"value":19477},{"type":23,"tag":2161,"props":28311,"children":28312},{"style":5830},[28313],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28315,"children":28316},{"style":5844},[28317],{"type":28,"value":19486},{"type":23,"tag":2161,"props":28319,"children":28320},{"style":5830},[28321],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28323,"children":28324},{"style":5948},[28325],{"type":28,"value":19495},{"type":23,"tag":2161,"props":28327,"children":28328},{"style":5830},[28329],{"type":28,"value":19500},{"type":23,"tag":2161,"props":28331,"children":28332},{"class":2163,"line":924},[28333,28337,28341,28345,28349,28353,28357],{"type":23,"tag":2161,"props":28334,"children":28335},{"style":5830},[28336],{"type":28,"value":19508},{"type":23,"tag":2161,"props":28338,"children":28339},{"style":5948},[28340],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28342,"children":28343},{"style":5830},[28344],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28346,"children":28347},{"style":5844},[28348],{"type":28,"value":11446},{"type":23,"tag":2161,"props":28350,"children":28351},{"style":5830},[28352],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28354,"children":28355},{"style":5948},[28356],{"type":28,"value":19495},{"type":23,"tag":2161,"props":28358,"children":28359},{"style":5830},[28360],{"type":28,"value":15751},{"type":23,"tag":2161,"props":28362,"children":28363},{"class":2163,"line":2190},[28364,28368,28372,28376,28380,28384,28388,28392,28396,28400,28404],{"type":23,"tag":2161,"props":28365,"children":28366},{"style":5830},[28367],{"type":28,"value":19541},{"type":23,"tag":2161,"props":28369,"children":28370},{"style":5948},[28371],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28373,"children":28374},{"style":5830},[28375],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28377,"children":28378},{"style":5844},[28379],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28381,"children":28382},{"style":5830},[28383],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28385,"children":28386},{"style":5948},[28387],{"type":28,"value":19563},{"type":23,"tag":2161,"props":28389,"children":28390},{"style":5948},[28391],{"type":28,"value":19568},{"type":23,"tag":2161,"props":28393,"children":28394},{"style":5830},[28395],{"type":28,"value":19573},{"type":23,"tag":2161,"props":28397,"children":28398},{"style":5948},[28399],{"type":28,"value":19578},{"type":23,"tag":2161,"props":28401,"children":28402},{"style":5948},[28403],{"type":28,"value":19583},{"type":23,"tag":2161,"props":28405,"children":28406},{"style":5830},[28407],{"type":28,"value":15751},{"type":23,"tag":2161,"props":28409,"children":28410},{"class":2163,"line":2199},[28411,28415,28419,28423,28427,28431,28435,28439,28443,28447,28451],{"type":23,"tag":2161,"props":28412,"children":28413},{"style":5830},[28414],{"type":28,"value":19595},{"type":23,"tag":2161,"props":28416,"children":28417},{"style":5948},[28418],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28420,"children":28421},{"style":5830},[28422],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28424,"children":28425},{"style":5844},[28426],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28428,"children":28429},{"style":5830},[28430],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28432,"children":28433},{"style":5948},[28434],{"type":28,"value":19563},{"type":23,"tag":2161,"props":28436,"children":28437},{"style":5948},[28438],{"type":28,"value":19568},{"type":23,"tag":2161,"props":28440,"children":28441},{"style":5830},[28442],{"type":28,"value":19573},{"type":23,"tag":2161,"props":28444,"children":28445},{"style":5948},[28446],{"type":28,"value":19578},{"type":23,"tag":2161,"props":28448,"children":28449},{"style":5948},[28450],{"type":28,"value":19583},{"type":23,"tag":2161,"props":28452,"children":28453},{"style":5830},[28454],{"type":28,"value":15751},{"type":23,"tag":2161,"props":28456,"children":28457},{"class":2163,"line":2208},[28458,28462,28466,28470,28474],{"type":23,"tag":2161,"props":28459,"children":28460},{"style":5830},[28461],{"type":28,"value":19643},{"type":23,"tag":2161,"props":28463,"children":28464},{"style":5948},[28465],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28467,"children":28468},{"style":5830},[28469],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28471,"children":28472},{"style":5844},[28473],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28475,"children":28476},{"style":5830},[28477],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28479,"children":28480},{"class":2163,"line":2217},[28481,28485,28489,28493,28497],{"type":23,"tag":2161,"props":28482,"children":28483},{"style":5830},[28484],{"type":28,"value":19668},{"type":23,"tag":2161,"props":28486,"children":28487},{"style":5948},[28488],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28490,"children":28491},{"style":5830},[28492],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28494,"children":28495},{"style":5844},[28496],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28498,"children":28499},{"style":5830},[28500],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28502,"children":28503},{"class":2163,"line":2226},[28504,28508,28512,28516,28520],{"type":23,"tag":2161,"props":28505,"children":28506},{"style":5830},[28507],{"type":28,"value":19692},{"type":23,"tag":2161,"props":28509,"children":28510},{"style":5948},[28511],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28513,"children":28514},{"style":5830},[28515],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28517,"children":28518},{"style":5844},[28519],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28521,"children":28522},{"style":5830},[28523],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28525,"children":28526},{"class":2163,"line":2235},[28527,28531,28535,28539,28543],{"type":23,"tag":2161,"props":28528,"children":28529},{"style":5830},[28530],{"type":28,"value":19716},{"type":23,"tag":2161,"props":28532,"children":28533},{"style":5948},[28534],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28536,"children":28537},{"style":5830},[28538],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28540,"children":28541},{"style":5844},[28542],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28544,"children":28545},{"style":5830},[28546],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28548,"children":28549},{"class":2163,"line":2244},[28550,28554,28558,28562,28566],{"type":23,"tag":2161,"props":28551,"children":28552},{"style":5948},[28553],{"type":28,"value":19740},{"type":23,"tag":2161,"props":28555,"children":28556},{"style":5948},[28557],{"type":28,"value":19745},{"type":23,"tag":2161,"props":28559,"children":28560},{"style":5830},[28561],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28563,"children":28564},{"style":5844},[28565],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28567,"children":28568},{"style":5830},[28569],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28571,"children":28572},{"class":2163,"line":2253},[28573,28577,28581,28585,28589],{"type":23,"tag":2161,"props":28574,"children":28575},{"style":5830},[28576],{"type":28,"value":19765},{"type":23,"tag":2161,"props":28578,"children":28579},{"style":5948},[28580],{"type":28,"value":19770},{"type":23,"tag":2161,"props":28582,"children":28583},{"style":5948},[28584],{"type":28,"value":19775},{"type":23,"tag":2161,"props":28586,"children":28587},{"style":5948},[28588],{"type":28,"value":19780},{"type":23,"tag":2161,"props":28590,"children":28591},{"style":5830},[28592],{"type":28,"value":19785},{"type":23,"tag":2161,"props":28594,"children":28595},{"class":2163,"line":6337},[28596,28600],{"type":23,"tag":2161,"props":28597,"children":28598},{"style":5948},[28599],{"type":28,"value":19793},{"type":23,"tag":2161,"props":28601,"children":28602},{"style":5830},[28603],{"type":28,"value":19798},{"type":23,"tag":2161,"props":28605,"children":28606},{"class":2163,"line":6365},[28607,28611,28615,28619,28623,28627,28631],{"type":23,"tag":2161,"props":28608,"children":28609},{"style":5830},[28610],{"type":28,"value":19807},{"type":23,"tag":2161,"props":28612,"children":28613},{"style":5948},[28614],{"type":28,"value":6258},{"type":23,"tag":2161,"props":28616,"children":28617},{"style":5830},[28618],{"type":28,"value":19816},{"type":23,"tag":2161,"props":28620,"children":28621},{"style":5948},[28622],{"type":28,"value":19578},{"type":23,"tag":2161,"props":28624,"children":28625},{"style":5830},[28626],{"type":28,"value":19825},{"type":23,"tag":2161,"props":28628,"children":28629},{"style":5948},[28630],{"type":28,"value":6258},{"type":23,"tag":2161,"props":28632,"children":28633},{"style":5830},[28634],{"type":28,"value":19834},{"type":23,"tag":890,"props":28636,"children":28637},{"start":927},[28638],{"type":23,"tag":403,"props":28639,"children":28640},{},[28641,28642,28647],{"type":28,"value":24665},{"type":23,"tag":99,"props":28643,"children":28645},{"className":28644},[],[28646],{"type":28,"value":26764},{"type":28,"value":28648}," 库 kafka_omneo_incrementing_timestamp 测试表",{"type":23,"tag":2152,"props":28650,"children":28652},{"className":19390,"code":28651,"language":19392,"meta":8,"style":8},"CREATE TABLE IF NOT EXISTS kafka_connector.kafka_omneo_incrementing_timestamp(\n    pid int(11) NOT NULL AUTO_INCREMENT,\n    uuid varchar(100) NOT NULL,\n    firstname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    lastname varchar(20) CHARACTER SET utf8 DEFAULT NULL,\n    birthdate varchar(20),\n    postalcode varchar(20),\n    city varchar(20),\n    sexe varchar(20),\n    status varchar(20),\n    commenttime timestamp NOT NULL DEFAULT current_timestamp,\n    PRIMARY KEY (pid)\n)ENGINE=InnoDB DEFAULT CHARSET=utf8;\n",[28653],{"type":23,"tag":99,"props":28654,"children":28655},{"__ignoreMap":8},[28656,28696,28727,28758,28805,28852,28875,28898,28921,28944,28967,28990,29001],{"type":23,"tag":2161,"props":28657,"children":28658},{"class":2163,"line":2164},[28659,28663,28667,28671,28675,28679,28683,28687,28692],{"type":23,"tag":2161,"props":28660,"children":28661},{"style":5948},[28662],{"type":28,"value":19424},{"type":23,"tag":2161,"props":28664,"children":28665},{"style":5948},[28666],{"type":28,"value":19429},{"type":23,"tag":2161,"props":28668,"children":28669},{"style":5824},[28670],{"type":28,"value":19434},{"type":23,"tag":2161,"props":28672,"children":28673},{"style":5948},[28674],{"type":28,"value":19439},{"type":23,"tag":2161,"props":28676,"children":28677},{"style":5948},[28678],{"type":28,"value":19444},{"type":23,"tag":2161,"props":28680,"children":28681},{"style":5844},[28682],{"type":28,"value":23903},{"type":23,"tag":2161,"props":28684,"children":28685},{"style":5830},[28686],{"type":28,"value":19454},{"type":23,"tag":2161,"props":28688,"children":28689},{"style":5844},[28690],{"type":28,"value":28691},"kafka_omneo_incrementing_timestamp",{"type":23,"tag":2161,"props":28693,"children":28694},{"style":5830},[28695],{"type":28,"value":19464},{"type":23,"tag":2161,"props":28697,"children":28698},{"class":2163,"line":927},[28699,28703,28707,28711,28715,28719,28723],{"type":23,"tag":2161,"props":28700,"children":28701},{"style":5830},[28702],{"type":28,"value":19472},{"type":23,"tag":2161,"props":28704,"children":28705},{"style":5948},[28706],{"type":28,"value":19477},{"type":23,"tag":2161,"props":28708,"children":28709},{"style":5830},[28710],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28712,"children":28713},{"style":5844},[28714],{"type":28,"value":19486},{"type":23,"tag":2161,"props":28716,"children":28717},{"style":5830},[28718],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28720,"children":28721},{"style":5948},[28722],{"type":28,"value":19495},{"type":23,"tag":2161,"props":28724,"children":28725},{"style":5830},[28726],{"type":28,"value":19500},{"type":23,"tag":2161,"props":28728,"children":28729},{"class":2163,"line":924},[28730,28734,28738,28742,28746,28750,28754],{"type":23,"tag":2161,"props":28731,"children":28732},{"style":5830},[28733],{"type":28,"value":19508},{"type":23,"tag":2161,"props":28735,"children":28736},{"style":5948},[28737],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28739,"children":28740},{"style":5830},[28741],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28743,"children":28744},{"style":5844},[28745],{"type":28,"value":11446},{"type":23,"tag":2161,"props":28747,"children":28748},{"style":5830},[28749],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28751,"children":28752},{"style":5948},[28753],{"type":28,"value":19495},{"type":23,"tag":2161,"props":28755,"children":28756},{"style":5830},[28757],{"type":28,"value":15751},{"type":23,"tag":2161,"props":28759,"children":28760},{"class":2163,"line":2190},[28761,28765,28769,28773,28777,28781,28785,28789,28793,28797,28801],{"type":23,"tag":2161,"props":28762,"children":28763},{"style":5830},[28764],{"type":28,"value":19541},{"type":23,"tag":2161,"props":28766,"children":28767},{"style":5948},[28768],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28770,"children":28771},{"style":5830},[28772],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28774,"children":28775},{"style":5844},[28776],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28778,"children":28779},{"style":5830},[28780],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28782,"children":28783},{"style":5948},[28784],{"type":28,"value":19563},{"type":23,"tag":2161,"props":28786,"children":28787},{"style":5948},[28788],{"type":28,"value":19568},{"type":23,"tag":2161,"props":28790,"children":28791},{"style":5830},[28792],{"type":28,"value":19573},{"type":23,"tag":2161,"props":28794,"children":28795},{"style":5948},[28796],{"type":28,"value":19578},{"type":23,"tag":2161,"props":28798,"children":28799},{"style":5948},[28800],{"type":28,"value":19583},{"type":23,"tag":2161,"props":28802,"children":28803},{"style":5830},[28804],{"type":28,"value":15751},{"type":23,"tag":2161,"props":28806,"children":28807},{"class":2163,"line":2199},[28808,28812,28816,28820,28824,28828,28832,28836,28840,28844,28848],{"type":23,"tag":2161,"props":28809,"children":28810},{"style":5830},[28811],{"type":28,"value":19595},{"type":23,"tag":2161,"props":28813,"children":28814},{"style":5948},[28815],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28817,"children":28818},{"style":5830},[28819],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28821,"children":28822},{"style":5844},[28823],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28825,"children":28826},{"style":5830},[28827],{"type":28,"value":11049},{"type":23,"tag":2161,"props":28829,"children":28830},{"style":5948},[28831],{"type":28,"value":19563},{"type":23,"tag":2161,"props":28833,"children":28834},{"style":5948},[28835],{"type":28,"value":19568},{"type":23,"tag":2161,"props":28837,"children":28838},{"style":5830},[28839],{"type":28,"value":19573},{"type":23,"tag":2161,"props":28841,"children":28842},{"style":5948},[28843],{"type":28,"value":19578},{"type":23,"tag":2161,"props":28845,"children":28846},{"style":5948},[28847],{"type":28,"value":19583},{"type":23,"tag":2161,"props":28849,"children":28850},{"style":5830},[28851],{"type":28,"value":15751},{"type":23,"tag":2161,"props":28853,"children":28854},{"class":2163,"line":2208},[28855,28859,28863,28867,28871],{"type":23,"tag":2161,"props":28856,"children":28857},{"style":5830},[28858],{"type":28,"value":19643},{"type":23,"tag":2161,"props":28860,"children":28861},{"style":5948},[28862],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28864,"children":28865},{"style":5830},[28866],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28868,"children":28869},{"style":5844},[28870],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28872,"children":28873},{"style":5830},[28874],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28876,"children":28877},{"class":2163,"line":2217},[28878,28882,28886,28890,28894],{"type":23,"tag":2161,"props":28879,"children":28880},{"style":5830},[28881],{"type":28,"value":19668},{"type":23,"tag":2161,"props":28883,"children":28884},{"style":5948},[28885],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28887,"children":28888},{"style":5830},[28889],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28891,"children":28892},{"style":5844},[28893],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28895,"children":28896},{"style":5830},[28897],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28899,"children":28900},{"class":2163,"line":2226},[28901,28905,28909,28913,28917],{"type":23,"tag":2161,"props":28902,"children":28903},{"style":5830},[28904],{"type":28,"value":19692},{"type":23,"tag":2161,"props":28906,"children":28907},{"style":5948},[28908],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28910,"children":28911},{"style":5830},[28912],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28914,"children":28915},{"style":5844},[28916],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28918,"children":28919},{"style":5830},[28920],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28922,"children":28923},{"class":2163,"line":2235},[28924,28928,28932,28936,28940],{"type":23,"tag":2161,"props":28925,"children":28926},{"style":5830},[28927],{"type":28,"value":19716},{"type":23,"tag":2161,"props":28929,"children":28930},{"style":5948},[28931],{"type":28,"value":19513},{"type":23,"tag":2161,"props":28933,"children":28934},{"style":5830},[28935],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28937,"children":28938},{"style":5844},[28939],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28941,"children":28942},{"style":5830},[28943],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28945,"children":28946},{"class":2163,"line":2244},[28947,28951,28955,28959,28963],{"type":23,"tag":2161,"props":28948,"children":28949},{"style":5948},[28950],{"type":28,"value":19740},{"type":23,"tag":2161,"props":28952,"children":28953},{"style":5948},[28954],{"type":28,"value":19745},{"type":23,"tag":2161,"props":28956,"children":28957},{"style":5830},[28958],{"type":28,"value":10486},{"type":23,"tag":2161,"props":28960,"children":28961},{"style":5844},[28962],{"type":28,"value":19554},{"type":23,"tag":2161,"props":28964,"children":28965},{"style":5830},[28966],{"type":28,"value":19660},{"type":23,"tag":2161,"props":28968,"children":28969},{"class":2163,"line":2253},[28970,28974,28978,28982,28986],{"type":23,"tag":2161,"props":28971,"children":28972},{"style":5830},[28973],{"type":28,"value":19765},{"type":23,"tag":2161,"props":28975,"children":28976},{"style":5948},[28977],{"type":28,"value":19770},{"type":23,"tag":2161,"props":28979,"children":28980},{"style":5948},[28981],{"type":28,"value":19775},{"type":23,"tag":2161,"props":28983,"children":28984},{"style":5948},[28985],{"type":28,"value":19780},{"type":23,"tag":2161,"props":28987,"children":28988},{"style":5830},[28989],{"type":28,"value":19785},{"type":23,"tag":2161,"props":28991,"children":28992},{"class":2163,"line":6337},[28993,28997],{"type":23,"tag":2161,"props":28994,"children":28995},{"style":5948},[28996],{"type":28,"value":19793},{"type":23,"tag":2161,"props":28998,"children":28999},{"style":5830},[29000],{"type":28,"value":19798},{"type":23,"tag":2161,"props":29002,"children":29003},{"class":2163,"line":6365},[29004,29008,29012,29016,29020,29024,29028],{"type":23,"tag":2161,"props":29005,"children":29006},{"style":5830},[29007],{"type":28,"value":19807},{"type":23,"tag":2161,"props":29009,"children":29010},{"style":5948},[29011],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29013,"children":29014},{"style":5830},[29015],{"type":28,"value":19816},{"type":23,"tag":2161,"props":29017,"children":29018},{"style":5948},[29019],{"type":28,"value":19578},{"type":23,"tag":2161,"props":29021,"children":29022},{"style":5830},[29023],{"type":28,"value":19825},{"type":23,"tag":2161,"props":29025,"children":29026},{"style":5948},[29027],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29029,"children":29030},{"style":5830},[29031],{"type":28,"value":19834},{"type":23,"tag":890,"props":29033,"children":29034},{"start":924},[29035],{"type":23,"tag":403,"props":29036,"children":29037},{},[29038,29039,29044,29045],{"type":28,"value":24249},{"type":23,"tag":99,"props":29040,"children":29042},{"className":29041},[],[29043],{"type":28,"value":24255},{"type":28,"value":24257},{"type":23,"tag":99,"props":29046,"children":29048},{"className":29047},[],[29049],{"type":28,"value":29050},"source-incrementing-timestamp-mysql.properties",{"type":23,"tag":2152,"props":29052,"children":29054},{"className":20588,"code":29053,"language":20590,"meta":8,"style":8},"name=mysql-a-source-omneo_incrementing\nconnector.class=io.confluent.connect.jdbc.JdbcSourceConnector\ntasks.max=1\nconnection.url=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Ftest_kafka_connector?user=root&password=1qaz@WSX\n# incrementing  自增\nmode=timestamp+incrementing\n# 时间戳字段\ntimestamp.column.name=commenttime\n# 自增字段  pid\nincrementing.column.name=pid\n# 白名单表  person\ntable.whitelist=omneo_incrementing_timestamp\n# topic前缀   mysql-kafka-\ntopic.prefix=mysql-kafka-\n",[29055],{"type":23,"tag":99,"props":29056,"children":29057},{"__ignoreMap":8},[29058,29074,29085,29096,29119,29126,29142,29150,29161,29168,29179,29186,29198,29205],{"type":23,"tag":2161,"props":29059,"children":29060},{"class":2163,"line":2164},[29061,29065,29069],{"type":23,"tag":2161,"props":29062,"children":29063},{"style":5830},[29064],{"type":28,"value":15227},{"type":23,"tag":2161,"props":29066,"children":29067},{"style":5948},[29068],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29070,"children":29071},{"style":5855},[29072],{"type":28,"value":29073},"mysql-a-source-omneo_incrementing\n",{"type":23,"tag":2161,"props":29075,"children":29076},{"class":2163,"line":927},[29077,29081],{"type":23,"tag":2161,"props":29078,"children":29079},{"style":5824},[29080],{"type":28,"value":24296},{"type":23,"tag":2161,"props":29082,"children":29083},{"style":5855},[29084],{"type":28,"value":24301},{"type":23,"tag":2161,"props":29086,"children":29087},{"class":2163,"line":924},[29088,29092],{"type":23,"tag":2161,"props":29089,"children":29090},{"style":5824},[29091],{"type":28,"value":24309},{"type":23,"tag":2161,"props":29093,"children":29094},{"style":5855},[29095],{"type":28,"value":24314},{"type":23,"tag":2161,"props":29097,"children":29098},{"class":2163,"line":2190},[29099,29103,29107,29111,29115],{"type":23,"tag":2161,"props":29100,"children":29101},{"style":5824},[29102],{"type":28,"value":24322},{"type":23,"tag":2161,"props":29104,"children":29105},{"style":5855},[29106],{"type":28,"value":24327},{"type":23,"tag":2161,"props":29108,"children":29109},{"style":5830},[29110],{"type":28,"value":24332},{"type":23,"tag":2161,"props":29112,"children":29113},{"style":5948},[29114],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29116,"children":29117},{"style":5855},[29118],{"type":28,"value":24341},{"type":23,"tag":2161,"props":29120,"children":29121},{"class":2163,"line":2199},[29122],{"type":23,"tag":2161,"props":29123,"children":29124},{"style":5807},[29125],{"type":28,"value":24349},{"type":23,"tag":2161,"props":29127,"children":29128},{"class":2163,"line":2208},[29129,29133,29137],{"type":23,"tag":2161,"props":29130,"children":29131},{"style":5830},[29132],{"type":28,"value":24357},{"type":23,"tag":2161,"props":29134,"children":29135},{"style":5948},[29136],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29138,"children":29139},{"style":5855},[29140],{"type":28,"value":29141},"timestamp+incrementing\n",{"type":23,"tag":2161,"props":29143,"children":29144},{"class":2163,"line":2217},[29145],{"type":23,"tag":2161,"props":29146,"children":29147},{"style":5807},[29148],{"type":28,"value":29149},"# 时间戳字段\n",{"type":23,"tag":2161,"props":29151,"children":29152},{"class":2163,"line":2226},[29153,29157],{"type":23,"tag":2161,"props":29154,"children":29155},{"style":5824},[29156],{"type":28,"value":27278},{"type":23,"tag":2161,"props":29158,"children":29159},{"style":5855},[29160],{"type":28,"value":27283},{"type":23,"tag":2161,"props":29162,"children":29163},{"class":2163,"line":2235},[29164],{"type":23,"tag":2161,"props":29165,"children":29166},{"style":5807},[29167],{"type":28,"value":24374},{"type":23,"tag":2161,"props":29169,"children":29170},{"class":2163,"line":2244},[29171,29175],{"type":23,"tag":2161,"props":29172,"children":29173},{"style":5824},[29174],{"type":28,"value":24382},{"type":23,"tag":2161,"props":29176,"children":29177},{"style":5855},[29178],{"type":28,"value":24387},{"type":23,"tag":2161,"props":29180,"children":29181},{"class":2163,"line":2253},[29182],{"type":23,"tag":2161,"props":29183,"children":29184},{"style":5807},[29185],{"type":28,"value":24395},{"type":23,"tag":2161,"props":29187,"children":29188},{"class":2163,"line":6337},[29189,29193],{"type":23,"tag":2161,"props":29190,"children":29191},{"style":5824},[29192],{"type":28,"value":24403},{"type":23,"tag":2161,"props":29194,"children":29195},{"style":5855},[29196],{"type":28,"value":29197},"=omneo_incrementing_timestamp\n",{"type":23,"tag":2161,"props":29199,"children":29200},{"class":2163,"line":6365},[29201],{"type":23,"tag":2161,"props":29202,"children":29203},{"style":5807},[29204],{"type":28,"value":24416},{"type":23,"tag":2161,"props":29206,"children":29207},{"class":2163,"line":6405},[29208,29212],{"type":23,"tag":2161,"props":29209,"children":29210},{"style":5824},[29211],{"type":28,"value":24424},{"type":23,"tag":2161,"props":29213,"children":29214},{"style":5855},[29215],{"type":28,"value":24429},{"type":23,"tag":890,"props":29217,"children":29218},{"start":2190},[29219],{"type":23,"tag":403,"props":29220,"children":29221},{},[29222,29223],{"type":28,"value":24437},{"type":23,"tag":99,"props":29224,"children":29226},{"className":29225},[],[29227],{"type":28,"value":29228},"sink-incrementing-timestamp-mysql.properties",{"type":23,"tag":2152,"props":29230,"children":29232},{"className":20588,"code":29231,"language":20590,"meta":8,"style":8},"name=mysql-a-sink-omneo\nconnector.class=io.confluent.connect.jdbc.JdbcSinkConnector\ntasks.max=1\n#kafka的topic名称\ntopics=mysql-kafka-omneo_incrementing_timestamp\n# 配置JDBC链接\nconnection.url=jdbc:mysql:\u002F\u002F172.21.23.238:3306\u002Fkafka_connector?user=root&password=1qaz@WSX\n# 不自动创建表，如果为true，会自动创建表，表名为topic名称\nauto.create=false\n# upsert model更新和插入\ninsert.mode=upsert\n# 下面两个参数配置了以pid为主键更新\npk.mode = record_value\npk.fields = pid\n#表名为kafka_omneo_incrementing_timestamp\ntable.name.format=kafka_omneo_incrementing_timestamp\n",[29233],{"type":23,"tag":99,"props":29234,"children":29235},{"__ignoreMap":8},[29236,29251,29262,29273,29280,29296,29303,29326,29333,29348,29355,29366,29373,29388,29403,29411],{"type":23,"tag":2161,"props":29237,"children":29238},{"class":2163,"line":2164},[29239,29243,29247],{"type":23,"tag":2161,"props":29240,"children":29241},{"style":5830},[29242],{"type":28,"value":15227},{"type":23,"tag":2161,"props":29244,"children":29245},{"style":5948},[29246],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29248,"children":29249},{"style":5855},[29250],{"type":28,"value":24467},{"type":23,"tag":2161,"props":29252,"children":29253},{"class":2163,"line":927},[29254,29258],{"type":23,"tag":2161,"props":29255,"children":29256},{"style":5824},[29257],{"type":28,"value":24296},{"type":23,"tag":2161,"props":29259,"children":29260},{"style":5855},[29261],{"type":28,"value":24479},{"type":23,"tag":2161,"props":29263,"children":29264},{"class":2163,"line":924},[29265,29269],{"type":23,"tag":2161,"props":29266,"children":29267},{"style":5824},[29268],{"type":28,"value":24309},{"type":23,"tag":2161,"props":29270,"children":29271},{"style":5855},[29272],{"type":28,"value":24314},{"type":23,"tag":2161,"props":29274,"children":29275},{"class":2163,"line":2190},[29276],{"type":23,"tag":2161,"props":29277,"children":29278},{"style":5807},[29279],{"type":28,"value":24498},{"type":23,"tag":2161,"props":29281,"children":29282},{"class":2163,"line":2199},[29283,29287,29291],{"type":23,"tag":2161,"props":29284,"children":29285},{"style":5830},[29286],{"type":28,"value":24506},{"type":23,"tag":2161,"props":29288,"children":29289},{"style":5948},[29290],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29292,"children":29293},{"style":5855},[29294],{"type":28,"value":29295},"mysql-kafka-omneo_incrementing_timestamp\n",{"type":23,"tag":2161,"props":29297,"children":29298},{"class":2163,"line":2208},[29299],{"type":23,"tag":2161,"props":29300,"children":29301},{"style":5807},[29302],{"type":28,"value":24523},{"type":23,"tag":2161,"props":29304,"children":29305},{"class":2163,"line":2217},[29306,29310,29314,29318,29322],{"type":23,"tag":2161,"props":29307,"children":29308},{"style":5824},[29309],{"type":28,"value":24322},{"type":23,"tag":2161,"props":29311,"children":29312},{"style":5855},[29313],{"type":28,"value":24535},{"type":23,"tag":2161,"props":29315,"children":29316},{"style":5830},[29317],{"type":28,"value":24332},{"type":23,"tag":2161,"props":29319,"children":29320},{"style":5948},[29321],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29323,"children":29324},{"style":5855},[29325],{"type":28,"value":24341},{"type":23,"tag":2161,"props":29327,"children":29328},{"class":2163,"line":2226},[29329],{"type":23,"tag":2161,"props":29330,"children":29331},{"style":5807},[29332],{"type":28,"value":24555},{"type":23,"tag":2161,"props":29334,"children":29335},{"class":2163,"line":2235},[29336,29340,29344],{"type":23,"tag":2161,"props":29337,"children":29338},{"style":5824},[29339],{"type":28,"value":24563},{"type":23,"tag":2161,"props":29341,"children":29342},{"style":5855},[29343],{"type":28,"value":6258},{"type":23,"tag":2161,"props":29345,"children":29346},{"style":5844},[29347],{"type":28,"value":24572},{"type":23,"tag":2161,"props":29349,"children":29350},{"class":2163,"line":2244},[29351],{"type":23,"tag":2161,"props":29352,"children":29353},{"style":5807},[29354],{"type":28,"value":24580},{"type":23,"tag":2161,"props":29356,"children":29357},{"class":2163,"line":2253},[29358,29362],{"type":23,"tag":2161,"props":29359,"children":29360},{"style":5824},[29361],{"type":28,"value":24588},{"type":23,"tag":2161,"props":29363,"children":29364},{"style":5855},[29365],{"type":28,"value":24593},{"type":23,"tag":2161,"props":29367,"children":29368},{"class":2163,"line":6337},[29369],{"type":23,"tag":2161,"props":29370,"children":29371},{"style":5807},[29372],{"type":28,"value":24601},{"type":23,"tag":2161,"props":29374,"children":29375},{"class":2163,"line":6365},[29376,29380,29384],{"type":23,"tag":2161,"props":29377,"children":29378},{"style":5824},[29379],{"type":28,"value":24609},{"type":23,"tag":2161,"props":29381,"children":29382},{"style":5855},[29383],{"type":28,"value":24614},{"type":23,"tag":2161,"props":29385,"children":29386},{"style":5855},[29387],{"type":28,"value":24619},{"type":23,"tag":2161,"props":29389,"children":29390},{"class":2163,"line":6405},[29391,29395,29399],{"type":23,"tag":2161,"props":29392,"children":29393},{"style":5824},[29394],{"type":28,"value":24627},{"type":23,"tag":2161,"props":29396,"children":29397},{"style":5855},[29398],{"type":28,"value":24614},{"type":23,"tag":2161,"props":29400,"children":29401},{"style":5855},[29402],{"type":28,"value":24636},{"type":23,"tag":2161,"props":29404,"children":29405},{"class":2163,"line":19801},[29406],{"type":23,"tag":2161,"props":29407,"children":29408},{"style":5807},[29409],{"type":28,"value":29410},"#表名为kafka_omneo_incrementing_timestamp\n",{"type":23,"tag":2161,"props":29412,"children":29413},{"class":2163,"line":19837},[29414,29418],{"type":23,"tag":2161,"props":29415,"children":29416},{"style":5824},[29417],{"type":28,"value":24652},{"type":23,"tag":2161,"props":29419,"children":29420},{"style":5855},[29421],{"type":28,"value":29422},"=kafka_omneo_incrementing_timestamp\n",{"type":23,"tag":890,"props":29424,"children":29425},{"start":2199},[29426],{"type":23,"tag":403,"props":29427,"children":29428},{},[29429,29430,29434,29435,29441],{"type":28,"value":24665},{"type":23,"tag":86,"props":29431,"children":29432},{},[29433],{"type":28,"value":24670},{"type":28,"value":24672},{"type":23,"tag":99,"props":29436,"children":29438},{"className":29437},[],[29439],{"type":28,"value":29440},"mysql-kafka-omneo-incrementing-timestamp",{"type":28,"value":24680},{"type":23,"tag":2152,"props":29443,"children":29445},{"className":20588,"code":29444,"language":20590,"meta":8,"style":8},"kafka-topics.sh --create --zookeeper master:2181 --replication-factor 1 --partitions 1 --topic mysql-kafka-omneo_incrementing_timestamp\n",[29446],{"type":23,"tag":99,"props":29447,"children":29448},{"__ignoreMap":8},[29449],{"type":23,"tag":2161,"props":29450,"children":29451},{"class":2163,"line":2164},[29452,29456,29460,29464,29468,29472,29476,29480,29484,29488],{"type":23,"tag":2161,"props":29453,"children":29454},{"style":5824},[29455],{"type":28,"value":24695},{"type":23,"tag":2161,"props":29457,"children":29458},{"style":5844},[29459],{"type":28,"value":24700},{"type":23,"tag":2161,"props":29461,"children":29462},{"style":5844},[29463],{"type":28,"value":24705},{"type":23,"tag":2161,"props":29465,"children":29466},{"style":5855},[29467],{"type":28,"value":24710},{"type":23,"tag":2161,"props":29469,"children":29470},{"style":5844},[29471],{"type":28,"value":24715},{"type":23,"tag":2161,"props":29473,"children":29474},{"style":5844},[29475],{"type":28,"value":6175},{"type":23,"tag":2161,"props":29477,"children":29478},{"style":5844},[29479],{"type":28,"value":24724},{"type":23,"tag":2161,"props":29481,"children":29482},{"style":5844},[29483],{"type":28,"value":6175},{"type":23,"tag":2161,"props":29485,"children":29486},{"style":5844},[29487],{"type":28,"value":24733},{"type":23,"tag":2161,"props":29489,"children":29490},{"style":5855},[29491],{"type":28,"value":29492}," mysql-kafka-omneo_incrementing_timestamp\n",{"type":23,"tag":890,"props":29494,"children":29495},{"start":2208},[29496],{"type":23,"tag":403,"props":29497,"children":29498},{},[29499,29500,29505],{"type":28,"value":24746},{"type":23,"tag":99,"props":29501,"children":29503},{"className":29502},[],[29504],{"type":28,"value":24752},{"type":28,"value":24680},{"type":23,"tag":2152,"props":29507,"children":29509},{"className":20588,"code":29508,"language":20590,"meta":8,"style":8},"connect-standalone.sh $KAFKA_HOME\u002Fconfig\u002Fconnect-standalone.properties $KAFKA_HOME\u002Fconfig\u002Fsource-incrementing-timestamp-mysql.properties $KAFKA_HOME\u002Fconfig\u002Fsink-incrementing-timestamp-mysql.properties\n",[29510],{"type":23,"tag":99,"props":29511,"children":29512},{"__ignoreMap":8},[29513],{"type":23,"tag":2161,"props":29514,"children":29515},{"class":2163,"line":2164},[29516,29520,29524,29528,29532,29537,29541],{"type":23,"tag":2161,"props":29517,"children":29518},{"style":5824},[29519],{"type":28,"value":24768},{"type":23,"tag":2161,"props":29521,"children":29522},{"style":5830},[29523],{"type":28,"value":24773},{"type":23,"tag":2161,"props":29525,"children":29526},{"style":5855},[29527],{"type":28,"value":24778},{"type":23,"tag":2161,"props":29529,"children":29530},{"style":5830},[29531],{"type":28,"value":24773},{"type":23,"tag":2161,"props":29533,"children":29534},{"style":5855},[29535],{"type":28,"value":29536},"\u002Fconfig\u002Fsource-incrementing-timestamp-mysql.properties",{"type":23,"tag":2161,"props":29538,"children":29539},{"style":5830},[29540],{"type":28,"value":24773},{"type":23,"tag":2161,"props":29542,"children":29543},{"style":5855},[29544],{"type":28,"value":29545},"\u002Fconfig\u002Fsink-incrementing-timestamp-mysql.properties\n",{"type":23,"tag":890,"props":29547,"children":29548},{"start":2217},[29549],{"type":23,"tag":403,"props":29550,"children":29551},{},[29552,29553,29559],{"type":28,"value":24816},{"type":23,"tag":99,"props":29554,"children":29556},{"className":29555},[],[29557],{"type":28,"value":29558},"test_kafka_connector.omneo_incrementing_timestamp",{"type":28,"value":27665},{"type":23,"tag":2152,"props":29561,"children":29563},{"className":19390,"code":29562,"language":19392,"meta":8,"style":8},"insert into omneo_incrementing_timestamp values(1,\"0049683542a7-5bdb-d564-3133-276ae3ce\",\"Maurice\",\"Samuel\",\"01\u002F11\u002F1977\",\"H2M2V5\",\"Ballancourt\",\"male\",\"en couple\",\"2020-05-09 11:01:54\");\ninsert into omneo_incrementing_timestamp values(2,\"8338623542a7-5bdb-d564-3133-276ae3ce\",\"Gauthier\",\"Garbuet\",\"23\u002F05\u002F1965\",\"05274\",\"Cocagne\",\"female\",\"maried\",\"2020-05-09 11:01:54\");\ninsert into omneo_incrementing_timestamp values(3,\"3374573542a7-5bdb-d564-3133-276ae3ce\",\"Maurice\",\"Samuel\",\"01\u002F11\u002F1977\",\"H0H0H0\",\"Ottawa\",\"male\",\"en couple\",\"2020-05-09 11:01:54\");\ninsert into omneo_incrementing_timestamp values(4,\"5494133542a7-5bdb-d564-3133-276ae3ce\",\"Nicole\",\"Garbuet\",\"01\u002F11\u002F1977\",\"H0H0H0\",\"Maugio\",\"unknown\",\"single\",\"2020-05-09 11:01:54\");\n",[29564],{"type":23,"tag":99,"props":29565,"children":29566},{"__ignoreMap":8},[29567,29667,29766,29865],{"type":23,"tag":2161,"props":29568,"children":29569},{"class":2163,"line":2164},[29570,29574,29579,29583,29587,29591,29595,29599,29603,29607,29611,29615,29619,29623,29627,29631,29635,29639,29643,29647,29651,29655,29659,29663],{"type":23,"tag":2161,"props":29571,"children":29572},{"style":5948},[29573],{"type":28,"value":19869},{"type":23,"tag":2161,"props":29575,"children":29576},{"style":5830},[29577],{"type":28,"value":29578}," omneo_incrementing_timestamp ",{"type":23,"tag":2161,"props":29580,"children":29581},{"style":5948},[29582],{"type":28,"value":19879},{"type":23,"tag":2161,"props":29584,"children":29585},{"style":5830},[29586],{"type":28,"value":10486},{"type":23,"tag":2161,"props":29588,"children":29589},{"style":5844},[29590],{"type":28,"value":3641},{"type":23,"tag":2161,"props":29592,"children":29593},{"style":5830},[29594],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29596,"children":29597},{"style":5855},[29598],{"type":28,"value":19897},{"type":23,"tag":2161,"props":29600,"children":29601},{"style":5830},[29602],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29604,"children":29605},{"style":5855},[29606],{"type":28,"value":19906},{"type":23,"tag":2161,"props":29608,"children":29609},{"style":5830},[29610],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29612,"children":29613},{"style":5855},[29614],{"type":28,"value":19915},{"type":23,"tag":2161,"props":29616,"children":29617},{"style":5830},[29618],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29620,"children":29621},{"style":5855},[29622],{"type":28,"value":19924},{"type":23,"tag":2161,"props":29624,"children":29625},{"style":5830},[29626],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29628,"children":29629},{"style":5855},[29630],{"type":28,"value":19933},{"type":23,"tag":2161,"props":29632,"children":29633},{"style":5830},[29634],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29636,"children":29637},{"style":5855},[29638],{"type":28,"value":19942},{"type":23,"tag":2161,"props":29640,"children":29641},{"style":5830},[29642],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29644,"children":29645},{"style":5855},[29646],{"type":28,"value":19951},{"type":23,"tag":2161,"props":29648,"children":29649},{"style":5830},[29650],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29652,"children":29653},{"style":5855},[29654],{"type":28,"value":19960},{"type":23,"tag":2161,"props":29656,"children":29657},{"style":5830},[29658],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29660,"children":29661},{"style":5855},[29662],{"type":28,"value":19969},{"type":23,"tag":2161,"props":29664,"children":29665},{"style":5830},[29666],{"type":28,"value":10626},{"type":23,"tag":2161,"props":29668,"children":29669},{"class":2163,"line":927},[29670,29674,29678,29682,29686,29690,29694,29698,29702,29706,29710,29714,29718,29722,29726,29730,29734,29738,29742,29746,29750,29754,29758,29762],{"type":23,"tag":2161,"props":29671,"children":29672},{"style":5948},[29673],{"type":28,"value":19869},{"type":23,"tag":2161,"props":29675,"children":29676},{"style":5830},[29677],{"type":28,"value":29578},{"type":23,"tag":2161,"props":29679,"children":29680},{"style":5948},[29681],{"type":28,"value":19879},{"type":23,"tag":2161,"props":29683,"children":29684},{"style":5830},[29685],{"type":28,"value":10486},{"type":23,"tag":2161,"props":29687,"children":29688},{"style":5844},[29689],{"type":28,"value":3664},{"type":23,"tag":2161,"props":29691,"children":29692},{"style":5830},[29693],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29695,"children":29696},{"style":5855},[29697],{"type":28,"value":20006},{"type":23,"tag":2161,"props":29699,"children":29700},{"style":5830},[29701],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29703,"children":29704},{"style":5855},[29705],{"type":28,"value":20015},{"type":23,"tag":2161,"props":29707,"children":29708},{"style":5830},[29709],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29711,"children":29712},{"style":5855},[29713],{"type":28,"value":20024},{"type":23,"tag":2161,"props":29715,"children":29716},{"style":5830},[29717],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29719,"children":29720},{"style":5855},[29721],{"type":28,"value":20033},{"type":23,"tag":2161,"props":29723,"children":29724},{"style":5830},[29725],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29727,"children":29728},{"style":5855},[29729],{"type":28,"value":20042},{"type":23,"tag":2161,"props":29731,"children":29732},{"style":5830},[29733],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29735,"children":29736},{"style":5855},[29737],{"type":28,"value":20051},{"type":23,"tag":2161,"props":29739,"children":29740},{"style":5830},[29741],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29743,"children":29744},{"style":5855},[29745],{"type":28,"value":20060},{"type":23,"tag":2161,"props":29747,"children":29748},{"style":5830},[29749],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29751,"children":29752},{"style":5855},[29753],{"type":28,"value":20069},{"type":23,"tag":2161,"props":29755,"children":29756},{"style":5830},[29757],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29759,"children":29760},{"style":5855},[29761],{"type":28,"value":19969},{"type":23,"tag":2161,"props":29763,"children":29764},{"style":5830},[29765],{"type":28,"value":10626},{"type":23,"tag":2161,"props":29767,"children":29768},{"class":2163,"line":924},[29769,29773,29777,29781,29785,29789,29793,29797,29801,29805,29809,29813,29817,29821,29825,29829,29833,29837,29841,29845,29849,29853,29857,29861],{"type":23,"tag":2161,"props":29770,"children":29771},{"style":5948},[29772],{"type":28,"value":19869},{"type":23,"tag":2161,"props":29774,"children":29775},{"style":5830},[29776],{"type":28,"value":29578},{"type":23,"tag":2161,"props":29778,"children":29779},{"style":5948},[29780],{"type":28,"value":19879},{"type":23,"tag":2161,"props":29782,"children":29783},{"style":5830},[29784],{"type":28,"value":10486},{"type":23,"tag":2161,"props":29786,"children":29787},{"style":5844},[29788],{"type":28,"value":3687},{"type":23,"tag":2161,"props":29790,"children":29791},{"style":5830},[29792],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29794,"children":29795},{"style":5855},[29796],{"type":28,"value":20114},{"type":23,"tag":2161,"props":29798,"children":29799},{"style":5830},[29800],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29802,"children":29803},{"style":5855},[29804],{"type":28,"value":19906},{"type":23,"tag":2161,"props":29806,"children":29807},{"style":5830},[29808],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29810,"children":29811},{"style":5855},[29812],{"type":28,"value":19915},{"type":23,"tag":2161,"props":29814,"children":29815},{"style":5830},[29816],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29818,"children":29819},{"style":5855},[29820],{"type":28,"value":19924},{"type":23,"tag":2161,"props":29822,"children":29823},{"style":5830},[29824],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29826,"children":29827},{"style":5855},[29828],{"type":28,"value":20147},{"type":23,"tag":2161,"props":29830,"children":29831},{"style":5830},[29832],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29834,"children":29835},{"style":5855},[29836],{"type":28,"value":20156},{"type":23,"tag":2161,"props":29838,"children":29839},{"style":5830},[29840],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29842,"children":29843},{"style":5855},[29844],{"type":28,"value":19951},{"type":23,"tag":2161,"props":29846,"children":29847},{"style":5830},[29848],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29850,"children":29851},{"style":5855},[29852],{"type":28,"value":19960},{"type":23,"tag":2161,"props":29854,"children":29855},{"style":5830},[29856],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29858,"children":29859},{"style":5855},[29860],{"type":28,"value":19969},{"type":23,"tag":2161,"props":29862,"children":29863},{"style":5830},[29864],{"type":28,"value":10626},{"type":23,"tag":2161,"props":29866,"children":29867},{"class":2163,"line":2190},[29868,29872,29876,29880,29884,29888,29892,29896,29900,29904,29908,29912,29916,29920,29924,29928,29932,29936,29940,29944,29948,29952,29956,29960],{"type":23,"tag":2161,"props":29869,"children":29870},{"style":5948},[29871],{"type":28,"value":19869},{"type":23,"tag":2161,"props":29873,"children":29874},{"style":5830},[29875],{"type":28,"value":29578},{"type":23,"tag":2161,"props":29877,"children":29878},{"style":5948},[29879],{"type":28,"value":19879},{"type":23,"tag":2161,"props":29881,"children":29882},{"style":5830},[29883],{"type":28,"value":10486},{"type":23,"tag":2161,"props":29885,"children":29886},{"style":5844},[29887],{"type":28,"value":3710},{"type":23,"tag":2161,"props":29889,"children":29890},{"style":5830},[29891],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29893,"children":29894},{"style":5855},[29895],{"type":28,"value":20217},{"type":23,"tag":2161,"props":29897,"children":29898},{"style":5830},[29899],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29901,"children":29902},{"style":5855},[29903],{"type":28,"value":20226},{"type":23,"tag":2161,"props":29905,"children":29906},{"style":5830},[29907],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29909,"children":29910},{"style":5855},[29911],{"type":28,"value":20024},{"type":23,"tag":2161,"props":29913,"children":29914},{"style":5830},[29915],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29917,"children":29918},{"style":5855},[29919],{"type":28,"value":19924},{"type":23,"tag":2161,"props":29921,"children":29922},{"style":5830},[29923],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29925,"children":29926},{"style":5855},[29927],{"type":28,"value":20147},{"type":23,"tag":2161,"props":29929,"children":29930},{"style":5830},[29931],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29933,"children":29934},{"style":5855},[29935],{"type":28,"value":20259},{"type":23,"tag":2161,"props":29937,"children":29938},{"style":5830},[29939],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29941,"children":29942},{"style":5855},[29943],{"type":28,"value":20268},{"type":23,"tag":2161,"props":29945,"children":29946},{"style":5830},[29947],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29949,"children":29950},{"style":5855},[29951],{"type":28,"value":20277},{"type":23,"tag":2161,"props":29953,"children":29954},{"style":5830},[29955],{"type":28,"value":19892},{"type":23,"tag":2161,"props":29957,"children":29958},{"style":5855},[29959],{"type":28,"value":19969},{"type":23,"tag":2161,"props":29961,"children":29962},{"style":5830},[29963],{"type":28,"value":10626},{"type":23,"tag":890,"props":29965,"children":29966},{"start":2226},[29967],{"type":23,"tag":403,"props":29968,"children":29969},{},[29970,29971,29977],{"type":28,"value":25883},{"type":23,"tag":99,"props":29972,"children":29974},{"className":29973},[],[29975],{"type":28,"value":29976},"mysql-kafka-omneo_incrementing_timestamp",{"type":28,"value":28088},{"type":23,"tag":2152,"props":29979,"children":29981},{"className":20588,"code":29980,"language":20590,"meta":8,"style":8},"kafka-console-consumer.sh --bootstrap-server master:9092 --topic mysql-kafka-omneo_incrementing_timestamp --from-beginning\n",[29982],{"type":23,"tag":99,"props":29983,"children":29984},{"__ignoreMap":8},[29985],{"type":23,"tag":2161,"props":29986,"children":29987},{"class":2163,"line":2164},[29988,29992,29996,30000,30004,30009],{"type":23,"tag":2161,"props":29989,"children":29990},{"style":5824},[29991],{"type":28,"value":25797},{"type":23,"tag":2161,"props":29993,"children":29994},{"style":5844},[29995],{"type":28,"value":25802},{"type":23,"tag":2161,"props":29997,"children":29998},{"style":5855},[29999],{"type":28,"value":25807},{"type":23,"tag":2161,"props":30001,"children":30002},{"style":5844},[30003],{"type":28,"value":24733},{"type":23,"tag":2161,"props":30005,"children":30006},{"style":5855},[30007],{"type":28,"value":30008}," mysql-kafka-omneo_incrementing_timestamp",{"type":23,"tag":2161,"props":30010,"children":30011},{"style":5844},[30012],{"type":28,"value":25821},{"type":23,"tag":890,"props":30014,"children":30015},{"start":2235},[30016],{"type":23,"tag":403,"props":30017,"children":30018},{},[30019,30020,30025,30026,30031,30032,30037,30038],{"type":28,"value":28093},{"type":23,"tag":99,"props":30021,"children":30023},{"className":30022},[],[30024],{"type":28,"value":3664},{"type":28,"value":1148},{"type":23,"tag":99,"props":30027,"children":30029},{"className":30028},[],[30030],{"type":28,"value":3710},{"type":28,"value":9348},{"type":23,"tag":99,"props":30033,"children":30035},{"className":30034},[],[30036],{"type":28,"value":28111},{"type":28,"value":28113},{"type":23,"tag":99,"props":30039,"children":30041},{"className":30040},[],[30042],{"type":28,"value":28119},{"type":23,"tag":2152,"props":30044,"children":30046},{"className":19390,"code":30045,"language":19392,"meta":8,"style":8},"update omneo_incrementing_timestamp set firstname = \"world\" ,commenttime=\"2020-12-20 15:55:10\" where pid in(2,4);\n",[30047],{"type":23,"tag":99,"props":30048,"children":30049},{"__ignoreMap":8},[30050],{"type":23,"tag":2161,"props":30051,"children":30052},{"class":2163,"line":2164},[30053,30057,30061,30065,30069,30073,30077,30081,30085,30089,30093,30097,30101,30105,30109,30113,30117],{"type":23,"tag":2161,"props":30054,"children":30055},{"style":5948},[30056],{"type":28,"value":20315},{"type":23,"tag":2161,"props":30058,"children":30059},{"style":5830},[30060],{"type":28,"value":29578},{"type":23,"tag":2161,"props":30062,"children":30063},{"style":5948},[30064],{"type":28,"value":17812},{"type":23,"tag":2161,"props":30066,"children":30067},{"style":5830},[30068],{"type":28,"value":20328},{"type":23,"tag":2161,"props":30070,"children":30071},{"style":5948},[30072],{"type":28,"value":6258},{"type":23,"tag":2161,"props":30074,"children":30075},{"style":5855},[30076],{"type":28,"value":20337},{"type":23,"tag":2161,"props":30078,"children":30079},{"style":5830},[30080],{"type":28,"value":20342},{"type":23,"tag":2161,"props":30082,"children":30083},{"style":5948},[30084],{"type":28,"value":6258},{"type":23,"tag":2161,"props":30086,"children":30087},{"style":5855},[30088],{"type":28,"value":20351},{"type":23,"tag":2161,"props":30090,"children":30091},{"style":5948},[30092],{"type":28,"value":20356},{"type":23,"tag":2161,"props":30094,"children":30095},{"style":5830},[30096],{"type":28,"value":20361},{"type":23,"tag":2161,"props":30098,"children":30099},{"style":5948},[30100],{"type":28,"value":20366},{"type":23,"tag":2161,"props":30102,"children":30103},{"style":5830},[30104],{"type":28,"value":10486},{"type":23,"tag":2161,"props":30106,"children":30107},{"style":5844},[30108],{"type":28,"value":3664},{"type":23,"tag":2161,"props":30110,"children":30111},{"style":5830},[30112],{"type":28,"value":19892},{"type":23,"tag":2161,"props":30114,"children":30115},{"style":5844},[30116],{"type":28,"value":3710},{"type":23,"tag":2161,"props":30118,"children":30119},{"style":5830},[30120],{"type":28,"value":10626},{"type":23,"tag":890,"props":30122,"children":30123},{"start":2244},[30124],{"type":23,"tag":403,"props":30125,"children":30126},{},[30127,30128,30133],{"type":28,"value":25883},{"type":23,"tag":99,"props":30129,"children":30131},{"className":30130},[],[30132],{"type":28,"value":29976},{"type":28,"value":30134}," 主题，发现手动修改的两条数据并没有被消费到控制台。",{"type":23,"tag":50,"props":30136,"children":30138},{"id":30137},"timestamp-incrementing-混合模式结论",[30139],{"type":28,"value":30140},"timestamp + incrementing 混合模式结论",{"type":23,"tag":24,"props":30142,"children":30143},{},[30144],{"type":28,"value":30145},"由以上测试结果可知，这次的测试不知道是我的粗心导致哪些细节的地方没有注意到，还是 kafka connect 的 BUG，后续我还会继续去排查问题的原因，如果有小伙伴测试成功了，希望小伙伴在留言\u002F私信不吝赐教。",{"type":23,"tag":17976,"props":30147,"children":30148},{},[30149],{"type":23,"tag":24,"props":30150,"children":30151},{},[30152,30154,30160],{"type":28,"value":30153},"虽然本人测试失败了，但是还是推荐大家使用 canal 来完成 MySQL 数据近实时同步至 Kafka ，因为 kafka connect 是通过 select 的语句将 Mysql中的数据查询出来然后再写入 kafka ，这里会有一个瓶颈问题 ",{"type":23,"tag":99,"props":30155,"children":30157},{"className":30156},[],[30158],{"type":28,"value":30159},"当查询的数据量大于千万级别的时候，查询速度会特别的慢(没有建索引)，而 canal 则是通过监控 MySQL 的 binlog 日志来完成数据同步的，大数据量的场景下建议使用 canal",{"type":28,"value":16927},{"type":23,"tag":2730,"props":30162,"children":30163},{},[30164],{"type":28,"value":2734},{"title":8,"searchDepth":924,"depth":924,"links":30166},[30167,30168,30169,30170,30171,30172,30173,30174,30175,30176,30177],{"id":22522,"depth":927,"text":22522},{"id":23134,"depth":927,"text":23137},{"id":23171,"depth":927,"text":23171},{"id":23291,"depth":927,"text":23291},{"id":23404,"depth":927,"text":23407},{"id":21531,"depth":927,"text":21531},{"id":26259,"depth":927,"text":26262},{"id":26342,"depth":927,"text":26345},{"id":28215,"depth":927,"text":28218},{"id":28234,"depth":927,"text":28237},{"id":30137,"depth":927,"text":30140},"content:blog:2020-05-08-kafka-connect-mysql.md","blog\u002F2020-05-08-kafka-connect-mysql.md","blog\u002F2020-05-08-kafka-connect-mysql",1796523532744]