Connect to a MongoDB Process (2024)

On this page

  • Overview
  • Firewall Rules
  • Procedures

Cloud Manager will no longer support Automation, Backup, and Monitoring for MongoDB 3.6 and 4.0 after August 30th, 2024. Please

upgrade your MongoDB deployment or migrate to Atlas.

Overview

To connect to a MongoDB, retrieve the hostname and port informationfrom Cloud Manager and then use a MongoDB client, such as mongosh or aMongoDB driver, to connect. Toconnect to a cluster, retrieve the hostnameand port for the mongos process. To connect to areplica set or standalone process, retrievethe hostname and port for the mongod processes.

Firewall Rules

Firewall rules and user authentication affect your access to MongoDB.You must have access to the server and port of the MongoDB process.For information on firewalls on servers running MongoDB, seethe firewall information in the Network Security document in the MongoDB manual.

If your MongoDB instance runs on Amazon Web Services (AWS), then thesecurity group associated with the AWS servers also affects access. AWSsecurity groups control inbound and outbound traffic to theirassociated servers.

Procedures

You can retrieve a shell command for connecting to your MongoDBinstance, or you can retrieve the host and port number of a specificMongoDB process and create your own command for connecting using eithershell orMongoDB driver.

Get a Shell Command to Connect to a MongoDB Instance

In MongoDB Cloud Manager, go to the Deployment page for your project.

  1. If it is not already displayed, select the organization thatcontains your desired project from the Organizations menu in thenavigation bar.

  2. If it's not already displayed, select your desired projectfrom the Projects menu in the navigation bar.

  3. If the Deployment page is notalready displayed, click Deployment in the sidebar.

    The Deployment pagedisplays.

2

Go to the Processes page.

Click the Processes tab for your deployment.

The Processes pagedisplays.

3

Select the Clusters view for your deployment.

4

On the line listing the cluster, replica set, or process, click the ellipsis icon and select Connect to this instance.

Cloud Manager provides a mongo command that you can useto connect to the MongoDB process.

Get the Host and Port for a MongoDB Process

In MongoDB Cloud Manager, go to the Deployment page for your project.

  1. If it is not already displayed, select the organization thatcontains your desired project from the Organizations menu in thenavigation bar.

  2. If it's not already displayed, select your desired projectfrom the Projects menu in the navigation bar.

  3. If the Deployment page is notalready displayed, click Deployment in the sidebar.

    The Deployment pagedisplays.

2

Go to the Processes page.

Click the Processes tab for your deployment.

The Processes pagedisplays.

3

Select the Clusters view for your deployment.

4

(Optional) For sharded clusters, filter which process type is listed.

The four buttons are listed in the following order, left to right:Shards, Configs, Mongos, andBIs.

Process

Displays

Shards

mongod processes that host your data.

Configs

mongod processes that run as configservers to store a sharded cluster's metadata.

Mongos

mongos processes that route data in a shardedcluster.

BIs

BI processes that access datain a sharded cluster.

5

On the line listing the process, click Metrics.

Cloud Manager displays the hostname and port of the process at the top of thecharts page.

Connect to a Deployment Using mongosh

Get the host and port using the previous procedure. From a shell, run mongosh and specify thehost and port. For example:

mongosh --username <user> --password <pass> --host <host> --port <port>

Connect to a Deployment Using a MongoDB Driver

Get the host and port using the above procedure.See your driver's instructions forcreating a connection string thatspecifies the hostname and port.

For sharded clusters, you specify the hostname and port of themongos instance. For a replica set, you specify a seed list ofall hosts in the replica set. Your driver will automatically connect tothe primary. For example:

mongodb://[<username>:<password>@]hostname0<:port>[,hostname1:<port1>][,hostname2:<port2>][...][,hostnameN:<portN>]

Connect to a MongoDB Process (2024)
Top Articles
The Benefits Of Being Wealthy - FasterCapital
Who are the world's highest-paid executives?
Menards Thermal Fuse
Garrison Blacksmith Bench
Ups Dropoff Location Near Me
Archived Obituaries
Air Canada bullish about its prospects as recovery gains steam
Kris Carolla Obituary
Snarky Tea Net Worth 2022
What Happened To Father Anthony Mary Ewtn
Employeeres Ual
Locate Td Bank Near Me
Bbc 5Live Schedule
Daniela Antury Telegram
Revitalising marine ecosystems: D-Shape’s innovative 3D-printed reef restoration solution - StartmeupHK
C Spire Express Pay
Craigslist Farm And Garden Tallahassee Florida
National Weather Service Denver Co Forecast
Chastity Brainwash
Nail Salon Goodman Plaza
Best Transmission Service Margate
Parc Soleil Drowning
Nsa Panama City Mwr
Wsbtv Fish And Game Report
The Banshees Of Inisherin Showtimes Near Broadway Metro
Receptionist Position Near Me
Garden Grove Classlink
Ascensionpress Com Login
27 Fantastic Things to do in Lynchburg, Virginia - Happy To Be Virginia
Meggen Nut
Kiddie Jungle Parma
Perry Inhofe Mansion
Rush County Busted Newspaper
Basil Martusevich
Salons Open Near Me Today
One Credit Songs On Touchtunes 2022
Ni Hao Kai Lan Rule 34
The 50 Best Albums of 2023
Dadeclerk
Tiny Pains When Giving Blood Nyt Crossword
Colorado Parks And Wildlife Reissue List
Entry of the Globbots - 20th Century Electro​-​Synthesis, Avant Garde & Experimental Music 02;31,​07 - Volume II, by Various
Seven Rotten Tomatoes
Divinity: Original Sin II - How to Use the Conjurer Class
What to Do at The 2024 Charlotte International Arts Festival | Queen City Nerve
How Big Is 776 000 Acres On A Map
Noh Buddy
Streameast Io Soccer
Buildapc Deals
Minecraft Enchantment Calculator - calculattor.com
Cbs Scores Mlb
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 6333

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.