Connection Parameters
EnterpriseBacula Enterprise Only
This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.
The plugin supports two connection styles:
URI mode, using
uriStructured mode, using
hostplus optional authentication, replica-set, and TLS parameters.
Use URI mode for simple configurations. Use structured mode when passwords, TLS files, or BWeb-generated forms should be kept as separate parameters.
Parameter Reference
Option |
Required |
Default |
Values |
Example |
Description |
|---|---|---|---|---|---|
|
Yes* |
MongoDB connection string |
|
Complete MongoDB URI. Do not combine with structured connection options such as |
|
|
Yes* |
|
|
MongoDB host or seed host. Repeat for replica-set seeds. |
|
|
No |
String |
|
MongoDB username. Required when password-based authentication is used. |
|
|
No |
String |
|
MongoDB password. Prefer |
|
|
No |
Path |
|
File containing the MongoDB password. |
|
|
No |
Environment variable name |
|
Environment variable containing the MongoDB password. |
|
|
No |
|
Database name |
|
Authentication database. Use |
|
No |
Driver default |
|
|
Authentication mechanism passed to the MongoDB driver and tools. |
|
No |
Replica-set name |
|
Expected replica-set name. |
|
|
No |
|
|
|
Force direct connection to one MongoDB node. Useful in controlled test environments. |
|
No |
|
|
|
Enable TLS. |
|
No |
Path |
|
PEM file containing trusted CA certificates. |
|
|
No |
Path |
|
PEM file containing client certificate chain and unencrypted private key. |
|
|
No |
|
|
|
Allow TLS hostname mismatch. Use only in controlled labs or temporary migrations. |
A connection definition is required for Bacula backup, restore, LIST, and QUERY
operations. Use either uri or structured connection parameters. When
structured parameters are used, at least one host value is required.
Use only one password source: password, password_file, or
password_env.
Connection Rules by Scenario
Use the following combinations as the baseline for each deployment type:
Standalone mongod (no replica set): use URI mode (
uri=...) or structured mode with onehost. Do not setreplica_set. Keepdirect_connection=nounless you explicitly need direct node binding.Replica set (recommended): use URI with multiple seeds or structured mode with multiple
hostentries plusreplica_set=<name>. Keepdirect_connection=noso MongoDB driver discovery can route operations to the writable primary.Replica set (forced single node): use
direct_connection=yesonly for controlled scenarios (for example diagnostics). For backup/restore operations, this node must be writable primary, otherwise operations can fail by design.Sharded cluster through mongos: connect to mongos routers (URI or structured
hostvalues that point to mongos), do not setreplica_set, and keepdirect_connection=no.TLS-enabled deployments: add
tls=yesplus trust material (typicallytls_ca_file). Addtls_certificate_key_filewhen client certificates are required.Authentication source selection: keep
authentication_database=adminfor most users; use$externalonly for external mechanisms such as X.509.
Practical safety rules:
Pick one mode only: either
urior structured parameters.Keep credentials out of plain filesets when possible by using
password_fileorpassword_env.For replica sets, provide at least two seed hosts when available, so node changes do not break connectivity.
X.509 Rules
When authentication_mechanism=MONGODB-X509 is used:
tls=yesis required.tls_certificate_key_fileis required.authentication_databasemust be$external.Do not set
password,password_file, orpassword_env.The
usernamemust match the client certificate subject exactly as MongoDB expects it.
Example subject:
username="O=Bacula,OU=Backup,CN=bacula-mongodb-client"
See also
Next articles:
Go back to: Plugin Configuration.