> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> MongoDB Atlas を ClickPipes のソースとして設定するための手順ガイド

# MongoDB Atlas ソース設定ガイド

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

<div id="enable-oplog-retention">
  ## oplog 保持期間を設定する
</div>

レプリケーションには、最低 24 時間の oplog 保持期間が必要です。初回スナップショットが完了する前に oplog が切り捨てられないよう、oplog 保持期間は 72 時間以上に設定することを推奨します。UI で oplog 保持期間を設定するには、次の手順に従います。

1. MongoDB Atlas コンソールでクラスターの `Overview` タブに移動し、`Configuration` タブをクリックします。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/lGskH5qUgz9Vtlav/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-cluster-overview-configuration.png?fit=max&auto=format&n=lGskH5qUgz9Vtlav&q=85&s=e4343ee8682a000fe4580869cf883a09" alt="クラスター設定に移動" size="lg" border width="2496" height="1094" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-cluster-overview-configuration.png" />

2. `Additional Settings` をクリックし、`More Configuration Options` までスクロールします。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/lGskH5qUgz9Vtlav/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-expand-additional-settings.png?fit=max&auto=format&n=lGskH5qUgz9Vtlav&q=85&s=f016c2176484c8fed81fb403dfbe11e1" alt="追加設定を展開" size="lg" border width="2106" height="1282" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-expand-additional-settings.png" />

3. `More Configuration Options` をクリックし、最小の oplog ウィンドウを `72 hours` 以上に設定します。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/lGskH5qUgz9Vtlav/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-set-retention-hours.png?fit=max&auto=format&n=lGskH5qUgz9Vtlav&q=85&s=378050c91cb5838e602fc00433e4f45a" alt="oplog 保持時間を設定" size="lg" border width="2102" height="894" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-set-retention-hours.png" />

4. `Review Changes` をクリックして内容を確認し、続けて `Apply Changes` をクリックして変更を反映します。

<div id="configure-database-user">
  ## データベースユーザーを設定する
</div>

MongoDB Atlas のコンソールにログインしたら、左側のナビゲーションバーで Security タブの `Database Access` をクリックします。続いて、`Add New Database User` をクリックします。

ClickPipes では、パスワード認証が必要です。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/lGskH5qUgz9Vtlav/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-add-new-database-user.png?fit=max&auto=format&n=lGskH5qUgz9Vtlav&q=85&s=606061d79e3e8d80ee544b1f74d1bca4" alt="データベースユーザーを追加" size="lg" border width="1846" height="1356" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-add-new-database-user.png" />

ClickPipes では、次のロールを持つユーザーが必要です。

* `readAnyDatabase`
* `clusterMonitor`

これらのロールは、`Specific Privileges` セクションにあります。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/lGskH5qUgz9Vtlav/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-database-user-privilege.png?fit=max&auto=format&n=lGskH5qUgz9Vtlav&q=85&s=5bb9ed6dd77abc741dfe3e4978553ee3" alt="ユーザーロールを設定" size="lg" border width="1878" height="1020" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-database-user-privilege.png" />

さらに、ClickPipes ユーザーにアクセスを許可するクラスター/インスタンスを指定することもできます。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/lGskH5qUgz9Vtlav/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-restrict-access.png?fit=max&auto=format&n=lGskH5qUgz9Vtlav&q=85&s=f9880308eec331478c23820e8d830446" alt="クラスター/インスタンスへのアクセスを制限" size="lg" border width="1522" height="730" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-restrict-access.png" />

<div id="whats-next">
  ## 次は何をすればよいですか？
</div>

これで、[ClickPipe を作成](/ja/integrations/clickpipes/mongodb) し、MongoDB インスタンスから ClickHouse Cloud へのデータの取り込みを開始できます。
ClickPipe の作成時に必要になるため、MongoDB インスタンスのセットアップ時に使用した接続情報は必ず控えておいてください。
