postgres plugin

170 views
Skip to first unread message

Bernard Tremblay

unread,
Jan 13, 2015, 11:56:47 AM1/13/15
to bareos...@googlegroups.com
Anybody here using contrib-pgsql-plugin and willing to share configuration info ?

I'm trying to setup the config to try the plugin on a test DB but I'm having hard time making the configuration file.

I have compiled the plugin, created the plugin catalog DB, but now I'm scratching the back of my head in front of the lack of documentation for this plugin.

Note that I'm quite noob with bareos too wich add to the overall picture.

Any help would appreciated.

Regards,
Bernard.

igorkow...@gmail.com

unread,
Jan 14, 2015, 8:19:57 AM1/14/15
to bareos...@googlegroups.com
W dniu wtorek, 13 stycznia 2015 17:56:47 UTC+1 użytkownik Bernard Tremblay napisał:
> Anybody here using contrib-pgsql-plugin and willing to share configuration info ?
>
> I'm trying to setup the config to try the plugin on a test DB but I'm having hard time making the configuration file.
>
> I have compiled the plugin, created the plugin catalog DB, but now I'm scratching the back of my head in front of the lack of documentation for this plugin.
>
> Note that I'm quite noob with bareos too wich add to the overall picture.
>

I've replied to your message on bareos-devel group.

You can check below one of my test configs:

#
# Config file for pgsql plugin
#
# Where Postgresql data directory is located (pg_cluster)
# Plugin will backup this cluster including all defined tablespaces
PGDATA = /pgqdata/testosteron2/PostgreSQL/9.2/data
# Where Postgresql socket directory is located
PGHOST = /tmp
# What Postgresql "port" is defined
PGPORT = 5432
# Database name for catalog database
CATDB = catbac
# Host location for catalog database
CATDBHOST = 10.80.7.11
# Port location for catalog database
CATDBPORT = 5432
# Catalog database user to connect to
CATUSER = pgsql
# Catalog database User's password
CATPASSWD = password
# Destination for archived wal files. It is a temporary location before
# we archive on backup system.
ARCHDEST = /pgqdata/backup
# Name of archiving client. Name should be unique on every catalog
# database. It could be a server name, service name, or other unique
# string. You cannot use ':' char in archclient name. This is
# simultaneously a name of console resource required for database
# restoration.
ARCHCLIENT = testosteronprd
# Bacula Director name used for console resource
DIRNAME = catbac-dir
# Bacula Director host location used for console resource
DIRHOST = 10.80.7.11
# Bacula Director port location used for console resource
DIRPORT = 9101
# Console resource password
DIRPASSWD = restorepassword

Bernard Tremblay

unread,
Jan 14, 2015, 10:12:39 AM1/14/15
to bareos...@googlegroups.com
100 000 000 000 Thanks!

This help a lot, I will try to sort it out to make my own config files.

Bernard Tremblay

unread,
Jan 19, 2015, 3:51:43 PM1/19/15
to bareos...@googlegroups.com
Hi,

Could you tell me exactly what database will be backup'ed in your sample config ?

I understant there is a catalog database catbac on 10.80.7.11 and there seems to be a client called "testosteronprd". Does it backup all postgresql database on testosteronprd ? Can you backup only one database ?

To my understanding, the backup catalog is the postgresql equivalent of the catalog for the director and regular files.

In fact, it is not very clear in the documentation how the configuration of the plugin is structured.

Once we have the pgsql.conf done, how do wee add a client with one DB to backup ??? Do we add a fileset, a job and a schedule ?

As you can see I'm quite a noob in bareos and postgresql. But, may be it could be an opportunity to clarify the documentation ?

Regards,
Bernard





Francesco Suavuro

unread,
Jan 23, 2015, 9:39:53 AM1/23/15
to bareos...@googlegroups.com
Hello,

On Monday, January 19, 2015 at 9:51:43 PM UTC+1, Bernard Tremblay wrote:
>
> Could you tell me exactly what database will be backup'ed in your sample config ?

As I understand plugin will backup a whole PostgreSQL instance and all database files. Check what Point-In-Time-Recovery is for and how it works: http://www.postgresql.org/docs/9.0/static/continuous-archiving.html

>
> I understant there is a catalog database catbac on 10.80.7.11 and there seems to be a client called "testosteronprd". Does it backup all postgresql database on testosteronprd ? Can you backup only one database ?

