It is possible to run multiple instances of Whisparr. This is typically done when one wants a 4K and 1080p copy of a movie. Note that you can (and probably should) review TRaSH's guide and configure Whisparr to use a second Whisparr as a list. This is helpful if you wish to keep both in sync.
The following requirements should be noted:
-data=
or /data=
argument passedThis guide will show you how to run multiple instances of Whisparr on Windows using only one base installation. This guide was put together using Windows 10; if you are using a previous version of Windows (7, 8, etc.) you may need to adjust some things. This guide also assumes that you have installed Whisparr to the default directory, and your second instance of Whisparr will be called Whisparr-4K. Feel free to change things to fit your own installations, though.
nssm stop Whisparr
sc config Whisparr binpath= "C:\ProgramData\Whisparr\bin\Whisparr.exe -data=C:\ProgramData\Whisparr"
This command tells the original instance of Whisparr to explicitly use
C:\ProgramData\Whisparr
for its data directory. If you didn't use the
default Whisparr install, or if your data folder is somewhere else, you
may have to change your paths here.
C:\ProgramData\Whisparr-4K
nssm install Whisparr-4K
. A popup window will open where you can type yourC:\ProgramData\Whisparr\bin\Whisparr.exe
C:\ProgramData\Whisparr\bin
-data=C:\ProgramData\Whisparr-4K
Note that Arguments points to the new folder created in step 1.
This is crucial, as it keeps all the data files from both instances in
separate locations.
/data=
argument to allow multiple instances%appdata%\Microsoft\Windows\Start Menu\Programs\Startup
and edit the existing shortcut if needed.C:\ProgramData\Whisparr\bin\Whisparr.exe /data=C:\ProgramData\Whisparr-4K
Whisparr-4K
and finish the wizard.Port Number
from 6969
to a different port e.g. 6970
so Whisparr and Whisparr4k do not conflict<Branch>nonexistent</Branch>
Configuring the NSSM Exit Action correctly should allow Whisparr to update and restart multiple instances with no additional scripts.
If the restart delay is not configured by default it will restart the instance immediately.
This can prevent updates from being applied and can result in the following errorWhisparr was restarted prematurely by external process.
Run with highest privileges
On Launch
5
or 10
minutesStart a Program
powershell
-File D:\WhisparrInstancesChecker.ps1
################################################################################################
### WhisparrInstancesChecker.ps1 ###
################################################################################################
### Keeps multiple Whisparr Instances up by checking the port ###
### Please use Whisparr´s Discord or Reddit for support! ###
### https://wiki.servarr.com/whisparr/installation#windows-multi ###
################################################################################################
### Version: 1.1 ###
### Updated: 2020-10-22 ###
### Author: reloxx13 ###
################################################################################################
### SET YOUR CONFIGURATION HERE ###
# Set your host ip and port correctly and use your service or scheduledtask names!
# (string) The type how Whisparr is starting
# "Service" (default) Service process is used
# "ScheduledTask" Task Scheduler is used
$startType = 'Service'
# (bool) Writes the log to C:\Users\YOURUSERNAME\log.txt when enabled
# $false (default)
# $true
$logToFile = $false
$instances = @(
[pscustomobject]@{ # Instance 1
Name = 'Whisparr-V3'; # (string) Service or Task name (default: Whisparr-V3)
IP = '192.168.178.12'; # (string) Server IP where Whisparr runs (default: 192.168.178.12)
Port = '7873'; # (string) Server Port where Whisparr runs (default: 7873)
}
[pscustomobject]@{ # Instance 2
Name = 'Whisparr-4K'; # (string) Service or Task name (default: Whisparr-4K)
IP = '192.168.178.12'; # (string) Server IP where Whisparr runs (default: 192.168.178.12)
Port = '7874'; # (string) Server Port where Whisparr runs (default: 7874)
}
# If needed you can add more instances here... by uncommenting out the below lines
# [pscustomobject]@{ # Instance 3
# Name='Whisparr-3D'; # (string) Service or Task name (default: Whisparr-3D)
# IP='192.168.178.12'; # (string) Server IP where Whisparr runs (default: 192.168.178.12)
# Port='7875'; # (string) Server Port where Whisparr runs (default: 7875)
# }
)
### DON'T CHANGE ANYTHING BELOW THIS LINE ###
###
# This function will write to a log file or in console output
###
function Write-Log
{
#Will write to C:\Users\YOURUSERNAME\log.txt
Param(
$Message,
$Path = "$env:USERPROFILE\log.txt"
)
function TS { Get-Date -Format 'hh:mm:ss' }
#Console output
Write-Output "[$(TS)]$Message"
#File Output
if ($logToFile)
{
"[$(TS)]$Message" | Tee-Object -FilePath $Path -Append | Write-Verbose
}
}
Write-Log 'START ====================='
$instances | ForEach-Object {
Write-Log "Check $($_.Name) $($_.IP):$($_.Port)"
$PortOpen = ( Test-NetConnection $_.IP -Port $_.Port -WarningAction SilentlyContinue ).TcpTestSucceeded
if (!$PortOpen)
{
Write-Log "Port $($_.Port) is closed, restart $($startType) $($_.Name)!"
if ($startType -eq 'Service')
{
Get-Service -Name $_.Name | Stop-Service
Get-Service -Name $_.Name | Start-Service
}
elseif ($startType -eq 'ScheduledTask')
{
Get-ScheduledTask -TaskName $_.Name | Stop-ScheduledTask
Get-ScheduledTask -TaskName $_.Name | Start-ScheduledTask
}
else
{
Write-Log '[ERROR] STARTTYPE UNKNOWN! USE Service or ScheduledTask !'
}
}
else
{
Write-Log "Port $($_.Port) is open!"
}
}
Write-Log 'END ====================='
-data=
argument passed.systemctl stop whisparr
Below is an example script to create a Whisparr4K instance. The below systemd creation script will use a data directory of
/var/lib/whisparr4k/
. Ensure the directory exists or modify it as needed.
cat << EOF | sudo tee /etc/systemd/system/whisparr4k.service > /dev/null
[Unit]
Description=Whisparr4k Daemon
After=syslog.target network.target
[Service]
User=whisparr
Group=media
Type=simple
ExecStart=/opt/Whisparr/Whisparr -nobrowser -data=/var/lib/whisparr4k/
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl -q daemon-reload
sudo systemctl enable --now -q whisparr4k