MongoDB

Channel Revision Published Runs on
6/stable 199 04 Oct 2024
Ubuntu 22.04
6/candidate 199 04 Oct 2024
Ubuntu 22.04
6/beta 199 04 Oct 2024
Ubuntu 22.04
6/edge 204 12 Nov 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.


Index

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 , substrate )

Description

Constructor for ShardingProvider object. None

ShardingProvider. pass_sanity_hook_checks( self , event: EventBase )

Description

Returns True if all the sanity hook checks for sharding pass. 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. update_ca_secret( self , new_ca: str )

Description

Updates the new CA for all related shards. 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. get_shards_from_relations( self , departed_shard_id )

Description

Returns a list of the shards related to the config-server. None

ShardingProvider. has_shards( self )

Description

Returns True if currently related to shards. None

Description

Returns a list of related shards. None

ShardingProvider. get_all_sharding_relations( self )

Description

Returns a list of relation data for 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

ShardingProvider. cluster_password_synced( self )

Description

Returns True if the cluster password is synced. 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. get_membership_auth_modes( self , event: RelationChangedEvent )

Description

Returns the available authentication membership forms. None

ConfigServerRequirer. update_member_auth( self , event: RelationChangedEvent , membership_auth )

Description

Updates the shard to have the same membership auth as the config-server. None

ConfigServerRequirer. get_cluster_passwords( self , relation_id: int )

Description

Retrieves shared cluster passwords. None

ConfigServerRequirer. sync_cluster_passwords( self , event: EventBase , operator_password: str , backup_password: str )

Description

Updates shared cluster passwords. None

ConfigServerRequirer. relation_created( self , event: RelationJoinedEvent )

Description

Sets status and flags in relation data relevant to sharding. None

ConfigServerRequirer. pass_hook_checks( self , event: EventBase )

Description

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

ConfigServerRequirer. pass_sanity_hook_checks( self , event: EventBase )

Description

Returns True if all the sanity hook checks for sharding pass. None

ConfigServerRequirer. pass_tls_hook_checks( self , event: EventBase )

Description

Returns True if the TLS checks for sharding pass. None

ConfigServerRequirer. wait_for_draining( self , mongos_hosts )

Description

Waits for shards to be drained from sharded cluster. None

ConfigServerRequirer. get_relations_statuses( self )

Description

Returns status based on relations and their validity regarding sharding. None

ConfigServerRequirer. get_tls_statuses( self )

Description

Returns statuses relevant to TLS. 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_password( self , username: str , new_password: str )

Description

Updates the password for the given user. None

ConfigServerRequirer. update_keyfile( self , key_file_contents: str )

Description

Updates keyfile on all units. None

ConfigServerRequirer. cluster_password_synced( self )

Description

Returns True if the cluster password is synced for the shard. None

ConfigServerRequirer. get_shard_members( self )

Returns a list of shard members.

Description

Raises: PyMongoError

ConfigServerRequirer. has_config_server( self )

Description

Returns True if currently related to config server. None

ConfigServerRequirer. get_config_server_name( self )

Description

Returns the related config server's name. None

ConfigServerRequirer. get_config_server_relation( self )

Description

Returns the related config server relation data. None

ConfigServerRequirer. get_mongos_hosts( self )

Description

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

ConfigServerRequirer. is_ca_compatible( self )

Description

Returns true if both the shard and the config server use the same CA. None

ConfigServerRequirer. is_shard_tls_missing( self )

Description

Returns true if the config-server has TLS enabled but the shard does not. None

ConfigServerRequirer. is_config_server_tls_missing( self )

Description

Returns true if the shard has TLS enabled but the config-server does not. None