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

How to manage client connections

Integrations (formerly “relations”) are connections between two applications with compatible endpoints. These connections simplify the creation and management of users, passwords, and other shared data.

Summary


Create a client connection to a bare replica set

To create a client connection to a replica set, simply integrate your client application with a Charmed MongoDB application running in replication mode.

The legacy mongodb interface is being deprecated soon. Integrations for client connections are now only supported via the mongodb_client interface.

If you do not have a client application that implements this interface, you can use the data-integrator charm.

To integrate mongodb with a client application, run:

juju integrate mongodb <application>

Remove client connection

To remove a client connection and the user associated with it:

juju remove-relation mongodb <application>

Create a client connection to a sharded cluster

To create a client connection to a sharded cluster, you must use the Charmed Mongos router.

mongos is a subordinate charm and must have a host charm. If you do not have a suitable host application, you may use the data-integrator charm.

To deploy mongos and data-integrator, run:

juju deploy mongos
juju deploy data-integrator [necessary options]

Wait for mongos’s status to be idle, then integrate it with data-integrator:

juju integrate mongos data-integrator

Next, integrate the mongos charm to a Charmed MongoDB application running as a config-server:

juju integrate config-server mongos

Remove client connection

To remove a client connection to a sharded cluster:

juju remove-relation config-server mongos

Rotate the client password

To rotate client passwords, the integration should be removed and integrated again:

juju remove-relation <application> mongodb
juju integrate <application> mongodb

This process will generate a new user and password for the application. It works for both replica sets and sharded cluster client connections.

Internal operator user

The operator (i.e. admin) user is used internally by the Charmed MongoDB Operator. To rotate its password, use the set-password action.

To set a specific password for the operator user, run:

juju run mongodb/leader set-password password=<password>

To randomly generate a password for the operator user, run:

juju run mongodb/leader set-password

Help improve this document in the forum (guidelines). Last updated 3 months ago.