一键导入
drs-mysql-parallel-migration
使用当前仓库的脚本执行华为云 DRS MySQL 并行迁移,覆盖环境校验、任务创建、预检查、启动同步、监控、切换前检查、切换后校验与回滚计划。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
使用当前仓库的脚本执行华为云 DRS MySQL 并行迁移,覆盖环境校验、任务创建、预检查、启动同步、监控、切换前检查、切换后校验与回滚计划。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Deploy, verify, upgrade, or roll back the anthropic_stream_guard LiteLLM plugin on a docker-compose LiteLLM gateway. Use when asked to install/uninstall the plugin, wire a LiteLLM deployment for native Claude Code clients, or verify the gateway stream fix.
Install, configure, verify, or troubleshoot a side-by-side `codex-forky` command that routes normal Codex tool/code-execution turns through an existing forky service to the MaaS execution backend such as LiteLLM/Huawei MaaS GLM, while routing non-tool ordinary turns and image turns directly to Codex ChatGPT/OAuth. Assumes forky is already installed and running, usually by claude-code-maas-hybrid-router.
Nightly (or on-demand) memory hygiene for AI coding agents — the thing native auto-memory does NOT do. Runs a "dream" pass over project memory to deduplicate entries, validate that every referenced file path still exists (so the agent never acts on "confidently wrong" stale references), compress survivors into a compact index, and detect when a new finding conflicts with an approved rule or CLAUDE.md — emitting a review-required conflict candidate and a proposed CLAUDE.md patch (never auto-applied). Use when memory has grown noisy/stale, on a nightly schedule, or whenever the user asks to dream/consolidate/clean up project memory, distill repeated workflows, or recall approved context.
Install and configure forky (github.com/vladharl/forky) end-to-end so `claude-forky` routes Claude Code planning, image, and classifier traffic through Claude OAuth while sending normal tool/code execution to Huawei Cloud MaaS (GLM-5.2) through an existing local LiteLLM proxy. Use when the user wants one Claude Code command with Claude-quality reasoning and vision plus lower-cost MaaS execution, while preserving plain `claude` for Claude.ai OAuth connectors. Sets up forky as a systemd user service, applies local compatibility patches (vision routing, Claude Code system/developer message-role normalization, and Anthropic cache-control TTL ordering), writes a `claude-forky` wrapper that uses ANTHROPIC_BASE_URL without ANTHROPIC_AUTH_TOKEN, adds copy-friendly mouse settings, trusts `/root` when requested so local permissions are honored, and merges plan-mode hooks into `~/.claude/settings.json`. Assumes LiteLLM is already running on :4000 and that the user has logged into Claude Code (`claude /login`) so OAuth c
Deploy, configure, validate, troubleshoot, or extend an OpenAI-compatible API proxy backed by PostgreSQL, Prometheus, and Grafana, routing through Huawei ModelArts MaaS (ap-southeast-1) with multi-key load balancing. TRIGGER when the task involves LiteLLM proxy deployment, Docker Compose stack with litellm_config.yaml, Huawei MaaS model routing, virtual key or budget management, Prometheus/Grafana observability for LLM traffic, custom_callbacks.py TTFT/TPOT/ITL metrics, multi-key load balancing, an optional self-hosted SearXNG search MCP (`web_search`/`fetch_url`) as an alternative to Exa, wiring a `claude-glm` (claude-code-router) client through the proxy, or any reference to `LITELLM_MASTER_KEY`, `HUAWEI_MAAS_API_KEY`, `MCP_TOKEN`, or `docker compose` with this stack.
Execute and troubleshoot Huawei Cloud server migration in this repository. Support both current batch existing-target SMS workflow (`terraform apply` + `scripts/mgc_sms_existing_target_batch.py`) and single-source SMS/rsync workflow (`scripts/mgc_migrate.py`). Use when users ask to migrate ECS/on-prem VMware, run migration in `ap-southeast-3`/`la-*`, resume after pause from `out/resume_checkpoint_latest.json`, monitor tasks in `out/task_poll_latest.json`, or diagnose SMS/MGC errors such as SMS.1404, SMS.0515, SMS.6504, SMS.6602, SMS.6603, SMS.6617, SMS.7605, SMS.7703, and SMS.8115. Also use for Chinese requests like “跨区域迁移”, “MGC/SMS 迁移流程”, “批量迁移恢复”, or “迁移排障”.
| name | drs-mysql-parallel-migration |
| description | 使用当前仓库的脚本执行华为云 DRS MySQL 并行迁移,覆盖环境校验、任务创建、预检查、启动同步、监控、切换前检查、切换后校验与回滚计划。 |
scripts/00-11 自动化脚本执行或续跑 MySQL DRS 迁移。approvals/APPROVED_CREATE_DRS_JOBapprovals/APPROVED_START_DRS_JOBapprovals/APPROVED_CUTOVERconfigs/migration.yaml.env(不提交)scripts/00_env_check.sh 到 scripts/11_post_cutover_validate.pyscripts/99_rollback_plan.pyapprovals/reports/logs/cd /root/ai_assit_migration/ai_assist_rds_migration/parallel_runs/db2
export MIGRATION_BASE_DIR=/root/ai_assit_migration/ai_assist_rds_migration/parallel_runs/db2
.env(仅在当前会话)。set -a
source .env
set +a
00_env_check.sh 会校验):HW_ACCESS_KEY HW_SECRET_KEY HW_PROJECT_ID HW_REGIONSRC_DB_HOST SRC_DB_PORT SRC_DB_USER SRC_DB_PASSWORDTGT_DB_HOST TGT_DB_PORT TGT_DB_USER TGT_DB_PASSWORDDRY_RUN=false 执行真实操作(默认 true)SKIP_DB_TCP_CHECK=true 跳过执行机到 DB 的直连探测ALLOW_DRS_ONLY_PRECHECK=true 允许在执行机无法直连 DB 时,仅依赖 DRS 连通性测试和 DRS 预检查作为硬门禁按顺序执行:
bash scripts/00_env_check.sh
python3 scripts/01_db_precheck.py
python3 scripts/02_generate_drs_payload.py
touch approvals/APPROVED_CREATE_DRS_JOB
python3 scripts/03_create_drs_job.py
python3 scripts/04_wait_drs_job_ready.py
python3 scripts/05_test_connection.py
python3 scripts/06_run_precheck.py
touch approvals/APPROVED_START_DRS_JOB
python3 scripts/07_start_migration.py
python3 scripts/08_monitor_migration.py
切换窗口前后补充:
python3 scripts/09_create_compare_task.py
touch approvals/APPROVED_CUTOVER
python3 scripts/10_cutover_check.py
python3 scripts/11_post_cutover_validate.py
python3 scripts/99_rollback_plan.py
00_env_check.sh -> reports/env_check_report.json
status=SUCCESS,且必填 env 变量均为 SET01_db_precheck.py -> reports/db_precheck.json
status in [SUCCESS, WARNING](若启用 DRS-only 模式)02_generate_drs_payload.py -> reports/drs_payload.json
status=SUCCESS 且包含 base_info/source_endpoint/target_endpoint/node_info03_create_drs_job.py -> reports/drs_job_create_report.json
status=SUCCESS 且有 details.job_id04_wait_drs_job_ready.py -> reports/drs_job_status_report.json
status=SUCCESS 且任务状态进入 CONFIGURATION 或 WAITING_FOR_START05_test_connection.py -> reports/connection_test_report.json
status=SUCCESS(源/目标连接测试均成功)06_run_precheck.py -> reports/precheck_report.json
status in [SUCCESS, WARNING],且无 FAIL 项07_start_migration.py -> reports/migration_start_report.json
status=SUCCESS08_monitor_migration.py -> reports/migration_status_report.json
details.final_status=INCR_TRANS09_create_compare_task.py -> reports/compare_report.json
status=SUCCESS,至少拿到可解析的 compare 结果10_cutover_check.py -> reports/cutover_check_report.json
cutover_ready=true11_post_cutover_validate.py -> reports/cutover_validation_report.json
status in [SUCCESS, WARNING](WARNING 需要业务确认)99_rollback_plan.py -> reports/rollback_plan.json + reports/risk_list.json
reports/migration_report.json 的最后阶段和 job_id。drs_job_create_report.json 且包含 job_id,跳过 02/03。migration_start_report.json 已成功,跳过 07。migration_status_report.json 已是 INCR_TRANS,跳过 08,直接进入 09/10/11。reports/*.json 的 errors,再看 logs/<step>_*.log 最新文件。job_id=23839644-0b92-404d-9655-e2ece0ejb101。WARNING(存在磁盘容量告警)。INCR_TRANS,增量延迟为 0 秒。compare_report 为 WARNING(未返回 compare task id),cutover_check_report 为 FAILED(compare 结果缺失且未提供 APPROVED_CUTOVER)。HostUnreachableException / Name or service not known
db_precheck 无法直连数据库
ALLOW_DRS_ONLY_PRECHECK=true,并以 05/06 结果作为硬门禁。wait_drs_job_ready 超时
drs_job_create_report.json 的 job_id 仍有效,再单独重跑 04。compare_report 无任务 ID