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 mongos
and 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
mongos
router in the upstreammongos
documentation
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.
Navigation
Navigation
Level | Path | Navlink |
---|---|---|
1 | h-minor-upgrade | Perform a minor upgrade |
1 | r-release-notes | Release Notes |
2 | r-revision-24 | Revision 24 |
Redirects
Mapping table
Path | Location |
---|