What do you mean by postgresql database? What is a postgresql database in your dictionary?

When you install a PostgreSQL cluster (using for example initdb utility) and you start your instance on that cluster you can find it consist of a number of databases. You can create any number of new databases in your cluster with createdb utility.

I'm asking because I met with different meanings, i.e. some admins use a word "database" in the mean of the a cluster.

With PITR you have to backup and restore a whole database cluster, not a single database. It is a PostgreSQL feature and not limitation of the plugin. Sure, if you have a single database in you cluster you will backup and restore a single database.

The most important benefits of the PITR are:
- you can recover your database to any commited transaction
- your backup and especially restore could be faster then backup with pg_dump utility

>
> To my understanding, the backup catalog is the postgresql equivalent of the catalog for the director and regular files.

Yes.

>
> Once we have the pgsql.conf done, how do wee add a client with one DB to backup ??? Do we add a fileset, a job and a schedule ?

You need two jobs for every PostgreSQL cluster: one for online backup of database files with dedicated fileset, second for archive logs with another dedicated fileset.
Check: https://github.com/inteos/pgsql-plugin/wiki/FileSet-configuration

For example: You have a three separate servers every with its own one PostgreSQL cluster installed. Call it Pixie, Dixie and Sam.
You need to define (copy/paste if you are a very lazy men) two filesets call it: FileSetPostgreSQLDBSet01, FileSetPostgreSQLArchSet01 as they are defined in above wiki page.
Then as for every Bareos backup Job you need a schedule and client definitions, easy. Next you need to define a 6 backup jobs - two (db and logs) for every database cluster, i.e:
Pixie: Pixie-PGSQL-DB-JOB, Pixie-PGSQL-ARCH-JOB
Dixie: Dixie-PGSQL-DB-JOB, Dixie-PGSQL-ARCH-JOB
Sam: Sam-PGSQL-DB-JOB, Sam-PGSQL-ARCH-JOB
You need a three pgsql.conf files, one for every database cluster.

>
> As you can see I'm quite a noob in bareos and postgresql. But, may be it could be an opportunity to clarify the documentation ?
>

First you should understand a what PITR for PostgreSQL is. Check a link above for continous archiving.

Bernard Tremblay

unread,
Jan 23, 2015, 12:03:55 PM1/23/15
to Francesco Suavuro, bareos...@googlegroups.com
Thanks for clarifications,

I just found out that I need a separate pgsql.conf for each cluster that you want to backup.  That part was really not clear in my mind even if I read the plugin documentation many times.
I have read about backups on the postgresql.org site and starting to learn about it.  Thanks for the links about the PITR. Now I understand the differences between a cluster and a database.

I had compiled the plugin from the git and the bareos version installed was 14.2.  The git is at 14.4 now, thus my plugin would not work with 14.2.  
So I had to search a bit to find the correct version of the source of 14.2, but I got it now.  And since the bareos installed was from a ubuntu/debian package, I had to found out the correct configuration to compile bareos since the plugin need files from bareos to be able to compile.  There is a "debian" directory in the git but not on the download site (http://download.bareos.org/bareos/release/14.2/xUbuntu_14.04/), there is a "rules" files that gives all the config defaults used to compile the .deb.  So I managed to compile with same options for Bareos and contrib-

Right now I'm struggling to correct a permission problem on /etc brought by the compilation of bareos.  The permissions of /etc were changed and I cannot go in sudo anymore since my user cannot read /etc/sudoers anymore...   The machine I'm using is on a cloud, so I have to find out how to boot it from a live cd or an image of a live cd.

But I'm out of the subject.  I think I have now a good configuration to backup a test cluster.  I only have to get rid of those annoyances before I succeed!

Thanks again for your help, it is appreciated,

              Bernard



--
You received this message because you are subscribed to a topic in the Google Groups "bareos-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bareos-users/6xygN5m9GIs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bareos-users...@googlegroups.com.
To post to this group, send email to bareos...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
---------------------------------------------
Bernard Tremblay
Tremblay...@gmail.com
(418) 658-1411
---------------------------------------------
Le but de Linux est de gérer vos ressources et faire le travail, 
le but des OS propriétaire est de vous vendre d'autres licences...
Portae Tenebrosus Abiciantur, Infinitio!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages