gpt4 book ai didi

Azure 容器和托管磁盘

转载 作者:行者123 更新时间:2023-12-03 02:59:39 25 4
gpt4 key购买 nike

假设我想使用 Azure 容器服务或 Azure 应用服务,通过 ASP.Net Core API 或/和 Web 应用挂载 docker 容器。

到目前为止,每个 API 都使用主机 VM (Linux/Win) 中的本地存储来存储其部分数据,并与其他 Azure 托管持久性服务并行使用。 SQL、Redis、文档数据库等都有充分的理由。

如果我使用 docker 容器作为应用程序,我可以为每个 API 的本地存储做些什么?我使用 SQLite、RocksDB、文档。

是否可以将 Azure 托管磁盘用于 Docker 卷?

它们的行为/性能与本地磁盘相同吗?例如SQLite 的文件锁定,速度。

否则,我应该继续进行虚拟机部署

最佳答案

The short answer to this is 'Yes' you can persist volumes in Azure Storage Accounts and access those files with other services.

现在,我通过 AKS(Azure Kubernetes 服务)使用 Azurefile 持久卷声明(“PVC”)来使我的服务卷可用,但我绝不是专家。

在我们的案例中,我们正在致力于将现有的容器化基础设施从 Docker Cloud(刚刚停用)迁移到 Azure AKS。即使我们所有容器都保持不变运行(尝试在 AKS 上运行,就像在 Docker Cloud 上运行一样),这也是一个相对较大的项目。对于您开发整个基础设施,我预计需要花费 1 周的时间来弄清楚细节。

入门资源:

  1. https://learn.microsoft.com/en-us/azure/aks/azure-files-dynamic-pv#create-storage-account

Caveat: I say short answer is 'Yes' since it will take some time to go from "I want to containerize this thing and store data in a persistent volume" to actually having the container up and running with the underlying infrastructure functioning as you describe.

速度

根据我的经验,从 Kubernetes 节点 (Azure VM) 文件系统上本地托管的持久卷迁移到存储帐户会给我的 Web 应用程序带来数百毫秒的延迟(总计),但我也没有尝试对其进行优化。

我们的加载时间从 1.3-1.4 秒缩短到 1.5-1.6 秒。

关于Azure 容器和托管磁盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50349142/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com