Charmed MongoDB
- By Canonical Data Platform
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
6/edge | 140 | 30 Nov 2023 | |
5/stable | 117 | 20 Apr 2023 | |
5/candidate | 117 | 20 Apr 2023 | |
5/edge | 139 | 21 Nov 2023 | |
3.6/stable | 100 | 28 Apr 2023 | |
3.6/candidate | 100 | 13 Apr 2023 | |
3.6/edge | 100 | 03 Feb 2023 |
juju deploy mongodb --channel 6/edge
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.mongodb.v1.helpers
-
- Last updated 13 Oct 2023
- Revision Library version 1.0
Simple functions, which can be used in both K8s and VM charms.
Index
def
get_create_user_cmd(
config: MongoDBConfiguration,
mongo_path
)
Creates initial admin user for MongoDB.
Description
Initial admin user can be created only through localhost connection. see https://www.mongodb.com/docs/manual/core/localhost-exception/ unfortunately, pymongo not able to create connection which considered as local connection by MongoDB, even if socket connection used. As result where are only hackish ways to create initial user. It is needed to install mongodb-clients inside charm container to make this function work correctly
def
get_mongos_args(
config: MongoDBConfiguration,
snap_install: bool
)
Returns the arguments used for starting mongos on a config-server side application.
Returns
A string representing the arguments to be passed to mongos.
def
get_mongod_args(
config: MongoDBConfiguration,
auth: bool,
snap_install: bool,
role: str
)
Construct the MongoDB startup command line.
Returns
A string representing the command used to start MongoDB.
def generate_password()
Generate a random password string.
Returns
A random password string.
def generate_keyfile()
Key file used for authentication between replica set peers.
Returns
A maximum allowed random string.
def
build_unit_status(
mongodb_config: MongoDBConfiguration,
unit_ip: str
)
Description
Generates the status of a unit based on its status reported by mongod. None
def copy_licenses_to_unit()
Description
Copies licenses packaged in the snap to the charm's licenses directory. None
def current_pbm_op(pbm_status: str)
Description
Parses pbm status for the operation that pbm is running. None
def process_pbm_status(pbm_status: str)
Description
Parses current pbm operation and returns unit status. None