【发布时间】:2021-03-05 03:23:16
【问题描述】:
我想创建一个可以访问 ADLSg1 和 ADLSg2 数据湖的 Azure HDI 集群。支持吗?
【问题讨论】:
标签: azure-data-lake azure-hdinsight azure-data-lake-gen2
我想创建一个可以访问 ADLSg1 和 ADLSg2 数据湖的 Azure HDI 集群。支持吗?
【问题讨论】:
标签: azure-data-lake azure-hdinsight azure-data-lake-gen2
这对于 Spark 2.4 (HDI 4.0) 是可能的,但有限制:
core-site.xml 配置。步骤:
对于 ADLS Gen 1:
fs.adl.oauth2.access.token.provider.type = ClientCredential
fs.adl.oauth2.client.id = <ADLSg1 Application ID>
fs.adl.oauth2.credential = <ADLSg1 Client Secret>
fs.adl.oauth2.refresh.url = https://login.microsoftonline.com/<Tenant ID>/oauth2/token
对于 ADLS Gen 2:
fs.azure.account.auth.type.<ADLSg2 storage account name>.dfs.core.windows.net = OAuth
fs.azure.account.oauth.provider.type.<ADLSg2 storage account name>.dfs.core.windows.net = org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider
fs.azure.account.oauth2.client.id.<ADLSg2 storage account name>.dfs.core.windows.net = <ADLSg2 Application ID>
fs.azure.account.oauth2.client.secret.<ADLSg2 storage account name>.dfs.core.windows.net = <ADLSg1 Client Secret>
fs.azure.account.oauth2.client.endpoint.<ADLSg2 storage account name>.dfs.core.windows.net = https://login.microsoftonline.com/<Tenant ID>/oauth2/token
从集群访问文件:
使用完全限定名称。使用这种方法,您可以提供要访问的文件的完整路径。
adl://<data_lake_account>.azuredatalakestore.net/<cluster_root_path>/<file_path>
abfs://<containername>@<accountname>.dfs.core.windows.net/<file.path>/
【讨论】: