|

Active-Passive Disaster Recovery: Designing KVM VPS Clusters in Moscow

disaster recovery Moscow Russia VPS: Technical architecture diagram for enterprise Russia VPS hosting
Quick Answer âś“ Expert Verified
AEO Executive Summary

For mission-critical disaster recovery Moscow Russia VPS planning, Build a dual-datacenter disaster recovery cluster by splitting workloads between geographically isolated Moscow facilities—such as DataLine NORD (north) and OST (east). Link two KVM VPS nodes using VRRP and ultra-resilient ZFS storage synchronization with split-brain fencing and continuous asynchronous database replication. This dual-site architecture achieves 99.99% service availability with automatic failover in under 15 seconds.

Executive Overview Engineering Context
Deployment Architecture Guide

Engineering high-availability architectures in Moscow requires dual-datacenter clustering across physically separated facilities like DataLine NORD and OST. Implementing automated heartbeat monitoring and IP failover ensures instantaneous service recovery should one facility experience an outage.

DR Architecture
Active-Passive Dual DC
Split Campus (NORD + OST)
Heartbeat Engine
Keepalived & VRRP
Real-Time Cluster Polling
IP Failover
Floating Virtual IP
Sub-3s Traffic Redirection
Storage Sync
Synchronous Block
Zero Data Divergence
Facility Isolation
Independent Feeds
Dual 110kV Municipal Grids
Availability SLA
99.99% Enterprise
Continuous Mission Uptime

Key Active-Passive Clustering Takeaways

  • Dual-Facility Moscow Ring: Deploying primary and standby nodes across separate Moscow datacenters connected via dedicated metro dark fiber provides sub-1ms inter-cluster replication.
  • VRRP & Virtual IP Failover: Keepalived monitors daemon health. upon primary node failure, the standby node claims the Virtual IP via gratuitous ARP in milliseconds without DNS wait.
  • Split-Brain Protection: Fencing mechanisms and quorum health checks ensure that transient network partitions never result in two nodes acting as simultaneous write masters.
  • State Synchronization: Pairing PostgreSQL/MariaDB streaming replication with lsyncd or Unison for configuration and static asset mirroring keeps the standby permanently ready.

Active-Passive Cluster Architecture

When designing high-availability systems, architectural simplicity is frequently the highest virtue. While an **Active-Active** cluster (where all nodes process concurrent writes simultaneously) sounds appealing, it introduces immense technical complexity: distributed multi-master database locking (e.g., Galera Cluster or CockroachDB), high network commit latency, write conflict resolution, and complex state reconciliation during split-brain partitions.

Why Active-Passive Dominates Enterprise Deployments

In an **Active-Passive** architecture:

99.99% UPTIME & RTO <15S NORD to OST Dual-Facility
Active-Passive Moscow Cluster

Delivers automated failover between northern and eastern Moscow datacenters with virtual IP reassignment in seconds.

TOTAL OUTAGE RISK Single Point of Failure
Single-Datacenter VPS

Leaves enterprise operations completely unprotected during local facility power outages or upstream fiber cuts.

  • Zero Write Conflict Risk: Only one node acts as the authoritative read/write master at any given millisecond. Relational databases execute queries at full local NVMe speeds without waiting for distributed network locks.
  • Predictable Performance: System capacity is clearly bounded. Under normal conditions, the primary node operates comfortably at 50% CPU load. if failover occurs, the secondary node has 100% capacity ready to absorb the full production workload.
  • Turnkey Disaster Recovery: The standby server can be located in an entirely separate geographical facility. This provides genuine disaster recovery protection against metro-scale outages.

Dual-Datacenter Topology: NORD vs OST

In the Moscow telecommunications ecosystem, true physical redundancy is achieved by deploying nodes across geographically separated facilities linked by high-capacity dark fiber rings. A premier example is the pair of Tier-III datacenters operated by DataLine: DataLine NORD (located in northern Moscow on Korovinskoye Shosse) and DataLine OST (located in eastern Moscow on Borovaya Street).

Separated by approximately 22 kilometers across the city, these facilities reside on independent municipal electrical sub-stations, separate cooling loops, and distinct physical fiber feeds from Rostelecom and MSK-IX. Dedicated redundant dark fiber links between NORD and OST deliver round-trip times of 0.6ms to 1.1ms. This sub-millisecond proximity allows near-instantaneous state replication without impacting application response times.

DUAL CAMPUS
NORD & OST Placement

Separates primary and secondary nodes across distinct Moscow electrical and municipal zones.

VRRP PROTOCOL
Virtual IP Failover

Keepalived monitors hypervisor health while maintaining the Order No. 21 technical security baseline during failover transitions.

SPLIT-BRAIN FENCE
Quorum & Watchdog

Strict fencing mechanisms prevent dual writes and database corruption during network partitions.

STATE REPLICATION
Asynchronous WAL

Continuous database delta streaming ensures secondary node is always ready for live traffic.

Virtual IP (VIP) Failover with VRRP

The core mechanism enabling rapid failover in an active-passive cluster is the **Virtual IP (VIP)** managed by **Keepalived** implementing the IETF RFC 5798 Virtual Router Redundancy Protocol specification.

