Files
windyboy 25cc967bd2 feat(acm2-76): 联调栈数据库自动初始化——基础数据/字典/信箱报文/历史索引
- postgres-init:02 建 basicdata schema 与 25 张基础数据表(表列对齐
  admin-api secondary 实体注解),03 灌双流 T2 种子(fims_* 待 Q25 不造数);
  独立 schema 避免 public 非空导致 Flyway 首次 migrate 失败
- admin-mysql-init:原样引入 admin-api 仓库 adminapi_* 建表与字典/UI 种子,
  v0.0.2 补 FLIGHT_TASK/FLIGHT_TYPE 条目;compose 强制 utf8mb4 并设 LANG,
  防 initdb 客户端落 latin1 造成中文双重编码
- es-init 一次性服务:按 admin-api mapping 建 flight_hts2(别名 flight_hts),
  副本置 0 保持单节点 green
- dev/mysql-init:CMINMSGS 5 条样例报文(SCHD/FLOP×2/REGN/ARPT),
  REGN/ARPT 标注现状预期(SKIPPED / DEAD(EXHAUSTED))
- seed-flight.sql:Flyway 建表后手动执行,8 条航班 6 场景 + 资源明细
- admin-api.yml secondary 加 currentSchema=basicdata,public
- README:初始化/种子/重建卷/验收边界说明

已用 podman compose 重建数据卷全链实测;ACM2-76 有评审与验收全记录。
2026-09-19 11:09:58 +08:00

24 lines
1.3 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# =====================================================================
# deploy/integration/es-init/init-flight-hts.shACM2-76
# 一次性初始化 ES 历史索引 flight_hts:建 flight_hts2、挂别名、套 mapping。
# 幂等:索引已存在即整体跳过;可随 `compose up` 重复执行。
# 映射文件 v1.2.0_20190428_flightHstMapping.json 原样取自 admin-api 仓库
# src/main/resources/es/CRLF、自带 PUT 命令行),此处只提取 JSON 体。
# =====================================================================
set -e
ES="http://elasticsearch:9200"
if curl -fsS -o /dev/null "$ES/_cat/indices/flight_hts2"; then
echo "flight_hts2 已存在,跳过初始化"
exit 0
fi
curl -fsS -X PUT "$ES/flight_hts2"; echo
curl -fsS -X PUT "$ES/flight_hts2/_alias/flight_hts"; echo
tr -d '\r' < /init/v1.2.0_20190428_flightHstMapping.json | sed -n '/^{/,$p' > /tmp/flight_hts_mapping.json
curl -fsS -X PUT -H 'Content-Type: application/json' --data-binary @/tmp/flight_hts_mapping.json "$ES/flight_hts2/_doc/_mapping"; echo
# 单节点联调栈:副本置 0,避免未分配副本分片让集群一直 yellow。
curl -fsS -X PUT -H 'Content-Type: application/json' "$ES/flight_hts2/_settings" -d '{"index":{"number_of_replicas":0}}'; echo
echo "flight_hts 初始化完成"