Mongos

  • Canonical
Channel Revision Published Runs on
latest/candidate 24 04 Oct 2024
Ubuntu 22.04
latest/beta 24 04 Oct 2024
Ubuntu 22.04
6/stable 24 08 Oct 2024
Ubuntu 22.04
6/beta 10 26 Mar 2024
Ubuntu 22.04
6/edge 31 12 Dec 2024
Ubuntu 22.04
juju deploy mongos --channel candidate
Show information

Platform:

Ubuntu
22.04

Charmed Mongos documentation

The Charmed Mongos operator deploys and operates mongos instances on both physical and virtual machines, along with a wide range of cloud and cloud-like environments.

mongos is a router for connecting client applications to a sharded MongoDB clusters. It is the only way to access a sharded MongoDB cluster from the client perspective.

Charmed Mongos acts as a subordinate charm and is meant to act as a proxy to a sharded MongoDB cluster. To deploy a sharded MongoDB cluster, please see our Charmed MongoDB operator.

Summary


Get started

The following steps will guide you through briefly creating a client connection to a sharded MongoDB cluster via mongos.

You’ll need a Juju environment and a MongoDB application deployed as a sharded cluster.

For guidance about setting up your environment, see the Charmed MongoDB tutorial for sharded clusters.

Deploy and integrate

To deploy mongosand data-integrator, run

juju deploy mongos
juju deploy data-integrator --config database-name=<name>

When the status of the mongos application becomes idle, integrate mongos with data-integrator and with the mongodb application running as config-server:

juju integrate mongos data-integrator
juju integrate config-server mongos

Access the database

In order to access the integrated database, you will need the mongos URI. To retrieve this, run the following command:

juju run data-integrator/leader get-credentials

You will find the URI under the field uris in the output.

Then SSH into the unit and access the mongo shell:

juju ssh mongos/0
mongosh <URI>

Enable TLS encryption

If the sharded MongoDB cluster has TLS enabled, mongos must also enable TLS. Enable it by integrating mongos with a TLS application:

juju integrate mongos <tls-application>

<tls-application must be the same TLS application that the sharded MongoDB cluster is integrated to.

For more information about TLS in sharded clusters, see the Charmed MongoDB documentation for enabling security in sharded clusters

Remove the connection

To remove a mongos connection to the sharded cluster, run:

juju remove-relation config-server mongos

Whenmongos is removed from the sharded cluster, the client is removed as well.

Learn more

Project and community

Charmed Mongos is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback.

License

The Charmed Mongos Operator is free software, distributed under the Apache Software License, version 2.0. It installs, operates, and depends on MongoDB Community Version, which is licensed under the Server Side Public License (SSPL)

MongoDB is a trademark or registered trademark of MongoDB, Inc. Other trademarks are property of their respective owners.