AgentStack
SKILL verified Apache-2.0 Self-run

Disaster Recovery

skill-chaterm-terminal-skills-disaster-recovery · by chaterm

灾难恢复

No reviews yet
0 installs
17 views
0.0% view→install

Install

$ agentstack add skill-chaterm-terminal-skills-disaster-recovery

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Disaster Recovery? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

灾难恢复

概述

灾难恢复计划、RTO/RPO、故障切换技能。

核心概念

RTO 与 RPO

RPO (Recovery Point Objective)
- 可接受的数据丢失量
- 决定备份频率

RTO (Recovery Time Objective)  
- 可接受的恢复时间
- 决定恢复策略

示例:
- RPO = 1小时 → 每小时备份
- RTO = 4小时 → 需要热备或快速恢复

恢复策略

冷备 (Cold)
- 最低成本
- 最长 RTO
- 适合非关键系统

温备 (Warm)
- 中等成本
- 中等 RTO
- 定期同步数据

热备 (Hot)
- 最高成本
- 最短 RTO
- 实时同步

数据库恢复

MySQL 恢复

# 从备份恢复
mysql -u root -p > $LOG

# 1. 切换到备用站点
echo "切换 DNS..." >> $LOG

# 2. 验证服务
echo "验证服务可用性..." >> $LOG
curl -s http://dr-site/health >> $LOG

# 3. 测试数据一致性
echo "验证数据一致性..." >> $LOG

# 4. 记录 RTO
echo "实际 RTO: $(计算时间)" >> $LOG

# 5. 切回主站点
echo "切回主站点..." >> $LOG

场景 3:自动故障转移

# Keepalived 配置
vrrp_script chk_app {
    script "/usr/local/bin/check_app.sh"
    interval 2
    weight -20
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    
    track_script {
        chk_app
    }
    
    virtual_ipaddress {
        192.168.1.100
    }
}

DR 检查清单

| 项目 | 检查内容 | |------|----------| | 备份 | 备份完整性、可恢复性 | | 文档 | 恢复步骤、联系人 | | 网络 | DNS、IP、防火墙 | | 数据 | 数据一致性、同步状态 | | 应用 | 配置、依赖、证书 |

故障排查

# 检查备份状态
ls -la /backup/
md5sum /backup/latest.tar.gz

# 检查复制状态
# MySQL
SHOW SLAVE STATUS\G

# PostgreSQL
SELECT * FROM pg_stat_replication;

# 检查网络连通性
ping dr-site
traceroute dr-site

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.