77e30685bb
- Implements Phases 3–6: session isolation, cache coordination, primary election, and file system monitor coordination for Jellyfin with PostgreSQL. - Adds new database entities (Instance, DistributedLock, FileSystemChange) and EF model configurations. - Includes SQL migration scripts and EF migration for all required tables, columns, and helper functions. - Updates Device entity and JellyfinDbContext for multi-instance tracking. - Integrates new DI services for instance registry, distributed locks, cache coordinator, and primary election. - Adds publishing profiles (Win/Linux/FrameworkDependent) and automation script for deployment. - Extensive documentation for architecture, setup, and publishing. - All changes are backward compatible and build successfully.
3.7 KiB
3.7 KiB
Quick Reference - Publishing Multi-Instance Jellyfin
One-Command Publishing
# Windows self-contained (recommended)
dotnet publish -p:PublishProfile=MultiInstance-Win-x64
# Linux self-contained
dotnet publish -p:PublishProfile=MultiInstance-Linux-x64
# Framework-dependent (smaller, requires .NET 11 runtime)
dotnet publish -p:PublishProfile=MultiInstance-FrameworkDependent
Automated Deployment
# Publish and deploy in one step
.\PublishAndDeploy.ps1
# Options
.\PublishAndDeploy.ps1 -Profile MultiInstance-Linux-x64 -SkipDeploy
.\PublishAndDeploy.ps1 -CreatePackage -PackageOutput "C:\Releases"
.\PublishAndDeploy.ps1 -DeployPath "D:\Jellyfin" -Verbose
Output Locations
Profile: MultiInstance-Win-x64
Output: lib\Release\net11.0\win-x64\publish\
Profile: MultiInstance-Linux-x64
Output: lib\Release\net11.0\linux-x64\publish\
Profile: MultiInstance-FrameworkDependent
Output: lib\Release\net11.0\win-x64\publish\
Essential Files in Package
jellyfin.exe # Main application
Npgsql.dll # PostgreSQL driver
sql\add_multi_instance_support.sql # Multi-instance setup script
startup.json # Configuration file
startup.json.windows # Windows template
startup.json.linux # Linux template
First-Time Deployment Checklist
- 1. Publish application using a profile
- 2. Copy to target server
- 3. Create
config/database.xmlwith PostgreSQL connection - 4. Run
sql/add_multi_instance_support.sqlon database - 5. Start Jellyfin
Database Configuration Template
<!-- config/database.xml -->
<?xml version="1.0" encoding="utf-8"?>
<DatabaseConfigurationOptions>
<DatabaseType>Jellyfin-PostgreSQL</DatabaseType>
<CustomProviderOptions>
<ConnectionString>Host=YOUR_SERVER;Port=5432;Database=jellyfin;Username=jellyfin;Password=YOUR_PASSWORD</ConnectionString>
</CustomProviderOptions>
</DatabaseConfigurationOptions>
Multi-Instance Setup SQL
# Run once per database (not per instance!)
psql -h YOUR_SERVER -U jellyfin -d jellyfin -f sql\add_multi_instance_support.sql
Verify Deployment
# Check critical files
Test-Path "C:\Jellyfin\jellyfin.exe"
Test-Path "C:\Jellyfin\sql\add_multi_instance_support.sql"
Test-Path "C:\Jellyfin\config\database.xml"
# Test PostgreSQL connection
Test-NetConnection -ComputerName YOUR_SERVER -Port 5432
Start Application
# Windows
cd C:\Jellyfin
.\jellyfin.exe
# Linux
cd /opt/jellyfin
./jellyfin
# Custom port
.\jellyfin.exe --port 8097
Verify Multi-Instance Setup
-- Check registered instances
SELECT instance_id, host_name, is_active FROM library.instances;
-- Check primary instance
SELECT library.get_primary_instance();
-- Check heartbeats
SELECT instance_id, last_heartbeat FROM library.instances WHERE is_active = true;
Common Issues
| Issue | Solution |
|---|---|
| "Failed to connect to 127.0.0.1:5432" | Create config/database.xml with correct connection |
| SQL script not found | Verify sql/add_multi_instance_support.sql exists in publish output |
| Port already in use | Use --port 8097 to specify different port |
| .NET runtime not found (Framework-Dependent) | Install .NET 11 runtime on target server |
Package Sizes
- Self-Contained: ~210 MB (includes .NET runtime)
- Framework-Dependent: ~100 MB (requires .NET 11 runtime)
Documentation
- 📘
docs/PUBLISHING_PROFILES_GUIDE.md- Complete guide - 📘
docs/PUBLISH_PROFILES_SETUP_COMPLETE.md- Setup summary - 📘
docs/MULTI_INSTANCE_COMPLETE.md- Multi-instance overview
Quick Help: For detailed instructions, see docs/PUBLISHING_PROFILES_GUIDE.md