【发布时间】:2021-10-22 13:39:49
【问题描述】:
我有一个测试 Flink 应用程序,我试图在连接到 Azure 存储的 Azure Kubernetes 上运行。在我的 Flink 应用程序中,我配置了以下配置:
Configuration cfg = new Configuration();
cfg.setString("fs.azure.account.key.<storage-account.blob.core.windows.net", "<access-key>");
FileSystem.initialize(cfg, null);
我还启用了如下检查点:
env.enableCheckpointing(10000);
env.getCheckpointConfig().enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup.DELETE_ON_CANCELLATION);
env.setStateBackend(new EmbeddedRocksDBStateBackend());
env.getCheckpointConfig().setCheckpointStorage("wasbs://<container>@<storage-account>.blob.core.windows.net/checkpoint/");
已在 Azure 门户上创建存储帐户。我在上面的代码中使用了访问密钥。
当我将应用程序部署到 Kubernetes 时,JobManager 会运行并在 Azure 存储容器中创建检查点文件夹,但是,块 blob 数据的大小始终为 0B。该应用程序也不断抛出此异常。
我得到的有趣错误是:
Caused by: org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.fs.azure.AzureException: No credentials found for account <storage-account>.blob.core.windows.net in the configuration, and its container <container> is not accessible using anonymous credentials. Please check if the container exists first. If it is not publicly available, you have to provide account credentials.
org.apache.flink.fs.azure.shaded.com.microsoft.azure.storage.StorageException: Public access is not permitted on this storage account
让我头疼的部分(除了跳蚤)是它确实创建了检查点文件夹和文件,并继续创建更多检查点。
此帐户不可公开访问,公司政策已限制启用公开访问。
我也尝试使用 flink-conf.yaml,这是我的示例:
state:backend: rocksdb
state.checkpoints.dir: wasbs://<container>@<storage-account>.blob.core.windows.net/checkpoint/
fs.azure.account.key.**flinkstorage**.blob.core.windows.net: <access-key>
fs.azure.account.key.<storage-account>.blob.core.windows.net: <access-key>
我尝试了上面的两个 account.key 选项。我也尝试过使用 wasb 协议。我还尝试在 Azure 存储上轮换访问密钥,结果都是相同的错误。
【问题讨论】:
-
你是否尝试在使用同一个 flink 应用程序时访问两个不同的存储帐户?
-
不,只有一个。
标签: azure storage apache-flink azure-aks