Hello,
This is to find out to which “SYNC” level is possible load balance 2 Plex Media Servers (PMS)..
My scenario:
Network layer:
- Site A is hosting primary PLEX Media Server
- Site B is hosting backup PLEX Media Server
- Site A is interconnected with Site B through private tunnel
- Network speed of the tunnel is about 500mbps
- Site A is hosting on extra server Reverse Proxy engine which will loadbalance to Master PMS unless its down, then it will at network level switch over to Backup PMS
System layer:
- Both sites are running Debian 12
- Docker environment
- Backup PMS has 1:1 copy of all media files from Master PMS
- Media files are synced daily from Master to Backup (never other way around)
- From the container perspective the file system is looking the same. All media appear in the very same folder structure.
Desired scenario:
- Master PMS is always serving if it is running
- Backup PMS is server only in case Master PMS is down
- Configuration changes like Users / Libraries / Server settings are done only on the Master PMS.
- Backup PMS is never configured via settings manually. It will be always loading config from the database which will be taken from the Master PMS.
- Data related to user content state like watch position, watch history, ratings, watchlist etc
- ideally in sync between Master PMS and Backup PMS (every hour or so) - so in case Backup PMS is serving it will push its history data over to Master PMS and vice versa.
- not ideally but “ok” if Backup PMS will use Master PMS data and don’t update Master PMS about changes in case Backup PMS is serving.
Findings:
Plex Media Server is storing all its configuration in multiple database files:
- com.plexapp.plugins.library:
com.plexapp.plugins.library.dbcom.plexapp.plugins.library.db-shmcom.plexapp.plugins.library.db-walcom.plexapp.plugins.library.db.fix
- com.plexapp.plugins.library.blobs:
com.plexapp.plugins.library.blobs.dbcom.plexapp.plugins.library.blobs.db-shmcom.plexapp.plugins.library.blobs.db-wal
- com.plexapp.dlna:
com.plexapp.dlna.dbcom.plexapp.dlna.db-shmcom.plexapp.dlna.db-wal
My plan to achieve the desired scenario is to rsync correct database/s between Master PMS and Backup PMS. However I need to understand to which level this can be achieved and if there exists a better approach than using scheduled rsync.
Thank you!