How VRRP Failover Operates

In this configuration:

< 15 Sec
Failover RTO

Rapid automated recovery time objective during unexpected primary node outages.

99.99 %
SLA Guarantee

Four-nines availability backed by redundant physical infrastructure in Moscow.

< 0.8 ms
Inter-Site RTT

Sub-millisecond optical transit between NORD and OST over private DWDM.

  1. Both VPS nodes are assigned private cluster IPs and share a single public-facing **Virtual IP** (the IP configured in your domain’s DNS A record).
  2. The Primary node runs Keepalived with state MASTER and a higher priority (e.g., priority 101), actively binding the VIP.
  3. The Secondary node runs Keepalived with state BACKUP and a lower priority (e.g., priority 100), listening for periodic VRRP multicast advertisements sent by the master.
  4. Keepalived executes custom health-check scripts, coordinating with off-site incremental backup scheduling on MSK time (checking if Nginx is accepting connections, PostgreSQL is responsive, and disk space is healthy).
  5. If the master fails to emit advertisements for 3 consecutive intervals (6 seconds) or its health check exits with an error code, the backup node immediately promotes itself to MASTER, broadcasts a Gratuitous ARP (GARP) packet to update datacenter switch CAM tables, and binds the VIP.

Preventing Split-Brain with Fencing

The most dangerous hazard in high-availability clustering is a **split-brain** condition. If the inter-datacenter communication link is temporarily severed while both servers remain powered on, the backup server will assume the master has died and claim the VIP. Simultaneously, the master believes it is still alive and continues accepting writes.

Defensive Fencing Architecture

To guarantee that two nodes never execute concurrent writes:

Failover Architecture Principle

By leveraging Keepalived with custom health-check scripts, your cluster evaluates not just server ping, but actual application HTTP status and database readiness before triggering VIP promotion.

  • External Gateway Ping Checking: In addition to inter-node heartbeats, health scripts verify connectivity to an independent upstream gateway (such as MSK-IX border routers). If a node loses its external internet gateway, it voluntarily drops its Keepalived priority.
  • Automated Read-Only Promotion Scripts: When a standby node assumes master state, Keepalived triggers a transition script (notify_master) that explicitly executes database promotion (e.g., pg_ctl promote). Conversely, during demotion (notify_backup), the database is immediately placed into read-only recovery mode.

Disaster Recovery Topologies Matrix

The comparison table below contrasts the recovery objectives, architectural complexity, and failover mechanics of various high-availability designs:

Clustering Topology RTO (Recovery Time) RPO (Data Loss) Engineering Complexity
Active-Passive (Keepalived VRRP) 5 to 15 seconds (Automated) Sub-second (Streaming WAL) Moderate & Rock-Solid
Active-Active (Multi-Master Galera) Sub-second Zero Extremely High (Deadlock risks)
DNS-Based Failover (GeoDNS) 2 to 15 minutes (DNS TTL lag) Sub-second Low
Cold Standby (Manual Spin-up) 1 to 4 hours (Manual engineer call) Minutes to Hours Minimal

Production Keepalived CLI Setup

This shell script configures Keepalived on Ubuntu/Debian. It deploys an automated VRRP instance that monitors web server and database health, manages a shared Virtual IP, and executes state transition scripts upon failover.

# /usr/local/bin/setup-keepalived-dr.sh Bash Automation Blueprint
root@russia-vps-node28:~ [SSH:22]
PuTTY v0.81 BASH CLI
#!/usr/bin/env bash
set -euo pipefail

# 1. Install Keepalived and networking utilities
apt-get update && apt-get install -y keepalived curl iproute2 jq

# 2. Allow non-local IP binding in Linux Kernel
cat <<'EOF' &gt. /etc/sysctl.d/99-keepalived-vip.conf
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
EOF
sysctl -p /etc/sysctl.d/99-keepalived-vip.conf

# 3. Create Automated Health Check Script
mkdir -p /opt/cluster-scripts
cat <<'EOF' &gt. /opt/cluster-scripts/check_service_health.sh
#!/usr/bin/env bash
# Verify Nginx is responsive locally
curl -sSf http://127.0.0.1/healthz &gt. /dev/null 2>&1 || exit 1
# Verify PostgreSQL is accepting queries
pg_isready -q || exit 1
exit 0
EOF
chmod +x /opt/cluster-scripts/check_service_health.sh

# 4. Configure Keepalived VRRP Instance (Primary Node Config)
cat <<'EOF' &gt. /etc/keepalived/keepalived.conf
global_defs {
    router_id MOSCOW_DR_NODE_1
    enable_script_security
    script_user root
}

vrrp_script check_health {
    script "/opt/cluster-scripts/check_service_health.sh"
    interval 2
    weight 2
    fall 2
    rise 2
}

vrrp_instance VI_MOSCOW_DR {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 101
    advert_int 1

    authentication {
        auth_type PASS
        auth_pass SecClustPass2026!
    }

    virtual_ipaddress {
        194.87.xxx.xxx/24 dev eth0 label eth0:vip
    }

    track_script {
        check_health
    }

    notify_master "/opt/cluster-scripts/promote_to_master.sh"
    notify_backup "/opt/cluster-scripts/demote_to_standby.sh"
}
EOF

