Skip to content

seaworld008/centos7-lighthouse / skills/centos7-almalinux-upgrade

centos7-almalinux-upgrade

Flagged

把老旧 CentOS 7 / CentOS 8(及 RHEL7/8 系)服务器原地升级到最新 AlmaLinux 10(经 ELevate/Leapp 7→8→9→10,CentOS 8 先用 almalinux-deploy 转换),并保证业务、容器、nginx、kubectl 等升级后照常工作。凡是用户提到 CentOS 7 / CentOS 停服 / EOL / 老系统升级 / 迁移到 AlmaLinux / Rocky / CentOS 继任者 / ELevate / leapp / 系统漏洞要升级系统、批量升级阿里云/华为云/AWS 上的 CentOS 服务器,都要使用本技能——即使用户没说"升级"而只说"系统太老了""换个新系统但业务不能停"。In-place upgrade CentOS 7 to AlmaLinux 10 safely, single server or whole fleet.

FileKindSize
SKILL.mdskill md14.7 KB
assets/fleet-tracker.csvother617 B
assets/report-template.mdmarkdown850 B
references/app-compat.mdmarkdown14.5 KB
references/cloud-providers.mdmarkdown5.7 KB
references/fleet.mdmarkdown2.6 KB
references/kubernetes.mdmarkdown7.6 KB
references/pitfalls.mdmarkdown51.0 KB
references/recovery.mdmarkdown8.3 KB
scripts/backup.shexecutablescript5.0 KB
scripts/convert-el8.shexecutablescript7.6 KB
scripts/finalize.shexecutablescript12.5 KB
scripts/fleet_summary.pyexecutablescript7.9 KB
scripts/hop.shexecutablescript32.6 KB
scripts/k8s.shscript16.2 KB
scripts/known-hosts-fill.shscript2.7 KB
scripts/mysql-backup.shscript9.2 KB
scripts/nginx-static-build.shexecutablescript5.1 KB
scripts/post-audit.shexecutablescript12.4 KB
scripts/prep-el7.shexecutablescript13.5 KB
scripts/remote.pyexecutablescript9.7 KB
scripts/rescue-grubenv.shscript3.2 KB
scripts/state.shexecutablescript5.2 KB
scripts/survey.shexecutablescript28.6 KB
scripts/swap-openssh.shexecutablescript3.6 KB
scripts/verify.shexecutablescript5.3 KB

references/fleet.md

View on GitHub
# 批量推进(几十到上百台)

## 1. 资产表
一个 xlsx/csv 管所有机器(remote.py 直接读):`name, host, port, username, password, cloud, region, owner, business, notes`。
另用 `assets/fleet-tracker.csv` 跟踪进度(每台一行:阶段、分类、阻断项、负责人确认、快照时间、各跳完成时间、结果)。

## 2. 并行勘察(只读,可以全部同时跑)
```bash
for h in $(python remote.py --list | cut -f2); do
  ( python remote.py $h put $S /root/os-upgrade-kit >/dev/null &&
    python remote.py $h run "bash /root/os-upgrade-kit/survey.sh" --timeout 600 > fleet/$h/survey.txt 2>&1 ) &
done; wait
grep -H "^\[BLOCKER\]\|^\[HIGH\]" fleet/*/survey.txt
python $S/fleet_summary.py fleet/ --groups groups.csv --batch 5 > fleet/summary.md   # 分类 + 金丝雀 + 批次建议
```
`groups.csv` 的列是 `host,group`,同一 group(例如同一业务的主备、同一集群)不会排进同一批。
每台建目录 `fleet/<host>/`:survey.txt、decisions.md(用户确认的去留决定)、log.md(每步做了什么)、report.md。

## 3. 分类(`fleet_summary.py` 按下表自动判断)
| 类 | 特征 | 策略 |
|---|---|---|
| A 简单 | 无 BLOCKER,只有系统服务/少量容器 | 批量升级,脚本流程基本不用改 |
| B 容器型 | Docker 容器为主 | 注意 restart 策略、compose v1、cgroup v1 镜像;或直接新建机器重部署 |
| C 定制型 | 自编译程序、宿主机数据库、PHP/Java 直接跑 | 逐台处理,先定每个组件方案 |
| D 不原地 | k8s 节点、关键大库、btrfs、CPU 不支持 v3 | 新建 AlmaLinux 10 机器迁移业务 |
| ⚠ 访问路径 | 本机运行 VPN/隧道/跳板 | 单独排期,最后做;控制台随时待命 |

## 4. 金丝雀 → 分批
1. 每类先挑 1 台非关键机器完整走一遍(含最终重启测试),把新遇到的坑补进 pitfalls.md。
2. 之后按业务分批:同一业务的主备/集群节点**不要同一批**;一批内同时重启的数量控制在能盯得过来的范围(控制台窗口数)。
3. 下载阶段(hop.sh prep/pre/up)可多台并行;重启阶段逐台或小批量进行。
4. 每台完成后 verify.sh 全绿 + 最终重启测试通过才标记完成。

## 5. 每台的固定节奏(可直接照做)
勘察 → 用户确认(快照/窗口/控制台/去留决定) → backup.sh → prep-el7.sh → [hop.sh prep/pre/answer/up/reboot/post + verify] ×3 → finalize → 最终重启 + verify → 报告。

## 6. 记录
- 新坑:现象 / 原因 / 处理写回 `references/pitfalls.md`,让下一台受益。
- 每台报告按 `assets/report-template.md`。
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall