replicating bareos database and environment

41 views
Skip to first unread message

Markus Dubois

unread,
Jan 16, 2024, 10:17:28 AM1/16/24
to bareos-users
Hi,

i was thinking about a solution to replicate a remote running bareos environment to the local site.
Cause was to restore faster, as browsing the remote director and database is slow.

So i've setup a postgres hot standby stream replica, a bareos director, a web gui on the local site

but i failed as soon as i tried to connect the bconsole on the local site console of the (replicated) bareos-director.

i got:
Connecting to Director 127.0.0.1:9101
Failed to connect to Director. Giving up.

the bareos-director seems to run though....

    PID TTY      STAT   TIME COMMAND
      1 ?        Ss     0:00 /usr/sbin/bareos-dir -u bareos -f
     47 pts/0    Ss+    0:00 bash
     57 pts/1    Ss     0:00 bash
     67 pts/1    R+     0:00 ps -ax

Is this use case not possible or how could this be achieved?


Bruno Friedmann (bruno-at-bareos)

unread,
Jan 18, 2024, 9:53:47 AM1/18/24
to bareos-users
Unconventional setup I must admit. I presume you know that any write to the db will failed and as such it is 100% failing ....

A restore will need to create a temp table, so I'm not sure you are on the right path.
You may want to debug this by starting your director with bareos-dir -f -u bareos -g bareos -d250 
and observe the error ;-)

It may not be impossible to setup a pooler in front of the database that would redirect all write to the main instance and read on the replica, to be tested.

BTW, you mention that remote browsing and database is slow: this sound like
 
Mis(un)-configured database server : quite often people use the default of PostgreSQL which allow 131 MEGA Byte of shared memory, which force postgresql doing of lot of sorting, join, temp operation on disk instead of memory. The thumbs rule here is to allow 1/4 of the total ram, or try to have at least enough to put the bareos indexes on ram.
psql 
show shared_buffers
bareos-# ;
 shared_buffers
════════════════
 8GB
(1 row
)
With using the profile OTP in https://pgtune.leopard.in.ua/ you will get normally a quite reasonable configuration for your bareos database cluster.

Also if you use the webui, it is recommended to preload the bvfs_cache (see documentation), which also need a correctly configured database.

Markus Dubois

unread,
Jan 18, 2024, 10:28:12 AM1/18/24
to bareos-users
i'm a step further after enabling debugging. The slave was setup in read mode. Of course this isn't working
I'm now playijng around with a multi master write/write solution
in detail: from pdege inc called spock. We will see if that works....

Reply all
Reply to author
Forward
0 new messages