mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +00:00
1.1 KiB
1.1 KiB
Multi-Node Shared Control
Roles
master: the only node allowed to change shared account definitionsworker: rebuilds local Xray config from shared snapshots and flushes traffic deltas
Requirements
- shared mode requires MariaDB
- each worker needs a unique
nodeId - workers keep
/etc/x-ui/shared-cache.jsonfor outage survival
Runtime Loops
- workers poll
shared_accounts_versioneverysyncInterval - all nodes flush
/etc/x-ui/traffic-pending.jsoneverytrafficFlushInterval - only
masterruns shared traffic reconciliation that can disable or renew clients
Manual Verification
- Start a
masternode on MariaDB. - Start a
workernode on the same MariaDB with a uniquenodeId. - Change an inbound or client on
master. - Confirm the worker sees a newer
shared_accounts_versionand rebuilds local Xray. - Generate traffic on both nodes.
- Confirm aggregated MariaDB counters increase without overwriting each other.
- Stop MariaDB briefly and confirm the worker continues using
shared-cache.json. - Restore MariaDB and confirm pending traffic deltas flush successfully.