High availability and operations

Add replicas without creating a new route

Run multiple connectors for one tunnel and understand that replicas improve connector availability rather than duplicating DNS configuration.

8 minute lesson

~~~

One connector host is one point of failure. It reboots for patches, its disk fills, someone trips over its power cable. The fix is not a second tunnel — it is a second connector for the same tunnel.

A tunnel can have multiple cloudflared replicas. A replica is another cloudflared process running with the same tunnel credentials, usually on a different host:

# on the second host, with the same tunnel token
sudo cloudflared service install eyJhIjoiNmZmNDJhZTIt...

Cloudflare sends traffic through healthy connections, so one connector host can fail without removing the hostname or private route. Verify both replicas registered:

cloudflared tunnel info practice-app

The output lists each connector with its own ID, origin IP, and connections. Two connectors, each holding several edge connections, is the picture you want.

Why this beats a second tunnel

The hostnames and private routes belong to the tunnel, not to any connector. Replicas inherit all of it. If you instead created a second tunnel for redundancy, you would duplicate every DNS record and route, and keep the copies synchronized forever. Replicas improve connector availability without duplicating DNS configuration — that is the entire design.

Place replicas deliberately

Place replicas where they independently reach the origin, avoid one shared failure domain, and deploy the same routing intent. Two replicas on the same VM host, power feed, or uplink fail together, which buys you nothing. And both must reach the origin service on their own: a replica that registers with Cloudflare but cannot reach the origin turns a clean failure into intermittent errors, because Cloudflare will happily send it traffic.

High availability also needs an origin that can survive or move beyond one host. Two connectors pointing at one app process just moves the single point of failure one hop inward.

Run a second practice connector, stop the first, and verify traffic continues before calling the design redundant. Watch cloudflared tunnel info while you stop the first connector: its connections drop out of the list, requests keep succeeding, and nothing needed your intervention. Redundancy you have not exercised is a hope, not a design.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →