AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

MongoDB プロセスへの接続

To connect to MongoDB, retrieve the hostname and port information from Cloud Manager and then use a MongoDB client, such as mongosh or a MongoDB client library, to connect. To connect to a cluster, retrieve the hostname and port for the mongos process. To connect to a replica set or standalone process, retrieve the hostname and port for the mongod processes.

ファイアウォール ルールとユーザー認証は MongoDB へのアクセスに影響します。MongoDB プロセスのサーバーとポートにアクセス権がある必要があります。MongoDB を実行しているサーバーのファイアウォールについて詳しくは、MongoDB マニュアルのネットワーク セキュリティ ドキュメントのファイアウォール情報を参照してください。

MongoDB インスタンスがAmazon Web Services (AWS) で実行されている場合、AWS サーバーに関連付けられたセキュリティグループもアクセス権に影響します。AWS のセキュリティグループは、関連付けられたサーバーへのインバウンドとアウトバウンドのトラフィックを制御します。

MongoDBインスタンスに接続するためのshellコマンドを検索するか、特定のMongoDBプロセスのホストとポート番号を検索し、 shellまたはMongoDBクライアントライブラリのいずれかを使用して接続用の独自コマンドを作成することができます。

1
  1. まだ表示されていない場合は、希望するプロジェクトを含む組織を選択しますナビゲーション バーのOrganizationsメニュー

  2. まだ表示されていない場合は、ナビゲーション バーのProjectsメニューから目的のプロジェクトを選択します。

  3. サイドバーで、 Database見出しの下のProcessesをクリックします。

[プロセス ]ページが表示されます。

2
3

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

1
  1. まだ表示されていない場合は、希望するプロジェクトを含む組織を選択しますナビゲーション バーのOrganizationsメニュー

  2. まだ表示されていない場合は、ナビゲーション バーのProjectsメニューから目的のプロジェクトを選択します。

  3. サイドバーで、 Database見出しの下のProcessesをクリックします。

[プロセス ]ページが表示されます。

2
3

4 つのボタンは、左から右に ShardsConfigsMongosBIs の順に並んでいます。

プロセス
表示

Shards

mongod データをホストするプロセス。

Configs

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

Mongos

mongos シャーディングされたクラスターでデータをルーティングするプロセス。

BIs

シャーディングされたクラスター内のデータにアクセスする BI プロセス。

4

Cloud Manager では、プロセスのホスト名とポートがチャートページの上部に表示されます。

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

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

上記の手順を使用してホストとポートを取得します。ホスト名とポートを指定する 接続文字列 を作成する方法については、 手順 を参照してください。

For sharded clusters, you specify the hostname and port of the mongos instance. For a replica set, you specify a seed list of all hosts in the replica set. Your client library will automatically connect to the primary. For example:

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