> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-detect-table-modification.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 = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

<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-detect-table-modification/Qdrmbc1T54ihl0_n/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-cluster-overview-configuration.webp?fit=max&auto=format&n=Qdrmbc1T54ihl0_n&q=85&s=8f096838c57fb95ee2ef62c1725406e0" alt="クラスター設定に移動" size="lg" border width="2496" height="1094" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-cluster-overview-configuration.webp" />

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

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

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

<Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/Qdrmbc1T54ihl0_n/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-set-retention-hours.webp?fit=max&auto=format&n=Qdrmbc1T54ihl0_n&q=85&s=55be50d0187b687aa12ad63928b0f463" alt="oplog 保持時間を設定" size="lg" border width="2102" height="894" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-set-retention-hours.webp" />

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-detect-table-modification/Qdrmbc1T54ihl0_n/images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-add-new-database-user.webp?fit=max&auto=format&n=Qdrmbc1T54ihl0_n&q=85&s=7da68de9732ad099d0faa3d33d24a96d" alt="データベースユーザーを追加" size="lg" border width="1846" height="1356" data-path="images/integrations/data-ingestion/clickpipes/mongodb/mongo-atlas-add-new-database-user.webp" />

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

* `readAnyDatabase`
* `clusterMonitor`

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

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

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

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

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

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