Hello Saeed,

For Baculum Web there is no special difference if it works with
Baculum API hosts which manage Bacula components that belong to
Director A or to Director B. The important thing for Baculum Web is to
be able to connect to API hosts. What functions do these API hosts
provide, it is a different story (and different level). If Baculum API
host A works with Director A, Baculum API host B works with Director
B, then when you switch Baculum Web to use API host A, you will see
resources from Director A, when you switch Baculum Web to use API host
B, you will see resources from Director B.

In practice it works in a way that API host A and API host B need to
have defined the Catalog and the Bconsole access as they work as main
hosts for Baculum Web. For rest "non-main" API hosts there is not this
requirement. Information about it is here:

https://baculum.app/doc/brief/configuration.html#installation-wizards

Yes, you are right that there is not special documentation for using
Baculum in multiple Director environment. General theory about how it
works is described in "Remote host management" chapter here:

https://baculum.app/doc/remote/basic.html

In YouTube channel you can also find a video titled "Baculum -
multiple API hosts" here:

https://www.youtube.com/watch?v=snjQw-3ZfVk

For Console settings, here are two movies that show setting Consoles
to use restricted user access for Basic auth and OAuth2:

Baculum Web - restricted user access using Console ACLs and API basic auth
https://www.youtube.com/watch?v=e6RbUmmD3As

Baculum Web - restricted user access using Console ACLs and OAuth2 client
https://www.youtube.com/watch?v=cvKtvZCvjLQ

I hope it helps.

Best regards,
Marcin Haba (gani)