systemctl enable keepalived
systemctl restart keepalived
echo "=== Keepalived Active-Passive Failover Configured Successfully ==="

Real-Time State & Data Synchronization

An active-passive cluster is only as effective as its data synchronization engine. Two primary methodologies exist to replicate state between the primary and standby VPS nodes:

Method 1: Application-Level Streaming (Recommended)

The most flexible approach decouples storage by data type:

1
Assign Floating Virtual IP (VIP)

Obtain an enterprise failover IP address routable between both DataLine NORD and OST racks.

2
Configure Keepalived on Both Nodes

Set primary node as `STATE MASTER` (priority 101) and secondary as `STATE BACKUP` (priority 100).

3
Deploy Application Health-Check Script

Implement automated monitoring of Nginx and MySQL processes to trigger failover upon service crash.

  • Databases: PostgreSQL physical streaming replication handles structured transactional mutations at the WAL block level with sub-millisecond precision.
  • Static Files & Media: Real-time inotify-based file synchronizers (such as lsyncd or Unison) push newly uploaded product images, invoices, and templates over an encrypted SSH/rsync stream within seconds.
Method 2: Block-Level Synchronous DRBD

For workloads requiring unified block-level mirroring, the Distributed Replicated Block Device (DRBD 9) creates a virtual RAID-1 network mirror across the virtual disks of both VPS instances. Every sector written to the primary VPS filesystem is mirrored over the private network to the secondary before the write is acknowledged. This provides complete filesystem synchronization at the cost of slight write latency overhead.

Frequently Asked Questions

Q What is the operational difference between RTO and RPO in disaster recovery planning? +

Recovery Time Objective (RTO) is the duration of time within which service must be restored following an outage (e.g., failover within 10 seconds). Recovery Point Objective (RPO) is the maximum acceptable data loss measured in time (e.g., zero data loss over synchronous replication vs. 1 second over asynchronous replication).

Q How does Keepalived transfer a Virtual IP between NORD and OST without restarting services? +

Keepalived utilizes the Virtual Router Redundancy Protocol (VRRP). Both VPS instances exchange multicast or unicast VRRP heartbeats over the private optical cross-connect. If the primary node in NORD stops sending heartbeats, the standby node in OST claims the VIP on its network interface in under 1 second. This maintains active client connections.

Q Why should active and passive cluster nodes reside in physically distinct datacenter facilities? +

Placing both nodes in the same building leaves your infrastructure vulnerable to facility-wide power outages, cooling system failures, municipal utility disruptions, or physical building incidents. Distributing nodes between DataLine NORD and OST (15km apart) protects against localized catastrophic failures.

Q How do I prevent split-brain syndrome where both nodes attempt to write to the database simultaneously? +

Prevent split-brain by implementing a 3-node quorum mechanism using etcd or Consul, or deploying an external arbiter witness node. If network connectivity between NORD and OST is interrupted, only the partition with the strict majority vote is authorized to accept writes. Meanwhile, the isolated node transitions to read-only mode.

Q Does Onlive Server support routed Virtual IPs for failover clustering in Moscow? +

Yes. Onlive Server supports routed Virtual IPs (floating IPs) and Layer-2 private VLANs across its DataLine Moscow infrastructure. You can assign floating IPs between multiple VPS instances. This enables automated Keepalived or Pacemaker/Corosync failover configurations.

Q How does an active-active load-balanced topology differ from active-passive failover? +

In an active-passive setup, the standby node sits idle until the primary fails. In an active-active setup, both NORD and OST nodes actively process incoming web traffic simultaneously behind an upstream BGP Anycast or HAProxy load balancer, maximizing resource utilization and doubling total system capacity.

Q What health-check scripts should Keepalived execute to detect application-level failures? +

Configure a `vrrp_script` in `/etc/keepalived/keepalived.conf` that queries your application health endpoint (`curl -sf http://127.0.0.1/health.php`). If MySQL, PHP-FPM, or Nginx crashes—even while the Linux OS remains running—Keepalived detects the check failure and triggers immediate VIP failover.

Q How is user session state synchronized across dual-datacenter web servers? +

Store user session data in a replicated Redis cluster (or Redis Sentinel) accessible to web servers in both facilities. When a visitor’s request is routed from NORD to OST during failover, their active shopping cart, login session, and checkout progress persist without forcing a re-login.

⚡ Dual-Datacenter High-Availability DR

Deploy High-Availability Moscow DR Clusters

Achieve 99.99% uptime with automated VRRP failover across Tier-III Moscow datacenters. Pure enterprise NVMe storage, sub-1ms inter-DC fiber, and sub-15-second RTO.

âś“ 99.98% Network SLAâś“ Pure NVMe RAID-10âś“ Instant 2-Minute Deployment
KR

Kiran Rajvanshi

Web & Infrastructure Technical Specialist at Onlive Server

Specializing in active-passive disaster recovery clustering, Keepalived VRRP topology, high-availability storage replication, and Linux virtualization across Russian datacenters.