sidecar

Chris Lu
2026-05-02 11:33:48 -07:00
parent cdab925459
commit 5d64fb0df9
@@ -22,6 +22,38 @@ weed filer.sync -a <filer1_host>:<filer1_port> -b <filer2_host>:<filer2_port> -i
At the beginning, it will bootstrap from the beginning of time, or resume from the last replication checkpoint. Later, it will just run continuously and persist checkpoints periodically.
## On Kubernetes with the SeaweedFS Operator
If you are running SeaweedFS on Kubernetes via the [SeaweedFS Operator](https://github.com/seaweedfs/seaweedfs-operator), you can run `weed filer.sync` as a sidecar inside the filer pod itself, so it shares the pod's lifecycle and dials the local filer over loopback. Each `ComponentSpec` exposes a `sidecars` field that accepts arbitrary `v1.Container` entries.
```yaml
apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
name: prod
spec:
image: chrislusf/seaweedfs:latest
master:
replicas: 3
volume:
replicas: 3
requests:
storage: 100Gi
filer:
replicas: 2
sidecars:
- name: filer-sync
image: chrislusf/seaweedfs:latest
command:
- weed
- filer.sync
- -a=localhost:8888
- -b=remote-filer.dr.svc.cluster.local:8888
- -isActivePassive
```
The sidecar runs alongside every filer replica. For active-passive replication you typically want a single sync process — pin the sidecar to one replica with a separate single-replica filer, or run `filer.sync` as its own `Deployment` instead.
## How it works?
Each filer has its own local change logs. `weed filer.sync` will read the logs and replay them in the other cluster.