Rehber

WireGuard ağıyla çok bölgeli yük devretme

İleri40 dk okumaGüncellendi 8 Temmuz 2026
Kısa cevap

Üç farklı ülkede üç örnek, WireGuard üzerinden birbirine bağlı, uygulama yalnızca kafese bağlı ve önünde sağlık kontrolü yapılan bir DNS kaydı var; bu, ayda 110 $ doların altında gerçek hata toleransı sağlar. Tasarım kısıtı veritabanı çoğaltmasıdır: bölge içinde senkron, bölgeler arasında asenkron.

01 Üç bağımsız arıza alanı seçin

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 Kafesi oluşturun

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 Hizmetleri yalnızca kafese bağlayın

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 Veritabanını uygun şekilde çoğaltın

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 katmanında sağlık kontrolü yapın

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.

Sık sorulan sorular

Neden daha büyük bir sunucu satın almıyorsunuz?

Daha büyük bir sunucu, küçük olanla aynı sayıda arıza alanına sahiptir: bir. Kullanılabilirlik kapasiteden değil, bağımsızlıktan gelir.

etcd veya Postgres senkron yinelemeleri birbirinden ne kadar uzak olabilir?

Senkron yinelemeleri birbirinden yaklaşık 100 ms içinde tutun. Bunun ötesinde, yazma gecikmesi her işlemin baskın maliyeti haline gelir.