製品をチェック

製品についての詳細情報や無償トライアルをご案内します:

CData Sync

データ連携でお困りですか?

お問い合わせ

MongoDB へのAzure Data Lake Storage データの自動反復レプリケーション


MongoDB にCData Sync を使って、Azure Data Lake Storage データを自動、反復、フレキシブルにレプリケーション。


古川えりか
コンテンツスペシャリスト

azuredatalake ロゴ画像

CData Sync

sync ロゴ画像
MongoDB ロゴ画像

常時起動のアプリケーションは、自動フェイルオーバー機能およびリアルタイムなデータアクセスを必要とします。 CData Sync は、MongoDB に直近のAzure Data Lake Storage data を反復同期します。CData Sync で、アーカイブ、レポーティング、アナリティクス、機械学習、AI などで使えるよう、企業内の多様なデータを一か所に統合して管理することが可能になります。

MongoDB をレプリケーションの同期先に設定

CData Sync を使って、MongoDB にAzure Data Lake Storage data をレプリケーションします。レプリケーションの同期先を追加するには、[接続]タブを開きます。

  1. [同期先]タブをクリックします。
  2. MongoDB を同期先として選択します。 MongoDB をDestination に選択
  3. 必要な接続プロパティを入力します。MongoDB との接続には、以下のプロパティが必要です:
    • Server: MongoDB インスタンスのname もしくはaddress に設定します。port はPort で設定します。
    • Database: 書き込みをするデータベース名。

    CosmosDB にMongoDB API で接続する

    MongoDB API 利用のCosmos DB に接続する接続文字列を取得するには、Azure Portal にログインし、Azure Cosmos DB を選択して、アカウントを選びます。[Setting]セクションから[Connection String]をクリックして、次の値を取得します。

    • Server: Host 値、アカウントのサーバープロビジョンのFQDN 値に設定します。port はPort で設定します。
    • Port: port に設定します。
    • Database: データを書き込むデータベース。
    • User: データベースのuser。
    • Password: ユーザーのpassward。

  4. [接続のテスト]をクリックして、正しく接続できているかをテストします。 同期先接続のテスト。
  5. [変更を保存]をクリックします。

Azure Data Lake Storage 接続の設定

データソース側にAzure Data Lake Storage を設定します。[接続]タブをクリックします。

  1. [接続の追加]セクションで[データソース]タブを選択します。
  2. Azure Data Lake Storage アイコンをデータソースとして選択します。プリインストールされたソースにAzure Data Lake Storage がない場合には、追加データソースとしてダウンロードします。
  3. 接続プロパティに入力をします。

    Authenticating to a Gen 1 DataLakeStore Account

    Gen 1 uses OAuth 2.0 in Azure AD for authentication.

    For this, an Active Directory web application is required. You can create one as follows:

    1. Sign in to your Azure Account through the .
    2. Select "Azure Active Directory".
    3. Select "App registrations".
    4. Select "New application registration".
    5. Provide a name and URL for the application. Select Web app for the type of application you want to create.
    6. Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
    7. Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.

    To authenticate against a Gen 1 DataLakeStore account, the following properties are required:

    • Schema: Set this to ADLSGen1.
    • Account: Set this to the name of the account.
    • OAuthClientId: Set this to the application Id of the app you created.
    • OAuthClientSecret: Set this to the key generated for the app you created.
    • TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
    • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

    Authenticating to a Gen 2 DataLakeStore Account

    To authenticate against a Gen 2 DataLakeStore account, the following properties are required:

    • Schema: Set this to ADLSGen2.
    • Account: Set this to the name of the account.
    • FileSystem: Set this to the file system which will be used for this account.
    • AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
    • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
    データソースセクションの設定(Salesforce 画面を例示)。
  4. [接続のテスト]をクリックして、正しく接続できているかをテストします。
  5. [変更を保存]をクリックします。

レプリケーションを実行するクエリの設定

Data Sync はレプリケーションをコントロールするSQL クエリを簡単なGUI 操作で設定できます。 レプリケーションジョブ設定には、[ジョブ]タブに進み、[ジョブを追加]ボタンをクリックします。 次にデータソースおよび同期先をそれぞれドロップダウンから選択します。

レプリケーションジョブのソースおよび同期先を選択。

テーブル全体をレプリケーションする

テーブル全体をレプリケーションするには、[テーブル]セクションで[テーブルを追加]をクリックします。表示されたテーブルリストからレプリケーションするテーブルをチェックします。

レプリケーションするテーブルの選択(画像はSalesforce の例)。

テーブルをカスタマイズしてレプリケーションする

レプリケーションはテーブル全体ではなく、カスタマイズが可能です。[変更]機能を使えば、レプリケーションするカラムの指定、同期先でのカラム名を変更しての保存、ソースデータの各種加工が可能です。レプリケーションのカスタマイズには、ジョブの[変更]ボタンをクリックしてカスタマイズウィンドウを開いて操作を行います。

レプリケーションのカスタマイズ設定。

レプリケーションのスケジュール起動設定

[スケジュール]セクションでは、レプリケーションジョブの自動起動スケジュール設定が可能です。反復同期間隔は、15分おきから毎月1回までの間で設定が可能です。

スケジュール起動設定。

レプリケーションジョブを設定したら、[変更を保存]ボタンを押して保存します。Azure Data Lake Storage data のMongoDB へのレプリケーションジョブは一つではなく複数を作成することが可能です。