Informatica は、データを転送・変換するための強力で立派な手段を提供します。CData JDBC Driver for ADLS を利用することで、Informatica のEnterprise Data Catalog とシームレスに統合される、業界で実証済みの標準に基づくドライバーにアクセスできます。このチュートリアルでは、どんな環境でもAzure Data Lake Storage データを分類・整理する方法を説明します。
JDBC ドライバーをロード
以下はJDBC ドライバーをロードする方法です。
- Informatica を実行しているホストにJDBC ドライバーをインストールします。この記事では、ドライバーがcdata.jdbc.adls.ADLS Driver にインストールされていることを前提としています。
$ java -jar setup.jar
- JDBC インストールディレクトリに移動して、genericJDBC.zip と呼ばれ、ドライバーとそのライセンスファイルを含むzip ファイルを作成します。
$ cd ~/cdata-jdbc-driver-for-adls/lib
$ zip genericJDBC.zip cdata.jdbc.adls.jar cdata.jdbc.adls.lic
- genericJDBC.zip ファイルをInformatica 内のCatalog Service ディレクトリに移動します。この記事では、ドライバーが/opt/informatica にインストールされていることを前提としています。
このフォルダでの作業には、root 権限が必要になるおそれがあるため、続行する前にroot に必ずsu または sudo を実行してください。
# mv genericJDBC.zip /opt/informatica/services/CatalogService/ScannerBinaries
- カスタムデプロイメント構成を編集し、zip ファイルを解凍します。
# cd /opt/informatica/services/CatalogService/ScannerBinaries/CustomDeployer/
# nano scannerDeployer.xml
既存のExecutionContextProperty ノードを解凍したら、このコンテンツを含む新しいExecutionContextProperty ノードを追加します。
<ExecutionContextProperty
isLocationProperty="true"
dependencyToUnpack="genericJDBC.zip">
<PropertyName>JDBCScanner_DriverLocation</PropertyName>
<PropertyValue>scanner_miti/genericJDBC/Drivers</PropertyValue>
</ExecutionContextProperty>
- アドミニストレーションコンソールから、Catalog Service を更新します。
JDBC リソースの構成
以下の手順でJDBC リソースを構成します。
- Catalog のアドミニストレーターを開き、次のプロパティを持つ新しいJDBC リソースを追加します。
- Driver Class: cdata.jdbc.adls.ADLSDriver
- URL:
jdbc.adls:Schema=ADLSGen2;Account=myAccount;FileSystem=myFileSystem;AccessKey=myAccessKey;InitiateOAuth=GETANDREFRESH;
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:
- Sign in to your Azure Account through the
[.
]- Select "Azure Active Directory".
- Select "App registrations".
- Select "New application registration".
- Provide a name and URL for the application. Select Web app for the type of application you want to create.
- 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.
- 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.
ビルトイン接続文字列デザイナ
JDBC URL の構成については、Azure Data Lake Storage JDBC Driver に組み込まれている接続文字列デザイナを使用してください。.jar ファイルのダブルクリック、またはコマンドラインから.jar ファイルを実行します。
java -jar cdata.jdbc.adls.jar
接続プロパティを入力し、接続文字列をクリップボードにコピーします。
JDBC URL を構成する際に、Max Rows プロパティを定めることも可能です。これによって戻される行数を制限するため、可視化・レポートのデザイン設計時のパフォーマンスを向上させるのに役立ちます。
以下は、一般的な追加の接続文字列プロパティです。
JDBC;MSTR_JDBC_JAR_FOLDER=PATH\TO\JAR\;DRIVER=cdata.jdbc.adls.ADLSDriver;URL={jdbc:adls:Schema=ADLSGen2;Account=myAccount;FileSystem=myFileSystem;AccessKey=myAccessKey;};
- ユーザー名: user
- パスワード: password
使用しているドライバーに要求されなくても、ユーザー名とパスワードのプロパティは必須であることに注意してください。そのようなケースでは、代わりにプレスホルダー値を入力できます。
- 少なくとも一つのソースメタデータスキャンを実行するようにメタデータオプションを構成します。このスキャンではドライバーを使用し、サービスを通じて使用できるテーブル、ビュー、ストアドプロシージャを判別します。
- Source Metadata: このオプションを有効にする。
- Catalog: これをマルチカタログデータソースの適切なカタログに設定します。もしくは、CData に設定します。
- Schema: これをマルチスキーマデータソースの適切なスキーマに設定します。もしくは、これをサービスの名前に設定します。(以下ではCouchbase)
- Case-sensitivity: 通常このオプションは無効にします。大文字と小文字が区別されるデータソースに対してのみ有効にしてください。
- Import stored procedures: テーブルとビューに加え、ストアドプロシージャディフィニションをインポートする場合は、これを有効にします。
他のメタデータスキャナーは、必要に応じて有効にすることができます。
- ドライバーの構成を完了し、オプションでカスタム属性とスキャナースケジュールを構成します。
- [Monitoring]タブに移動し[Run]をクリックしてメタデータスキャンを実行します。データソースによっては、これに数分かかる場合があります。
スキャンが完了すると、すべてのメタデータオブジェクトの概要が[Metadata Load job]のステータスとともに表示されます。エラーが発生した場合、[Log Location]リンクを開き、インフォマティカまたはドライバーから報告されたエラーを確認できます。
検出されたメタデータを検証
[Catalog Service]を開き、データソースから検出されたメタデータを表示します。メタデータスキャナーの構成時に選択したオプションによっては、定義したリソースのテーブル、ビュー、ストアドプロシージャの任意の組み合わせが表示される場合があります。