Changing default ports

121 views
Skip to first unread message

Roman Starun

unread,
Aug 4, 2019, 4:18:28 AM8/4/19
to bareos-users
Hello.

Several Bareos servers under one WAN IP. Backups from internet

I need to publish two Bareos boxes (two DIRs, two SDs) on the same ip. All clients are in different locations and backed up over the internet. Bareos DIR and SD are behind NAT. 9101-9103 ports are mapped on router to one of the Bareos boxes (server installations).
Thing is, i have to switch redirected ports to first Bareos server or to second manually. What's the point of automatic backups if i need to switch router rules manually? :)

So i'm trying to change dir and sd listening ports to non default. Lets say 8101, 8103. 

Here is working SD config:
Storage {
  Name = bareos-sd
  Maximum Concurrent Jobs = 5
  Heartbeat Interval = 60
  SDport = 9103
}

But as soon as i change SDport to 8103, SD does not start. 
Bareos ver 18.2.5, Centos 7.

Spadajspadaj

unread,
Aug 4, 2019, 1:11:39 PM8/4/19
to bareos...@googlegroups.com
On 04.08.2019 10:18, Roman Starun wrote:}
> But as soon as i change SDport to 8103, SD does not start.
> Bareos ver 18.2.5, Centos 7.


Since you're using CentOS, there is a big chance that you have SELinux
enabled. So SELinux is preventing a bind to non-labeled port. You have
to label port 8103 with bacula_port_t type.

Roman Starun

unread,
Aug 4, 2019, 1:53:39 PM8/4/19
to bareos-users
SELinux is disabled. i'll try to create new installation on Ubuntu to check if helps

воскресенье, 4 августа 2019 г., 20:11:39 UTC+3 пользователь Spadajspadaj написал:

Roman Starun

unread,
Aug 6, 2019, 5:20:32 PM8/6/19
to bareos-users

Installed fresh Ubuntu server 18.04 LTS and latest bareos build. Everything is the same. Service status - stopped as soon as i change ports in cfg and start/stop service.

bareos-director.service: Can't open PID file /var/lib/bareos/bareos-dir.9101.pid (yet?) after start: No such file or dir



воскресенье, 4 августа 2019 г., 20:11:39 UTC+3 пользователь Spadajspadaj написал:
On 04.08.2019 10:18, Roman Starun wrote:}

Roman Starun

unread,
Aug 6, 2019, 5:41:47 PM8/6/19
to bareos-users
Ok, i've found solution.

/etc/systemd/system/@bareos-dir.service
contains line:
PIDFile=/var/lib/bareos/bareos-dir.9101.pid

While service creates pid file name based on DIR port = xxx configuration.
Just changed @bareos-dir.service manually and rebooted. Problem solved.

среда, 7 августа 2019 г., 0:20:32 UTC+3 пользователь Roman Starun написал:

Andreas Rogge

unread,
Aug 19, 2019, 4:46:55 AM8/19/19
to bareos...@googlegroups.com
Am 04.08.19 um 10:18 schrieb Roman Starun:
> But as soon as i change SDport to 8103, SD does not start. 
> Bareos ver 18.2.5, Centos 7.

That problem is known. The systemd unit file hardcodes the PID-file name
and that filename contains the port-number. So changing the port-number
leads to a different PID-file which leads to systemd not finding that
PID-file.
Workaround: edit the systemd unit to look for the filename with the
changed portnumber in the name.

Best Regards,
Andreas

--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: S. Dühr, M. Außendorf, J. Steffens, Philipp Storz

signature.asc
Reply all
Reply to author
Forward
0 new messages