Beta

High-availability mode for the App Gateway Connector

Run two or three outbound connector instances for one workspace connector, verify health, perform rolling maintenance and collect release evidence.

Steps

Follow these in order.

  1. 01Decide whether HA is neededUse it for shared production private apps, not for a personal desktop connector.
  2. 02Prepare the topologyUse one connector record and runtime token, with a unique instance ID per process.
  3. 03Run on Kubernetes, systemd or Docker ComposeChoose the supervisor that already runs production workloads in the customer network.
  4. 04Operate without planned downtimeDrain one instance, wait for streams to finish, restart it, then move to the next one.
  5. 05Validate and collect evidenceUse doctor, dashboard health, staging runners and long-window evidence before making an enterprise HA claim.

Reference

Implementation details for setup and review.

Current status and safe wordingThe connector can run in an active-active high-availability topology today: several server-side processes authenticate as the same workspace connector and BusinessProxy routes new private-app traffic to a usable instance. Treat this as ready for staging validation and controlled pilot use until the release evidence gates are complete.
  • Do say: “HA implementation is ready for staging validation.”
  • Do not say: “enterprise-ready HA release is complete” until the release gates pass.
  • The desktop wrapper is not an HA runtime. Use the CLI connector as a managed server process.
When to use this modeUse high availability when a private app is shared by a team, supports customer operations, or must stay reachable during a connector host restart. A single connector process is usually enough for local testing, a personal lab, or a temporary proof of concept.
  • Use two instances for the normal production baseline.
  • Use three instances when you run several BusinessProxy API replicas or need more maintenance margin.
  • Put instances on different hosts or nodes if the requirement includes host failure tolerance.
How the topology worksEvery instance starts an outbound connection to BusinessProxy. No public inbound port is opened to the customer network. All instances use the same connector ID and runtime token, while CONNECTOR_INSTANCE_ID distinguishes the running processes. BusinessProxy tracks online, draining, stale and offline instances separately and avoids new work on draining or unhealthy instances.
  • Existing streams can finish during drain; new streams go to another usable instance.
  • Token rotation closes old authenticated tunnels across API replicas.
  • Relay fallback remains a safety path, but steady-state fallback rate must stay below 1% before an enterprise release claim.
PrerequisitesBefore adding replicas, make sure one connector instance works reliably. Do not use scale-out to hide a wrong token, unreachable internal app, TLS error or unstable network path.
  • The workspace has an App Gateway connector record and a current runtime token.
  • Each connector host can reach BusinessProxy API over outbound HTTPS and can reach every configured internal upstream.
  • Secrets are stored in the platform secret store, not in screenshots, tickets or shell history.
  • Time synchronization is enabled on connector hosts so heartbeat and evidence windows are reliable.
Common runtime configurationKeep the shared values identical across all instances. Only CONNECTOR_INSTANCE_ID must be unique. Use stable names that identify the process location, such as dc1-a, dc1-b or k8s-connector-1.
BUSINESSPROXY_API_URL=https://api.business-proxy.com
CONNECTOR_WORKSPACE_ID=<workspace-id>
CONNECTOR_ID=<connector-id>
CONNECTOR_TOKEN=<runtime-token>
CONNECTOR_INSTANCE_ID=<unique-instance-id>
CONNECTOR_TUNNEL_CONNECTIONS=2
CONNECTOR_DRAIN_ON_EXIT=true
CONNECTOR_DRAIN_TIMEOUT=30s
  • Do not reuse the same CONNECTOR_INSTANCE_ID for two live processes.
  • Start with CONNECTOR_TUNNEL_CONNECTIONS=2 unless support gives a different value.
  • Keep CONNECTOR_DRAIN_ON_EXIT=true so normal restarts stop accepting new work before exit.
Capacity ruleFor API replica coverage, the total number of connector tunnels should cover BusinessProxy API replicas with a safety factor. If the account dashboard or doctor reports a coverage warning, add connector instances or increase tunnel connections before relying on HA.
instances * CONNECTOR_TUNNEL_CONNECTIONS >= coverage_factor * API_REPLICA_COUNT

Example:
3 instances * 2 tunnels >= 2 * 3 API replicas
Basic two-instance launchCreate one shared environment file with common values and one small per-instance file per process. Load both files before starting the connector. The exact binary path depends on the artifact downloaded from the account.
set -a
. /etc/businessproxy/connector/common.env
. /etc/businessproxy/connector/instance-a.env
set +a

businessproxy-connector doctor
businessproxy-connector run
  • Repeat the same command on the second host or process with instance-b.env.
  • In the dashboard, wait until both instances are online and no stale or draining warning is shown.
Kubernetes deploymentUse Kubernetes when the customer already operates production workloads there. A Deployment is the default choice. Use a Secret for runtime values, Downward API for a unique instance ID, a PodDisruptionBudget to keep at least one instance available, and a rolling update strategy.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: businessproxy-connector
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
  template:
    spec:
      terminationGracePeriodSeconds: 60
      containers:
        - name: connector
          image: businessproxy/connector:<version>
          envFrom:
            - secretRef:
                name: businessproxy-connector-runtime
          env:
            - name: CONNECTOR_INSTANCE_ID
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: CONNECTOR_DRAIN_ON_EXIT
              value: "true"
  • Add egress rules that allow HTTPS to BusinessProxy API and internal access to the private app upstreams.
  • Do not expose a Kubernetes Service for inbound traffic to the connector.
