"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-20.0.3/core/README.glusterfs" (14 Sep 2021, 5049 Bytes) of package /linux/misc/bareos-Release-20.0.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 Integrating GlusterFS and BAREOS.
    2 
    3 The gluster integration uses so called URIs that are mostly analog to the
    4 way you specify gluster volumes in for example qemu.
    5 
    6 Syntax:
    7 
    8 gluster[+transport]://[server[:port]]/volname[/dir][?socket=...]
    9 
   10 'gluster' is the protocol.
   11 
   12 'transport' specifies the transport type used to connect to gluster
   13 management daemon (glusterd). Valid transport types are tcp, unix
   14 and rdma. If a transport type isn't specified, then tcp type is assumed.
   15 
   16 'server' specifies the server where the volume file specification for
   17 the given volume resides. This can be either hostname, ipv4 address
   18 or ipv6 address. ipv6 address needs to be within square brackets [ ].
   19 If transport type is 'unix', then 'server' field should not be specifed.
   20 The 'socket' field needs to be populated with the path to unix domain
   21 socket.
   22 
   23 'port' is the port number on which glusterd is listening. This is optional
   24 and if not specified, QEMU will send 0 which will make gluster to use the
   25 default port. If the transport type is unix, then 'port' should not be
   26 specified.
   27 
   28 'volname' is the name of the gluster volume which contains the data that
   29 we need to be backup.
   30 
   31 'dir' is an optional base directory on the 'volname'
   32 
   33 Examples:
   34 
   35 gluster://1.2.3.4/testvol[/dir]
   36 gluster+tcp://1.2.3.4/testvol[/dir]
   37 gluster+tcp://1.2.3.4:24007/testvol[/dir]
   38 gluster+tcp://[1:2:3:4:5:6:7:8]/testvol[/dir]
   39 gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol[/dir]
   40 gluster+tcp://server.domain.com:24007/testvol[/dir]
   41 gluster+unix:///testvol[/dir]?socket=/tmp/glusterd.socket
   42 gluster+rdma://1.2.3.4:24007/testvol[/dir]
   43 
   44 - Using glusterfs as backingstore for backups
   45 
   46   For this you need to install the storage-glusterfs package which contains
   47   the libbareossd-gfapi.so shared object which implements a dynamic loaded
   48   storage backend.
   49 
   50   - bareos-sd.conf
   51 
   52   Device {
   53     Name = GlusterStorage
   54     Device Type = gfapi
   55     Media Type = GlusterFile
   56     Archive Device = <some description>
   57     Device Options = "uri=gluster://<volume_spec>"
   58     LabelMedia = yes
   59     Random Access = Yes
   60     AutomaticMount = yes
   61     RemovableMedia = no
   62     AlwaysOpen = no
   63   }
   64 
   65   - bareos-dir.conf
   66 
   67   Storage {
   68     Name = Gluster
   69     Address = <sd-hostname>
   70     Password = "<password>"
   71     Device = GlusterStorage
   72     Media Type = GlusterFile
   73     Maximum Concurrent Jobs = 10
   74   }
   75 
   76   In the above GlusterFile is a sample MediaType if you use multiple Gluster storage
   77   devices in one storage daemon make sure you use different Media Types for each
   78   storage as the same Media Type means BAREOS thinks it can swap volumes between
   79   different storages which is probably not going to work if you point to different
   80   locations on your Gluster volume(s).
   81 
   82 - Backing up data on a Gluster Volume
   83 
   84   For this you need to install the filedaemon-glusterfs-plugin package which contains
   85   the gfapi-fd.so shared object which implements a dynamic loaded filed plugin.
   86 
   87   For backing up Gluster the gfapi-fd.so implements two types of backups one in which
   88   it will crawl the filesystem itself and one where it uses glusterfind to create a
   89   list of files to backup. The glusterfind script is new since Gluster 3.7 so you need
   90   a version that includes it to be able to use it.
   91 
   92   A backup made using the gfapi-fd.so needs a Job and Fileset definition. For the local
   93   crawling example this would look somewhat like this:
   94 
   95   Job {
   96     Name = "gfapitest"
   97     JobDefs = "DefaultJob"
   98     FileSet = "GFAPI"
   99   }
  100 
  101   FileSet {
  102     Name = "GFAPI"
  103     Include {
  104       Options {
  105         aclsupport = yes
  106         xattrsupport = yes
  107         signature = MD5
  108       }
  109       Plugin = "gfapi:volume=gluster\\://<volume_spec>:"
  110     }
  111   }
  112 
  113   When you want to use glusterfind you should start by reading the documentation on glusterfind
  114   and the setup it needs before configuring things in BAREOS. You need to create at least a new
  115   session for glusterfind that you are going to use for backing up the gluster volume. There is
  116   a wrapper named bareos-glusterfind-wrapper which is used in the pre and post definition of a
  117   backup Job to interact with glusterfind.
  118 
  119   For a backup with glusterfind the FileSet and Job will look a little different then the one
  120   above as you need to interact with glusterfind to get the actual filelist that the backup should use.
  121 
  122   Job {
  123     Name = "gfapitest"
  124     JobDefs = "DefaultJob"
  125     FileSet = "GFAPI"
  126     RunScript {
  127       Runs On Client = Yes
  128       RunsWhen = Before
  129       FailJobOnError = Yes
  130       Command = "<bareos_script_dir>/bareos-glusterfind-wrapper -l %l -s %m prebackup <volume_name> <output_file>"
  131     }
  132     RunScript {
  133       Runs On Success = Yes
  134       RunsOnFailure = Yes
  135       Runs On Client = Yes
  136       RunsWhen = After
  137       Command = "<bareos_script_dir>/bareos-glusterfind-wrapper postbackup <volume_name> <output_file>"
  138     }
  139   }
  140 
  141   FileSet {
  142     Name = "GFAPI"
  143     Include {
  144       Options {
  145         aclsupport = yes
  146         xattrsupport = yes
  147         signature = MD5
  148       }
  149       Plugin = "gfapi:volume=gluster\\://<volume_spec>:gffilelist=<output_file>"
  150     }
  151   }