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 173 27 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 Ubuntu 20.04
5/edge 109 06 Mar 2023
Ubuntu 22.04 Ubuntu 20.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 20.04 18.04

charms.mongodb.v1.shards_interface

In this class, we manage relations between config-servers and shards.

This class handles the sharing of secrets between sharded components, adding shards, and removing shards.


class ShardAuthError

Description

Raised when a shard doesn't have the same auth as the config server. None

Methods

ShardAuthError. __init__( self , shard: str )

class RemoveLastShardError

Description

Raised when there is an attempt to remove the last shard in the cluster. None

class ShardingProvider

Description

Manage relations between the config server and the shard, on the config-server's side. None

Methods

ShardingProvider. __init__( self , charm: CharmBase , relation_name: str )

Description

Constructor for ShardingProvider object. None

ShardingProvider. pass_hook_checks( self , event: EventBase )

Description

Runs the pre-hooks checks for ShardingProvider, returns True if all pass. None

ShardingProvider. add_shards( self , departed_shard_id )

Adds shards to cluster.

Description

raises: PyMongoError

ShardingProvider. remove_shards( self , departed_shard_id )

Removes shards from cluster.

Description

raises: PyMongoError, NotReadyError

ShardingProvider. update_credentials( self , key: str , value: str )

Description

Sends new credentials, for a key value pair across all shards. None

ShardingProvider. update_mongos_hosts( self )

Description

Updates the hosts for mongos on the relation data. None

ShardingProvider. get_config_server_status( self )

Description

Returns the current status of the config-server. None

ShardingProvider. skip_config_server_status( self )

Description

Returns true if the status check should be skipped. None

ShardingProvider. has_shards( self )

Description

Returns True if currently related to shards. None

Description

Returns a list of related shards. None

ShardingProvider. get_unreachable_shards( self )

Description

Returns a list of unreable shard hosts. None

ShardingProvider. is_mongos_running( self )

Description

Returns true if mongos service is running. None

ShardingProvider. get_draining_shards( self )

Description

Returns the shard that is currently draining. None

class ConfigServerRequirer

Description

Manage relations between the config server and the shard, on the shard's side. None

Methods

ConfigServerRequirer. __init__( self , charm: CharmBase , relation_name: str )

Description

Constructor for ShardingProvider object. None

ConfigServerRequirer. pass_hook_checks( self , event )

Description

Runs the pre-hooks checks for ConfigServerRequirer, returns True if all pass. None

ConfigServerRequirer. wait_for_draining( self , mongos_hosts )

Description

Waits for shards to be drained from sharded cluster. None

ConfigServerRequirer. get_shard_status( self )

Returns the current status of the shard.

Description

Note: No need to report if currently draining, since that check block other hooks from executing.

ConfigServerRequirer. skip_shard_status( self )

Description

Returns true if the status check should be skipped. None

ConfigServerRequirer. drained( self , mongos_hosts , shard_name: str )

Returns whether a shard has been drained from the cluster.

Description

Raises: ConfigurationError, OperationFailure, ShardNotInClusterError, ShardNotPlannedForRemovalError

ConfigServerRequirer. update_operator_password( self , new_password: str )

Updates the password for the operator user.

Description

Raises: RetryError

ConfigServerRequirer. update_keyfile( self , key_file_contents: str )

Description

Updates keyfile on all units. None

ConfigServerRequirer. has_config_server( self )

Description

Returns True if currently related to config server. None

Description

Returns the related config server. None

ConfigServerRequirer. get_mongos_hosts( self )

Description

Returns a list of IP addresses for the mongos hosts. None