systemd deploymentUse systemd on Linux hosts or virtual machines. Keep common values in one environment file and per-instance values in separate files. Each service should restart automatically and should receive enough stop time for drain.
[Unit]
Description=BusinessProxy Connector %i
After=network-online.target
Wants=network-online.target

[Service]
EnvironmentFile=/etc/businessproxy/connector/common.env
EnvironmentFile=/etc/businessproxy/connector/%i.env
ExecStart=/usr/local/bin/businessproxy-connector run
Restart=always
RestartSec=5s
TimeoutStopSec=75s
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target

# Start two instances:
systemctl enable --now businessproxy-connector@instance-a
systemctl enable --now businessproxy-connector@instance-b
Docker Compose deploymentUse Docker Compose when the customer manages internal tools as containers but does not use Kubernetes. Define one service per instance so each process has a stable instance ID and can be restarted independently.
services:
  connector-a:
    image: businessproxy/connector:<version>
    restart: unless-stopped
    env_file:
      - ./common.env
    environment:
      CONNECTOR_INSTANCE_ID: connector-a
      CONNECTOR_DRAIN_ON_EXIT: "true"
  connector-b:
    image: businessproxy/connector:<version>
    restart: unless-stopped
    env_file:
      - ./common.env
    environment:
      CONNECTOR_INSTANCE_ID: connector-b
      CONNECTOR_DRAIN_ON_EXIT: "true"
Rolling restart without planned downtimeRestart one instance at a time. The process should enter draining, stop accepting new streams, let existing streams finish until the drain timeout, then exit. Confirm that another instance stays online before moving to the next one.
  • Do not stop all instances at once unless the private app outage is intentional.
  • During a normal rolling restart, new requests should recover within a few seconds.
  • If fallback rate rises and does not return below 1%, stop the rollout and inspect tunnel coverage.
Token rotation in HARotate the runtime token from the account when a token may be exposed or as part of scheduled maintenance. After rotation, update the secret on every connector host and restart instances one by one. Old tunnels authenticated with the previous token are closed by BusinessProxy.
  • Do not rotate the token in the middle of initial scale-out unless the token is suspected to be exposed.
  • Keep a rollback artifact for the previous connector version, but never roll back to an ad-hoc local binary.
Operational checksAfter starting or changing HA topology, verify both the connector host and the BusinessProxy view. The dashboard should show multiple online instances for the same connector, no stale instances, no draining instances after maintenance, and no coverage warning.
businessproxy-connector doctor

# Expected dashboard state:
# - connector online
# - 2 or 3 online instances
# - no stale or draining instance after maintenance
# - no API replica coverage warning
Release evidence and long-window validationFor a controlled pilot, dashboard health and smoke checks may be enough. For an enterprise HA claim, collect the full evidence set: local release checks, security checks, staging soak, failover, rolling restart, incident drill and a 168-hour metrics window with API replica coverage and session stream evidence.
npm run connector:ha-staging-readiness:check -- \
  --profile staging \
  --env-file /secure/env/businessproxy/connector-ha-staging.env \
  --evidence-dir /secure/evidence/businessproxy/connector-ha-staging/readiness

npm run connector:ha-staging-evidence:run -- \
  --profile staging \
  --env-file /secure/env/businessproxy/connector-ha-staging.env \
  --evidence-dir /secure/evidence/businessproxy/connector-ha-staging

npm run connector:ha-long-window-evidence:run -- \
  --profile staging \
  --env-file /secure/env/businessproxy/connector-ha-long-window.env
  • Evidence files must not include tokens, private IPs, internal URLs, request bodies or raw metric output.
  • Keep G3-G9 release gates open until the real staging evidence passes.
TroubleshootingMost HA problems are configuration or placement problems: duplicate instance IDs, one host unable to reach an internal app, missing secret update after token rotation, all instances restarted together, or not enough local tunnel coverage for API replicas.
  • Only one instance is online: check CONNECTOR_INSTANCE_ID, service restart policy, outbound HTTPS and the runtime token.
  • An instance stays stale: check host time synchronization, process logs and network path to BusinessProxy API.
  • An instance stays draining after maintenance: make sure the old process exited and the supervisor started the new process with the same intended instance ID.
  • Fallback is high: check API replica coverage, tunnel count, connector saturation and reconnect storms.
  • Only one internal app fails: run diagnostics from every connector host to that app upstream before changing HA settings.
What this mode does not doConnector HA keeps the outbound access path available when one connector process or host is restarted or lost. It does not replace backups, database high availability for the internal app, GitLab or ERP clustering, identity governance, or customer network redundancy.
  • If the internal app itself is down, the connector cannot make it healthy.
  • If all connector instances run on one failed host, host-level availability is lost.
  • If the customer network blocks outbound HTTPS to BusinessProxy from every host, the connector cannot establish tunnels.