mongos
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| 6/stable | 54 | 20 Aug 2025 | |
| 6/candidate | 54 | 20 Aug 2025 | |
| 6/beta | 54 | 20 Aug 2025 | |
| 6/edge | 54 | 20 Aug 2025 | |
| 8-transition/edge | 56 | 04 Sep 2025 | |
| 8/candidate | 53 | 07 Aug 2025 | |
| 8/beta | 53 | 07 Aug 2025 | |
| 8/edge | 60 | Yesterday |
juju deploy mongos --channel 6/stable
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
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
- Learn more about operating MongoDB sharded clusters and replica sets in the Charmed MongoDB documentation
- Check the charm’s GitHub repository
- Learn more about the
mongosrouter in the upstreammongosdocumentation
Project and community
Charmed Mongos is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback.
- Check our Code of Conduct
- Raise software issues or feature requests on GitHub
- Report security issues through LaunchPad.
- Meet the community and chat with us on Matrix
- Contribute to the code
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.