指南

WireGuard 메시로 다중 지역 장애 조치

고급40분 읽기업데이트됨 2026년 7월 8일
간단한 답변

세 국가의 세 인스턴스가 WireGuard로 메시로 연결되고, 애플리케이션이 메시에만 바인딩되며, 상태 점검된 DNS 레코드가 앞에 있으면, 월 $110 미만으로 진정한 내결함성을 제공합니다. 설계 제약은 데이터베이스 복제입니다: 지역 내에서는 동기식, 지역 간에는 비동기식입니다.

01 세 개의 독립적인 장애 도메인을 선택하세요

Different countries, ideally different transit mixes. Amsterdam, Ashburn and Singapore is the classic triangle. Three is the minimum for quorum — two gives you a split-brain problem rather than redundancy.

02 메시 구축

Each node gets a stable private address. Every node peers with every other node; with three nodes that is three tunnels.

# node A — /etc/wireguard/mesh.conf
[Interface]
Address = 10.10.0.1/24
ListenPort = 51821
PrivateKey = <A private>

[Peer]                       # node B
PublicKey = <B public>
Endpoint = b.example.net:51821
AllowedIPs = 10.10.0.2/32
PersistentKeepalive = 25

[Peer]                       # node C
PublicKey = <C public>
Endpoint = c.example.net:51821
AllowedIPs = 10.10.0.3/32
PersistentKeepalive = 25

03 서비스를 메시에만 바인딩하세요

The database, the cache and the internal API should listen on 10.10.0.x, never on the public address. This removes an entire class of exposure without a single firewall rule.

04 适当复制数据库

Synchronous replication across regions is impractical — a 160 ms round trip becomes the floor for every write. Use asynchronous replication across regions and know your recovery point objective.

05 在DNS层进行健康检查

Short TTLs plus health-checked failover records, or anycast if your regions support it. Then run a failure drill: kill a region deliberately, on a weekday, while you are watching.

자주 묻는 질문

더 큰 서버를 사면 안 되나요?

더 큰 서버는 작은 서버와 같은 수의 장애 도메인, 즉 하나를 가집니다. 가용성은 용량이 아니라 독립성에서 나옵니다.

etcd 또는 Postgres 동기식 복제본은 얼마나 떨어져 있을 수 있나요?

동기식 복제본은 서로 약 100 ms 이내에 유지하세요. 그 이상이 되면 쓰기 지연 시간이 모든 트랜잭션의 지배적인 비용이 됩니다.