データ・カタログ・メタストアにアクセスするためのSparkの構成

  1. Apache Ambariにアクセスします。
  2. サイド・ツールバーの「サービス」で、Spark3を選択します。
  3. 「Configs」タブを選択し、「Advanced spark3-defaults」セクションを展開します。
  4. 次の値を使用してspark.sql.hive.metastore.jarsキーを追加または更新します:
    /usr/lib/oci-dcat-metastore-client/lib/integration/*:/usr/lib/oci-dcat-metastore-client/lib/*:/usr/lib/hive/lib/*:{{spark_home}}/jars/*
  5. 管理対象表のオブジェクト・ストレージ・パスを使用してspark.sql.warehouse.dirキーを追加または更新します。例: oci://bucket-name@tenancy-name-of-bucket/path/to/managed/table/directory
  6. 「Custom spark3-defaults」セクションを展開します。
  7. 次の値を使用してspark.driver.extraJavaOptionsキーを追加または更新します:
    -Doracle.dcat.metastore.client.show_provider_details=true -Doracle.dcat.metastore.client.custom.authentication_provider=com.oracle.pic.dcat.metastore.commons.auth.provider.UserPrincipalsCustomAuthenticationDetailsProvider -DOCI_TENANT_METADATA=ocid1.tenancy.oc1.<unique_ID> -DOCI_REGION_METADATA=<region-identifier> -DOCI_USER_METADATA=ocid1.user.oc1.<unique_ID> -DOCI_FINGERPRINT_METADATA=<user-finger-print> -DOCI_PVT_KEY_FILE_PATH=/private <key-file-path.pem> -DOCI_PASSPHRASE_METADATA="<passphase-of-the-key>" -Doci.metastore.uris=https://datacatalog.<region>.oci.oraclecloud.com:443 -Doracle.dcat.metastore.id=ocid1.datacatalogmetastore.oc1.<unique_ID>
  8. spark.hadoop.fs.AbstractFileSystem.oci.implキーを値com.oracle.bmc.hdfs.Bmcで追加または更新します
  9. オブジェクト・ストレージURLを使用してspark.hadoop.fs.oci.client.hostnameキーを追加または更新します。例: https://objectstorage.<region-identifier>.oraclecloud.com
  10. 「Custom spark3-hive-site-override」セクションを展開します。
  11. メタストアURLを使用してhive.metastore.urisキーを追加または更新します。例: https://datacatalog.<region-identifier>.oci.oraclecloud.com:443
  12. 管理対象表のオブジェクト・ストレージ・パスを使用してhive.metastore.warehouse.dirキーを追加または更新します。例: oci://bucket-name@tenancy-name-of-bucket/path/to/managed/table/directory
  13. 外部表のオブジェクト・ストレージ・パスを使用してhive.metastore.warehouse.external.dirキーを追加または更新します。例: oci://bucket-name@tenancy-name-of-bucket/path/to/external/table/directory
  14. 「Advanced spark3-thrift-sparkconf」セクションを展開します。
  15. 次の値を使用してspark.sql.hive.metastore.jarsキーを追加または更新します:
    /usr/lib/oci-dcat-metastore-client/lib/integration/*:/usr/lib/oci-dcat-metastore-client/lib/*:/usr/lib/hive/lib/*:{{spark_home}}/jars/*
    ノート

    :{{hadoop_home}}/lib/*がないことを確認します。
  16. 「Custom spark3-thrift-sparkconf」セクションを展開します。
  17. 次の値を使用してspark.driver.extraJavaOptionsキーを追加または更新します:
    -Doracle.dcat.metastore.client.show_provider_details=true -Doracle.dcat.metastore.client.custom.authentication_provider=com.oracle.pic.dcat.metastore.commons.auth.provider.UserPrincipalsCustomAuthenticationDetailsProvider -DOCI_TENANT_METADATA=ocid1.tenancy.oc1.<unique_ID> -DOCI_REGION_METADATA=<region-identifier> -DOCI_USER_METADATA=ocid1.user.oc1.<unique_ID> -DOCI_FINGERPRINT_METADATA=<user-finger-print> -DOCI_PVT_KEY_FILE_PATH=/private <key-file-path.pem> -DOCI_PASSPHRASE_METADATA="<passphase-of-the-key>" -Doci.metastore.uris=https://datacatalog.<region>.oci.oraclecloud.com:443 -Doracle.dcat.metastore.id=ocid1.datacatalogmetastore.oc1.<unique_ID>
  18. 「Restart」を選択して、ビッグ・データ・サービス・クラスタでSparkサービスを再起動します。