On Mon, 17 Jan 2022 at 07:34, Saeed Green <greenfuture...@gmail.com> wrote:
>
> Thanks a lot Marcin ...
> .
> In the baculum there is a functionality to add more director and console !
> What are they? and how do they work? I did not find any documentation ( not 
> in pdfs nor in your youtube channel ) about it !
>
> On Mon, Jan 17, 2022 at 9:51 AM Marcin Haba <ganius...@gmail.com> wrote:
>>
>> Hello Saeed,
>>
>> Many thanks for your feedback and tests.
>>
>> It looks that the catalog autoselection forced by the restricted
>> console does not work with Bvfs bconsole commands. I don't have any
>> other workaround for this case except modifying command patterns in
>> API module Bconsole.php and/or using a wrapper for bconsole. But they
>> are not clear solutions. The best could be having support for multiple
>> catalogs with one Director in Baculum. This function can be added in
>> the future but unfortunately I can't tell exactly when.
>>
>> Best regards,
>> Marcin Haba (gani)
>>
>> On Sat, 15 Jan 2022 at 11:37, Saeed Green <greenfuture...@gmail.com> wrote:
>> >
>> > This is the output of : /api/v2/bvfs/lsdirs?jobids=4&path=&limit=8
>> >
>> > {
>> >   "output": [
>> >     ".bvfs_lsdirs jobid=\"4\" path=\"\" limit=\"8\"",
>> >     "You must specify a \"use <catalog-name>\" command before continuing.",
>> >     "Could not find a Catalog resource"
>> >   ],
>> >   "error": 0
>> > }
>> >
>> >
>> > On Sat, Jan 15, 2022 at 1:46 PM Saeed Green <greenfuture...@gmail.com> 
>> > wrote:
>> >>
>> >> something happened !!!
>> >> when I add ConsoleACL with Dedicated Bconsole file (and do what you say ) 
>> >> and execute bconsole command with it :
>> >>
>> >> bconsole -c clientconf.d/bconsole-dedicated-console.cfg
>> >>
>> >> It returns:
>> >> *restore
>> >> Automatically selected Catalog: MyCatalog2
>> >> Using Catalog "MyCatalog2"
>> >>
>> >> *gui on
>> >> *.bvfs_update jobid=4
>> >> *.bvfs_lsdirs jobid=4 path=""
>> >> 3       0       0       0       A A A A A A A A A A A A A A     .
>> >> 2       0       0       0       A A A A A A A A A A A A A A     C:/
>> >>
>> >> but in the baculum interface nothing happened! There is no Directory's 
>> >> list in the restore wizard  !!!
>> >>
>> >>
>> >> On Sat, Jan 15, 2022 at 12:12 PM Saeed Green <greenfuture...@gmail.com> 
>> >> wrote:
>> >>>
>> >>> Hi
>> >>>
>> >>> I Tested it. It bypasses auto selection of catalog but it sticks at 
>> >>> selecting catalog and stops there.
>> >>> .
>> >>> How can I define two Directors ! Each host has its Director ?!
>> >>> How can I do that?
>> >>>
>> >>> On Fri, Jan 14, 2022 at 9:10 AM Marcin Haba <ganius...@gmail.com> wrote:
>> >>>>
>> >>>> Hello Saeed,
>> >>>>
>> >>>> Thanks for providing more details.
>> >>>>
>> >>>> Baculum does not support multiple catalogs with one Director. The
>> >>>> selection that you can see:
>> >>>>
>> >>>> The defined Catalog resources are:
>> >>>>      1: MyCatalog1
>> >>>>      2: MyCatalog2
>> >>>>
>> >>>> Baculum is not able to answer because it does not know what catalog to
>> >>>> select. For catalog per director it works because catalog is
>> >>>> autoselected in this case.
>> >>>>
>> >>>> But I think that you can try a workaround that could work. If you
>> >>>> want, you can define two restricted Bacula Console resources: one with
>> >>>> CatalogACL = MyCatalog1 and one with CatalogACL = MyCatalog2. Rest
>> >>>> resources (JobACL, ClientACL...etc.) could have full access in
>> >>>> Consoles. Then you can prepare a bconsole.conf file for each host with
>> >>>> a dedicated configuration to connect to the first console on host1 and
>> >>>> to connect to the second console on host2. This way the Catalog
>> >>>> selection could be skipped.
>> >>>>
>> >>>> I didn't test the above configuration but I think it has a chance to
>> >>>> work. If you decide to try, I appreciate your feedback.
>> >>>>
>> >>>> Good luck.
>> >>>>
>> >>>> Best regards,
>> >>>> Marcin Haba (gani)
>> >>>>
>> >>>> On Thu, 13 Jan 2022 at 12:39, Saeed Green <greenfuture...@gmail.com> 
>> >>>> wrote:
>> >>>> >
>> >>>> > Thank you for your response.
>> >>>> > Environment :
>> >>>> > There is one Director which host 1 and host 2 connected to it. 
>> >>>> > bacula-server and bacula-client installed in host1 . baculum-web and 
>> >>>> > baculum-api installed in host1. PostgreSQL server installed in host1.
>> >>>> > bacula-client and baculum-api installed in host 2.
>> >>>> > host1 has its own Catalog (MyCatalog1) and host2 either has its own 
>> >>>> > Catalog(MyCatalog2). all Cataloges saved in PostgreSQL server in 
>> >>>> > host1.
>> >>>> > bconsole in host1 as well as bconsole in host2 both connected to the 
>> >>>> > same Director.
>> >>>> >
>> >>>> > I backed up my FileSet in host1 very well. as well I backed up my 
>> >>>> > FileSet in host2.
>> >>>> >
>> >>>> > results with bconsole:
>> >>>> > *restore
>> >>>> > The defined Catalog resources are:
>> >>>> >      1: MyCatalog1
>> >>>> >      2: MyCatalog2
>> >>>> > Select Catalog resource (1-2): 2
>> >>>> > Using Catalog "MyCatalog2"
>> >>>> >
>> >>>> > First you select one or more JobIds that contain files
>> >>>> > to be restored. You will be presented several methods
>> >>>> > of specifying the JobIds. Then you will be allowed to
>> >>>> > select which files from those JobIds are to be restored.
>> >>>> >
>> >>>> > To select the JobIds, you have the following choices:
>> >>>> >      1: List last 20 Jobs run
>> >>>> >      2: List Jobs where a given File is saved
>> >>>> >      3: Enter list of comma separated JobIds to select
>> >>>> > ........
>> >>>> > Select item:  (1-13): 2
>> >>>> > Automatically selected Client: win-11ijafgb35k-fd
>> >>>> > +-------+------------+---------------------+---------+-----------+----------+------------+
>> >>>> > | jobid | name       | starttime           | jobtype | jobstatus | 
>> >>>> > jobfiles | jobbytes   |
>> >>>> > +-------+------------+---------------------+---------+-----------+----------+------------+
>> >>>> > | 1     | C:/backup/ | 2022-01-12 18:48:03 | B       | T         | 28 
>> >>>> >       | 38988649   |
>> >>>> > +-------+------------+---------------------+---------+-----------+----------+------------+
>> >>>> > To select the JobIds, you have the following choices:
>> >>>> >      1: List last 20 Jobs run
>> >>>> >      2: List Jobs where a given File is saved
>> >>>> >      3: Enter list of comma separated JobIds to select
>> >>>> > ............
>> >>>> > Select item:  (1-13): 3
>> >>>> > Enter JobId(s), comma separated, to restore: 1
>> >>>> > You have selected the following JobId: 1
>> >>>> >
>> >>>> > Building directory tree for JobId(s) 1 ...
>> >>>> > 26 files inserted into the tree.
>> >>>> >
>> >>>> > You are now entering file selection mode where you add (mark) and
>> >>>> > remove (unmark) files to be restored. No files are initially added, 
>> >>>> > unless
>> >>>> > you used the "all" keyword on the command line.
>> >>>> > Enter "done" to leave this mode.
>> >>>> >
>> >>>> > cwd is: /
>> >>>> > $ ls
>> >>>> > C:/
>> >>>> >
>> >>>> > and results with My Catalog 1 :
>> >>>> > *restore
>> >>>> > The defined Catalog resources are:
>> >>>> >      1: MyCatalog1
>> >>>> >      2: MyCatalog2
>> >>>> > Select Catalog resource (1-2): 1
>> >>>> > Using Catalog "MyCatalog1"
>> >>>> >
>> >>>> > First you select one or more JobIds that contain files
>> >>>> > to be restored. You will be presented several methods
>> >>>> > of specifying the JobIds. Then you will be allowed to
>> >>>> > select which files from those JobIds are to be restored.
>> >>>> >
>> >>>> > To select the JobIds, you have the following choices:
>> >>>> >      1: List last 20 Jobs run
>> >>>> >      2: List Jobs where a given File is saved
>> >>>> >      3: Enter list of comma separated JobIds to select
>> >>>> > ........
>> >>>> > Select item:  (1-13): 1
>> >>>> > +-------+-----------------------+-------------------+---------------------+----------+----------+-----------+
>> >>>> > | jobid | client                | name              | starttime       
>> >>>> >     | joblevel | jobfiles | jobbytes  |
>> >>>> > +-------+-----------------------+-------------------+---------------------+----------+----------+-----------+
>> >>>> > | 5     | main-fd | BackupCatalog     | 2022-01-12 23:10:03 | F       
>> >>>> >  | 1        | 70094     |
>> >>>> > | 4     | main-fd | BackupMain1 | 2022-01-12 23:05:02 | I        | 0  
>> >>>> >       | 0         |
>> >>>> > | 3     | main-fd | BackupMain1 | 2022-01-12 17:34:09 | F        | 21 
>> >>>> >       | 9877691   |
>> >>>> > | 2     | main-fd | BackupCatalog     | 2022-01-12 17:32:09 | F       
>> >>>> >  | 1        | 55674     |
>> >>>> > +-------+-----------------------+-------------------+---------------------+----------+----------+-----------+
>> >>>> > To select the JobIds, you have the following choices:
>> >>>> >      1: List last 20 Jobs run
>> >>>> >      2: List Jobs where a given File is saved
>> >>>> >      3: Enter list of comma separated JobIds to select
>> >>>> > ........
>> >>>> > Select item:  (1-13): 3
>> >>>> > Enter JobId(s), comma separated, to restore: 5
>> >>>> > You have selected the following JobId: 5
>> >>>> >
>> >>>> > Building directory tree for JobId(s) 5 ...
>> >>>> > 1 files inserted into the tree.
>> >>>> >
>> >>>> > You are now entering file selection mode where you add (mark) and
>> >>>> > remove (unmark) files to be restored. No files are initially added, 
>> >>>> > unless
>> >>>> > you used the "all" keyword on the command line.
>> >>>> > Enter "done" to leave this mode.
>> >>>> >
>> >>>> > cwd is: /
>> >>>> > $ ls
>> >>>> > opt/
>> >>>> > :
>> >>>> > but for bvfs :
>> >>>> > *.bvfs_update
>> >>>> > *.bvfs_lsdir jobid=1 path=""
>> >>>> > 6       0       0       0       A A A A A A A A A A A A A A     .
>> >>>> > *.bvfs_lsdir jobid=5 path=""
>> >>>> > 6       0       0       0       A A A A A A A A A A A A A A     .
>> >>>> > 5       0       0       0       A A A A A A A A A A A A A A     /
>> >>>> >
>> >>>> > On Thu, Jan 13, 2022 at 9:39 AM Marcin Haba <ganius...@gmail.com> 
>> >>>> > wrote:
>> >>>> >>
>> >>>> >> Hello Saeed,
>> >>>> >>
>> >>>> >> Could you describe your Bacula environment? How do you use the two
>> >>>> >> Catalogs? Are they separated with their own Directors or you use one
>> >>>> >> Director?
>> >>>> >>
>> >>>> >> For the bvfs requests, it looks that for jobid=1 .bvfs_update command
>> >>>> >> has not been done or there are no file records for this job in the
>> >>>> >> catalog (pruned records or empty backup). For test I propose to do in
>> >>>> >> bconsole:
>> >>>> >>
>> >>>> >> .bvfs_update jobid=1
>> >>>> >> .bvfs_lsdirs jobid=1 path=""
>> >>>> >>
>> >>>> >> Is now something changed in the output?
>> >>>> >>
>> >>>> >> To see files in the catalog it might be useful to run:
>> >>>> >>
>> >>>> >> list files jobid=1
>> >>>> >>
>> >>>> >> Best regards,
>> >>>> >> Marcin Haba (gani)
>> >>>> >>
>> >>>> >> On Wed, 12 Jan 2022 at 18:08, Saeed Green <greenfuture...@gmail.com> 
>> >>>> >> wrote:
>> >>>> >> >
>> >>>> >> > Hello
>> >>>> >> >
>> >>>> >> > I installed bacula 11.0.5 with baculum 11.0.5.7
>> >>>> >> > I installed two baculum-api and connect it to two different catalog
>> >>>> >> > host1=baculum-api:9096 => MyCatalog1
>> >>>> >> > host2=baculum-api:9097 => MyCatalog2
>> >>>> >> >
>> >>>> >> > Everything is ok with the bconsole and I can restore my files with 
>> >>>> >> > it and even see the list of my files.
>> >>>> >> > but when I want to restore my files with baculum , host which 
>> >>>> >> > connected to MyCatalog1 can see its list of files and can restore 
>> >>>> >> > its files (which is main Catalog beside baculum-web)... host which 
>> >>>> >> > connected to MyCatalog2 cannot see its list of files and select 
>> >>>> >> > what he wants, and he just can restore all of his backup.
>> >>>> >> > .....
>> >>>> >> > output of " /api/v2/bvfs/lsdirs?jobids=1&path=&limit=8 " in host1
>> >>>> >> >
>> >>>> >> > {
>> >>>> >> >   "output": [
>> >>>> >> >     ".bvfs_lsdirs jobid=\"1\" path=\"\" limit=\"8\"",
>> >>>> >> >     "Using Catalog \"MyCatalog1\"",
>> >>>> >> >     "6\t0\t0\t0\tA A A A A A A A A A A A A A\t."
>> >>>> >> >   ],
>> >>>> >> >   "error": 0
>> >>>> >> > }
>> >>>> >> >
>> >>>> >> > output of " /api/v2/bvfs/lsdirs?jobids=1&path=&limit=8 " in host2
>> >>>> >> >
>> >>>> >> > {
>> >>>> >> >   "output": [
>> >>>> >> >     ".bvfs_lsdirs jobid=\"1\" path=\"\" limit=\"8\"",
>> >>>> >> >     "Using Catalog \"MyCatalog2\"",
>> >>>> >> >     "6\t0\t0\t0\tA A A A A A A A A A A A A A\t."
>> >>>> >> >   ],
>> >>>> >> >   "error": 0
>> >>>> >> > }
>> >>>> >> >
>> >>>> >> > Is it ok that the output of these two different hosts is the same?
>> >>>> >> >
>> >>>> >> > Am I missing something?!
>> >>>> >> >
>> >>>> >> > _______________________________________________
>> >>>> >> > Bacula-users mailing list
>> >>>> >> > Bacula-users@lists.sourceforge.net
>> >>>> >> > https://lists.sourceforge.net/lists/listinfo/bacula-users
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> --
>> >>>> >> "Greater love hath no man than this, that a man lay down his life for
>> >>>> >> his friends." Jesus Christ
>> >>>> >>
>> >>>> >> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
>> >>>> >> za przyjaciół swoich." Jezus Chrystus
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> "Greater love hath no man than this, that a man lay down his life for
>> >>>> his friends." Jesus Christ
>> >>>>
>> >>>> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
>> >>>> za przyjaciół swoich." Jezus Chrystus
>>
>>
>>
>> --
>> "Greater love hath no man than this, that a man lay down his life for
>> his friends." Jesus Christ
>>
>> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
>> za przyjaciół swoich." Jezus Chrystus



-- 
"Greater love hath no man than this, that a man lay down his life for
his friends." Jesus Christ

"Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
za przyjaciół swoich." Jezus Chrystus


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to