I hope it was worth all of the effort you put into it :-)

The issue with needing libs3-devel to build libs3 seems strange to me.
Moreover, wouldn't installing libs3-devel also install the EPEL libs3?

The error when running the s3 binary looks like it expects to find libs3 in
the shared library cache or in the standard places (see man ld.so).

__Martin


>>>>> On Mon, 16 Oct 2023 18:18:28 +0000, Levi Wilbert said:
> 
> Thanks for this. I got it figured out!
> 
> I was able to patch the Bacula libs3 bucket_multipath.c file w/ the 
> libs3-openssl3.patch from the EPEL libs3 RPM.
> 
> Bacula built ok, however, after installing, attempting to run the s3 command 
> still lead to:
> 
> [root@bacula-dev software]# s3
> s3: error while loading shared libraries: libs3.so.4: cannot open shared 
> object file: No such file or directory
> 
> After chasing some red herrings, and going through some troubleshooting, I 
> was able to get Bacula working w/ our S3 storage.
> 
> First, I discovered a few issues:
> 
> 1). I had not built Bacula w/ the "--with-s3" option pointing to the 
> directory where the library was installed (/usr/local/).
> 2). To build libs3 you need the libs3-devel package installed
> 2). I had not included the correct Bacula plugin folder in my bacula-sd. 
> Bacula has its own plugin folder, so I fixed w/ by updating the Plugin 
> Directory specification in bacula-sd.conf:
> 
> Storage {                             # definition of myself
>   Name = bacula-dev-sd
>   SDPort = 9103                  # Director's port
>   WorkingDirectory = "/usr/local/bacula/working"
>   Pid Directory = "/usr/local/bacula/working"
>   Heartbeat Interval = 60
>   Plugin Directory = "/usr/local/bacula/lib/"
> }
> 
> So, the process that worked for me was:
> 
> Download Bacula libs3 plugin:
> wget https://www.bacula.org/downloads/libs3-20200523.tar.gz tar zxvf 
> libs3-20200523.tar.gz
> 
> Patch w/ libs3-openssl3.patch
> cd libs3-20200523/src/
> patch -p1 bucket_metadata.c <path/to/libs3-openssl3.patch>
> 
> Install libs3-devel package
> dnf install libs3-devel
> 
> Build libs3:
> cd ../
> make clean
> make distclean
> make install
> 
> Rebuild Bacula including the ./configure option --with-s3="/usr/lib/"
> cd bacula-13.0.3
> make clean
> make distclean
> ./configure <options> --with-s3="/usr/lib/"
> make
> make install
> 
> Build the Bacula cloud plugin:
> cd bacula-13.0.3/src/stored/
> make install-cloud
> 
> 
> Configure Cloud and Device in bacula-sd.conf:
> Device {
>   Name = cloud_device
>   Device Type = Cloud
>   Cloud = CLOUD         # references "Cloud{}" object name
>   Archive Device = /backups/CLOUD
>   Maximum Part Size = 500 MB
>   Media Type = CloudType
>   LabelMedia = yes
>   Random Access = Yes;
>   AutomaticMount = yes
>   RemovableMedia = no
>   AlwaysOpen = no
>   Enabled = yes
> }
> 
> Cloud {
>   Name = CLOUD
>   Driver = "S3"
>   Host Name = "<s3-hostname>"
>   Bucket Name = "<bucket-name>"
>   Access Key = "<access-key"
>   Secret Key = "<secret-key"
>   Protocol = HTTPS
>   UriStyle = Path # Must be set for CEPH
> # Truncate Cache = AtEndOfJob
>   Truncate Cache = AfterUpload
>   Upload = EachPart
> }
> 
> Configure Storage, Pool, and Job in bacula-dir.conf to use the cloud device 
> (follows standard format)
> 
> Restart bacula
> 
> Run the configured job.
> 
> 
> 
> bconsole now shows the following in "stat dir":
> Device Cloud (S3 Plugin): "CLOUD" (/backups/CLOUD) is not open.
>    Available Cache Space=264.6 GB
> 
> In the configured device "Archive Device", Bacula will store the backup taken 
> before uploading it to the cloud.
> 
> I actually wonder if I even need to build the libs3 plugin from Bacula, and 
> if I can just install libs3 and libs3-devel, build Bacula and call it a day, 
> but I haven't tested this yet. The above procedure works for me, however.
> 
> Now the only thing I'm working out is how to manage the local storage that is 
> used when taking cloud backups (I believe this is the "cache"). I'm toying 
> with the cache options to see how I can automatically free up this space, as 
> this could easily take up quite a bit of space if you're handling backups 
> from more than a couple machines. But, the cloud plugin is working, so all is 
> good.
> 
> 
> 
> 
> Levi Wilbert
> HPC & Linux Systems Administrator
> ARCC - Division of Research and Economic Development
> Information Technology Ctr 226
> 1000 E. University Avenue, Laramie, WY 82071-200
> 
> 
> 
> 
> ________________________________
> From: Martin Simmons <mar...@lispworks.com>
> Sent: Tuesday, October 10, 2023 9:54 AM
> To: Levi Wilbert <lwilb...@uwyo.edu>
> Cc: bacula-users@lists.sourceforge.net <bacula-users@lists.sourceforge.net>
> Subject: Re: [Bacula-users] Ceph S3 support in Bacula Community 13.0.3
> 
> It look like Bacula's libs3 doesn't support OpenSSL 3.0.  However, you could
> try applying the patch (attached) from the src.rpm of the EPEL9 libs3.
> 
> cd libs3-20200523
> patch -p1 < ...path..to..libs3-openssl3.patch...
> 
> I think the Bacula provided libs3 contains changes that are not in the 4.1
> version from EPEL (it contains the source at https://github.com/bji/libs3,
> where the last change is from Apr 9, 2019, but I assume the Bacula provided
> one is from May 23, 2020, based on the file name).
> 
> __Martin
> 
> 
>>>>> On Mon, 9 Oct 2023 17:21:35 +0000, Levi Wilbert said:
> >
> > Thanks for the reply, it seems the "make clean" was what was holding it up.
> >
> > Now it seems I've run into another error after running make install (after 
> > a make clean):
> >
> > build/obj/bucket.do: Compiling dynamic object
> > build/obj/bucket_metadata.do: Compiling dynamic object
> > src/bucket_metadata.c: In function ‘generate_content_md5’:
> > src/bucket_metadata.c:489:5: error: ‘MD5_Init’ is deprecated: Since OpenSSL 
> > 3.0 [-Werror=deprecated-declarations]
> >   489 |     MD5_Init(&mdContext);
> >       |     ^~~~~~~~
> > In file included from src/bucket_metadata.c:31:
> > /usr/include/openssl/md5.h:49:27: note: declared here
> >    49 | OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
> >       |                           ^~~~~~~~
> > src/bucket_metadata.c:490:5: error: ‘MD5_Update’ is deprecated: Since 
> > OpenSSL 3.0 [-Werror=deprecated-declarations]
> >   490 |     MD5_Update(&mdContext, data, size);
> >       |     ^~~~~~~~~~
> > In file included from src/bucket_metadata.c:31:
> > /usr/include/openssl/md5.h:50:27: note: declared here
> >    50 | OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, 
> > size_t len);
> >       |                           ^~~~~~~~~~
> > src/bucket_metadata.c:491:5: error: ‘MD5_Final’ is deprecated: Since 
> > OpenSSL 3.0 [-Werror=deprecated-declarations]
> >   491 |     MD5_Final((unsigned char*)md5Buffer, &mdContext);
> >       |     ^~~~~~~~~
> > In file included from src/bucket_metadata.c:31:
> > /usr/include/openssl/md5.h:51:27: note: declared here
> >    51 | OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
> >       |                           ^~~~~~~~~
> > cc1: all warnings being treated as errors
> > make: *** [GNUmakefile:227: build/obj/bucket_metadata.do] Error 1
> >
> >
> >
> > I'm wondering however, if the plugin is really the issue I'm running into. 
> > I was able to install libs3 4.1 from EPEL, which I've downloaded and am 
> > able to use with our Ceph object storage running the commands manually (s3 
> > list, s3 get <bucket/file>.
> >
> > Is the Bacula provided driver different than the EPEL libs3?
> >
> >
> > Levi Wilbert
> > HPC & Linux Systems Administrator
> > ARCC - Division of Research and Economic Development
> > Information Technology Ctr 226
> > 1000 E. University Avenue, Laramie, WY 82071-200
> >
> >
> >
> >
> > ________________________________
> > From: Martin Simmons <mar...@lispworks.com>
> > Sent: Monday, October 9, 2023 10:44 AM
> > To: Levi Wilbert <lwilb...@uwyo.edu>
> > Cc: bacula-users@lists.sourceforge.net <bacula-users@lists.sourceforge.net>
> > Subject: Re: [Bacula-users] Ceph S3 support in Bacula Community 13.0.3
> >
> > Firstly, you also need to install whatever provides xml2-config (the libxml2
> > development libraries).
> >
> > Then try running make clean before make install (or just make).  That should
> > remake the dependency files to find your curl/curl.h.
> >
> > __Martin
> >
> >
>>>>> On Mon, 9 Oct 2023 14:30:33 +0000, Levi Wilbert said:
> > >
> > > BUMP
> > >
> > > Anyone have any guidance on this?
> > >
> > > Levi Wilbert
> > > HPC & Linux Systems Administrator
> > > ARCC - Division of Research and Economic Development
> > > Information Technology Ctr 226
> > > 1000 E. University Avenue, Laramie, WY 82071-200
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: Levi Wilbert <lwilb...@uwyo.edu>
> > > Sent: Monday, October 2, 2023 4:43 PM
> > > To: bacula-users@lists.sourceforge.net 
> > > <bacula-users@lists.sourceforge.net>
> > > Subject: [Bacula-users] Ceph S3 support in Bacula Community 13.0.3
> > >
> > >
> > > ◆ This message was sent from a non-UWYO address. Please exercise caution 
> > > when clicking links or opening attachments from external sources.
> > >
> > > I'm running Bacula Community 13.0.3 in RHEL9, and having trouble getting 
> > > the s3 plugin working w/ Ceph.
> > >
> > > I've done a bit of reading in the docs, and have been finding info 
> > > conflicting/confusing info that S3 Ceph may not be supported under 
> > > Community?
> > >
> > > On this page (for Bacula 11: 
> > > https://www.bacula.org/bacula-release-11-0-3/), it says to download and 
> > > compile the Cloud driver from here: 
> > > https://www.bacula.org/downloads/libs3-20200523.tar.gz
> > >
> > > I downloaded this file, and untar'd it to a local folder.
> > >
> > > When I attempt to build it w/ "rpmbuild -ta libs3-20200523.tar.gz", I get:
> > > [root@bacula-dev libs3-20200523]# rpmbuild -ta libs3-20200523.tar.gz
> > > error: Bad source: /root/software/libs3-20200523/libs3-trunk.tar.gz: No 
> > > such file or directory
> > >
> > > When I try it w/ "make install" I get:
> > > [root@bacula-dev libs3-20200523]# make install
> > > make: xml2-config: No such file or directory
> > > make: xml2-config: No such file or directory
> > > make: *** No rule to make target 'curl/curl.h', needed by 
> > > 'build/obj/bucket.do'.  Stop.
> > >
> > > I have libcurl-devel installed, and curl.h is on the system in 
> > > /usr/include/curl/curl.h.
> > >
> > > I can use our Ceph S3 storage just fine using rclone, so there are system 
> > > drivers present, however, I've attempted configuring the cloud storage in 
> > > bacula-sd.conf:
> > >
> > > # Pathfinder S3 - DEV
> > > Device {
> > >   Name = pathfinder_device
> > >   Device Type = Cloud
> > >   Cloud = PF_S3         # references "Cloud{}" object name
> > >   Archive Device = /backups/PF_S3
> > >   Maximum Part Size = 500 MB
> > >   Media Type = CloudType
> > >   LabelMedia = yes
> > >   Random Access = Yes
> > >   AutomaticMount = yes
> > >   RemovableMedia = no
> > >   AlwaysOpen = no
> > > }
> > >
> > > Cloud {
> > >   Name = PF_S3
> > >   Driver = "S3"
> > >   Host Name = pathfinder.arcc.uwyo.edu
> > >   Bucket Name = "<my-bucket>"
> > >   Access Key = "<access-key>"
> > >   Secret Key = "<secret-key>"
> > >   Protocol = HTTPS
> > >   Upload = EachPart
> > >   UriStyle = Path # Must be set for CEPH
> > > }
> > >
> > > After restarting Bacula w/ this config, I try running listing the cloud 
> > > volumes in the cloud w/ this cloud storage, but I get the following error:
> > > 3900 Error reserving device pathfinder_device cloud
> > >
> > >
> > > The documentation I've read thus far hasn't been incredibly clear, as far 
> > > as whether Ceph S3 is supported or not in the community edition, or if 
> > > this is something that can be added to an installation.
> > >
> > > In any case, I'm unable to get our Ceph system hooked up to this server 
> > > in Bacula! Can anyone provide any insight on what's wrong?
> > >
> > > Thank you.
> > >
> > > Bacula Release 11.0.3 | 
> > > Bacula<https://www.bacula.org/bacula-release-11-0-3/>
> > > We are pleased to announce the release of Bacula version 11.0.3 to both 
> > > the Bacula website 
> > > ([http://www.bacula.org<http://www.bacula.org]www.bacula.org<http://www.bacula.org>)
> > >  and to SourceForge. Thank you for using
> > > www.bacula.org<http://www.bacula.org>
> > >
> > >
> > > Levi Wilbert
> > > HPC & Linux Systems Administrator
> > > ARCC - Division of Research and Economic Development
> > > Information Technology Ctr 226
> > > 1000 E. University Avenue, Laramie, WY 82071-200
> > >
> > >
> > >
> > >
> >
> 


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

Reply via email to