chirpstack / chirpstack

ChirpStack open-source LoRaWAN Network Server
https://www.chirpstack.io/
MIT License
586 stars 153 forks source link

High Availability Docs #558

Closed offizium-berndstorath closed 3 days ago

offizium-berndstorath commented 3 days ago

I deploy your solution (which i contribute back to ofc) at a larger scale for some time.

But I have Chirpstack, Redis, Mqtt and Postgres on a single server. Which if down is very bad.

There is little to non actual examples and docs about HA. I know I can deploy some parts multiple times and load balance them. But how exactly? What would a good solution with 2 Servers look like?

I though about something like that. But I still have a single point of failure with Server1

flowchart LR
    subgraph Server1
        A[Gateway Bridge] --> |MQTT| Mosquitto
    end

    subgraph Server3
        Postgres1

        Chirpstack1
        Chirpstack1 --> |MQTT| Mosquitto

        Redis1

        HAProxy1
        HAProxy1 --> |SQL| Postgres1
        HAProxy1 --> |TCP| Redis1
        HAProxy1 <--> Chirpstack1
    end

    subgraph Server4
        Postgres2

        Chirpstack2
        Chirpstack2 --> |MQTT| Mosquitto

        Redis2

        HAProxy2
        HAProxy2 --> |SQL| Postgres2
        HAProxy2 --> |TCP| Redis2
        HAProxy2 <--> Chirpstack2
    end

    HAProxy1 <--> HAProxy2

    C[Load Balancer]
    Gateway --> |Semtech UDP| A
    C --> HAProxy1
    C --> HAProxy2
    User --> |HTTP| C

I am not 100% familiar with HA and Load Balancing so I don't know exactly if it would work like that

Maybe Chirpstack could be used with Kubernetes?

brocaar commented 3 days ago

There are multiple ways to set a HA ChirpStack instance. In general:

offizium-berndstorath commented 3 days ago

The point was to maybe add Docs or (concrete) Examples how HA / Failover could be implemented.