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 5/candidate
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.

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-k8s <application>

Remove client connection

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

juju remove-relation mongodb-k8s <application>

Create a client connection to a sharded cluster

To create a client connection to a sharded cluster, you must use the Charmed Mongos-K8s 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-k8s
juju deploy data-integrator [necessary options]

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

juju integrate mongos-k8s data-integrator

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

juju integrate config-server mongos-k8s

Remove client connection

To remove a client connection to a sharded cluster:

juju remove-relation config-server mongos-k8s

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-k8s/leader set-password password=<password>

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

juju run mongodb-k8s/leader set-password