Charmed MongoDB

Channel Revision Published Runs on
6/stable 164 26 Mar 2024
Ubuntu 22.04
6/candidate 164 26 Mar 2024
Ubuntu 22.04
6/beta 164 26 Mar 2024
Ubuntu 22.04
6/edge 171 06 May 2024
Ubuntu 22.04
5/stable 117 20 Apr 2023
Ubuntu 22.04
5/candidate 117 20 Apr 2023
Ubuntu 22.04
5/edge 139 21 Nov 2023
Ubuntu 22.04
3.6/stable 100 28 Apr 2023
Ubuntu 20.04 Ubuntu 18.04
3.6/candidate 100 13 Apr 2023
Ubuntu 20.04 Ubuntu 18.04
3.6/edge 100 03 Feb 2023
Ubuntu 20.04 Ubuntu 18.04
juju deploy mongodb --channel 6/stable
Show information

Platform:

Ubuntu
22.04

charms.mongodb.v0.machine_helpers

Machine Charm specific functions for operating MongoDB.


def auth_enabled()

Description

Checks if mongod service is has auth enabled. None

def start_with_auth(path)

Description

Returns true is a mongod service file has the auth configuration. None

def stop_mongod_service()

Description

Stop the mongod service if running. None

def start_mongod_service()

Description

Starts the mongod service if stopped. None

def update_mongod_service(
    auth: bool,
    machine_ip: str,
    config: MongoDBConfiguration
)

Description

Updates the mongod service file with the new options for starting. None

def add_self_healing(service_lines)

Updates the service file to auto-restart the DB service on service failure.

Description

Options for restarting allow for auto-restart on crashed services, i.e. DB killed, DB frozen, DB terminated.

def generate_service_args(
    auth: bool,
    machine_ip: str,
    config: MongoDBConfiguration
)

Construct the mongod startup commandline args for systemd.

Description

Note that commandline arguments take priority over any user set config file options. User options will be configured in the config file. MongoDB handles this merge of these two options.

def push_file_to_unit(
    parent_dir,
    file_name,
    file_contents
)

Description

K8s charms can push files to their containers easily, this is the vm charm workaround. None

def restart_mongod_service(
    auth: bool,
    machine_ip: str,
    config: MongoDBConfiguration
)

Description

Restarts the mongod service with its associated configuration. None

class ApplicationHostNotFoundError

Description

Raised when a queried host is not in the application peers or the current host. None