disaster-recovery – skill Khác cho agent AI
Triển khai chiến lược và runbook khôi phục sau thảm họa. Cấu hình mục tiêu RPO/RTO và quy trình failover. Dùng khi lên kế hoạch đảm bảo hoạt động liên tục của doanh nghiệp.
Cài skill disaster-recovery bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/disaster-recovery-4ff16.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /disaster-recovery – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/disaster-recovery-4ff16.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $disaster-recovery – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/disaster-recovery-4ff16.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /disaster-recovery – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/disaster-recovery-4ff16.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /disaster-recovery – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Disaster Recovery
Implement disaster recovery strategies including RTO/RPO planning, AWS cross-region failover patterns, DR testing procedures, and automated failover scripts.
RTO/RPO Planning
recovery_metrics:
RTO:
definition: "Recovery Time Objective - maximum acceptable downtime"
measurement: "From the agreed service disruption point to verified recovery; record detection/declaration separately"
factors:
- Failover automation maturity
- Data replication lag
- DNS propagation time
- Application warm-up time
- Verification procedures
RPO:
definition: "Recovery Point Objective - maximum acceptable data loss"
measurement: "Gap between latest recoverable consistent data and disruption; backups/replication may be stale or corrupted"
factors:
- Backup frequency
- Replication method (sync vs. async)
- Transaction log shipping interval
- Cross-region replication lag
service_tier_targets:
tier_1_critical:
examples: "Authentication, payment processing, core API"
rto: "< 15 minutes"
rpo: "< 1 minute (near-zero)"
strategy: "Multi-site active-active or warm standby"
replication: "Synchronous or near-synchronous"
testing: "Quarterly failover test"
tier_2_essential:
examples: "Customer dashboards, reporting, notifications"
rto: "< 1 hour"
rpo: "< 15 minutes"
strategy: "Warm standby or pilot light"
replication: "Asynchronous with short interval"
testing: "Semi-annual failover test"
tier_3_standard:
examples: "Internal tools, analytics, batch processing"
rto: "< 4 hours"
rpo: "< 1 hour"
strategy: "Pilot light or backup and restore"
replication: "Periodic snapshots"
testing: "Annual failover test"
tier_4_non_essential:
examples: "Development environments, documentation sites"
rto: "< 24 hours"
rpo: "< 24 hours"
strategy: "Backup and restore"
replication: "Daily backups"
testing: "Annual backup restore verification"DR Strategies Comparison
strategies:
backup_and_restore:
rto: "Hours"
rpo: "Hours (depends on backup frequency)"
cost: "$"
description: "Regular backups stored in DR region. Restore from backup when needed."
aws_services:
- "S3 cross-region replication for backups"
- "RDS automated snapshots copied to DR region"
- "AMI copies in DR region"
- "Terraform/CloudFormation for infrastructure rebuild"
pros: "Lowest cost, simplest to maintain"
cons: "Longest recovery time, highest data loss potential"
pilot_light:
rto: "Minutes to hours"
rpo: "Minutes"
cost: "$$"
description: "Core infrastructure running in DR region (databases replicated). Scale up compute on failover."
aws_services:
- "RDS cross-region read replica (always running)"
- "S3 cross-region replication"
- "AMIs pre-built in DR region"
- "Auto Scaling groups at zero/minimal capacity"
pros: "Fast database recovery, moderate cost"
cons: "Compute scale-up adds to recovery time"
warm_standby:
rto: "Minutes"
rpo: "Seconds to minutes"
cost: "$$$"
description: "Scaled-down but functional environment in DR region. Scale up on failover."
aws_services:
- "RDS cross-region read replica"
- "ECS/EKS running at reduced capacity"
- "Route53 health checks for automated DNS failover"
- "Global Accelerator for traffic management"
pros: "Fast failover, reduced risk"
cons: "Higher baseline cost for idle resources"
multi_site_active:
rto: "Near-zero"
rpo: "Near-zero"
cost: "$$$$"
description: "Active-active across regions. Traffic served from both regions simultaneously."
aws_services:
- "DynamoDB Global Tables where appropriate; Aurora Global Database normally has one writer region, not multi-region active-active writes"
- "Route53 latency/weighted routing"
- "CloudFront with multi-origin"
- "Global Accelerator"
- "ECS/EKS in both regions"
pros: "Minimal downtime and data loss"
cons: "Highest cost, most complex to operate"AWS Cross-Region DR Implementation
Fragments below provision or replace paid production configuration: confirm exact
account, engine/version support, target region, KMS/IAM grants, backups and approved
change window first. The listed tier timings/frequencies are planning examples,
not platform guarantees or universal compliance rules. Aurora secondary-cluster
creation also needs supported regional engine/version, subnet/security settings
and instances; a cluster object alone is not a working DR application.
S3 requires versioning on both buckets, replication-role/KMS permissions and
explicit handling of existing objects; put-bucket-replication replaces existing
rules, so merge a reviewed snapshot rather than overwriting it. Replication is not
an immutable backup and can replicate corruption/deletion. Use a private unique
temporary file instead of shared /tmp/replication-config.json when implementing.
AWS Cross-Region DR Implementation
# === Database Replication ===
# Create cross-region RDS read replica
aws rds create-db-instance-read-replica \
--db-instance-identifier prod-db-dr-replica \
--source-db-instance-identifier arn:aws:rds:us-east-1:123456789012:db:prod-db \
--db-instance-class db.r6g.large \
--region us-west-2 \
--kms-key-id arn:aws:kms:us-west-2:123456789012:alias/rds-dr-key \
--multi-az \
--tags Key=Purpose,Value=DR Key=Environment,Value=production
# Create Aurora Global Database for near-zero RPO
aws rds create-global-cluster \
--global-cluster-identifier prod-global-db \
--source-db-cluster-identifier arn:aws:rds:us-east-1:123456789012:cluster:prod-aurora-cluster \
--region us-east-1
# Add secondary region to Aurora Global Database
aws rds create-db-cluster \
--db-cluster-identifier prod-aurora-dr \
--global-cluster-identifier prod-global-db \
--engine aurora-postgresql \
--region us-west-2 \
--kms-key-id arn:aws:kms:us-west-2:123456789012:alias/aurora-dr-key
# === Storage Replication ===
# S3 cross-region replication
cat > /tmp/replication-config.json << 'EOF'
{
"Role": "arn:aws:iam::123456789012:role/s3-replication-role",
"Rules": [
{
"ID": "ReplicateAll",
"Status": "Enabled",
"Filter": {"Prefix": ""},
"Destination": {
"Bucket": "arn:aws:s3:::prod-data-dr-usw2",
"StorageClass": "STANDARD",
"EncryptionConfiguration": {
"ReplicaKmsKeyID": "arn:aws:kms:us-west-2:123456789012:alias/s3-dr-key"
}
},
"DeleteMarkerReplication": {"Status": "Disabled"},
"Priority": 1,
"SourceSelectionCriteria": {"SseKmsEncryptedObjects": {"Status": "Enabled"}}
}
]
}
EOF
aws s3api put-bucket-replication \
--bucket prod-data-use1 \
--replication-configuration file:///tmp/replication-config.json
# === DNS Failover ===
# Route53 health check for primary region
aws route53 create-health-check --caller-reference "prod-health-$(date +%s)" \
--health-check-config '{
"Type": "HTTPS",
"FullyQualifiedDomainName": "primary-health.example.com",
"Port": 443,
"ResourcePath": "/health",
"RequestInterval": 10,
"FailureThreshold": 3,
"EnableSNI": true
}'
# Configure failover routing
aws route53 change-resource-record-sets --hosted-zone-id Z123456 \
--change-batch '{
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "A",
"SetIdentifier": "primary",
"Failover": "PRIMARY",
"AliasTarget": {
"HostedZoneId": "Z1234PRIMARY",
"DNSName": "primary-alb.us-east-1.elb.amazonaws.com",
"EvaluateTargetHealth": true
},
"HealthCheckId": "health-check-id-primary"
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "A",
"SetIdentifier": "secondary",
"Failover": "SECONDARY",
"AliasTarget": {
"HostedZoneId": "Z5678SECONDARY",
"DNSName": "dr-alb.us-west-2.elb.amazonaws.com",
"EvaluateTargetHealth": true
}
}
}
]
}'Failover runbook and worked drill
The former executable script promoted a replica and declared success after a
health URL without fencing the primary, updating app DB credentials or verifying
routing/data. Do not automate that sequence unchanged. Use an owner-approved,
service-specific runbook with explicit incident authority and rollback limits:
1. Record disruption/declaration times, intended account/regions and last verified
recoverable transaction/replication lag. Obtain the loss acceptance decision.
2. Fence the old writer and producers, including jobs/webhooks, and verify fencing;
a network partition can
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- distributed-tracing – Triển khai distributed tracing với Jaeger và Tempo để quan sát luồng request qua các…
- doc2math – Chuyển tài liệu kỹ thuật dạng văn bản thành Đặc tả bài toán toán học có căn cứ, gồm…
- solana – Truy vấn ví, token, giao dịch và NFT trên Solana theo USD.
- domain-authority-simulator – Domain Authority Simulator. Dùng khi làm việc với tín hiệu domain và một rubric chấm…
- domain-comparison-report-tool – Domain Comparison Report Tool. Dùng khi làm việc với hai hoặc nhiều domain có chỉ số so…
- domain-modeling – Xây dựng và hoàn thiện mô hình miền của dự án. Dùng khi người dùng muốn chốt thuật ngữ…
- doom-pay – Thêm liên kết thanh toán DOOM và wDOOM tự lưu ký với DoomPay, rồi xác minh biên nhận…
- songwriting-and-ai-music – Kỹ thuật sáng tác ca từ và prompt tạo nhạc AI với Suno.