Charmed Mongos | Home

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.

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