在 Azure 容器应用程序上挂载 Azure 文件共享

问题描述 投票:0回答:1

我有一个 Azure 文件共享,我想将其用作在 Azure 容器应用程序内运行的 Neo4j 数据库的装载。每次我创建容器的配置时,它都会失败并出现错误“VolumeMountFailure”,并且没有其他信息来了解出了什么问题。下面是一些情况的截图:

容器的挂载设置:

https://i.stack.imgur.com/qkS9Y.png

系统日志中的错误是什么样的:

https://i.stack.imgur.com/RZNEu.png

容器应用程序的 JSON 视图:

https://i.stack.imgur.com/HCQbV.png

我也尝试过使用脚本和命令,但大多数时候它只是说好的,然后没有保存设置?保存设置时崩溃。

azure neo4j containers docker-volume azure-container-apps
1个回答
0
投票

每次我创建容器的配置时,它都会失败,并显示错误“VolumeMountFailure”,并且没有其他信息来了解出了什么问题。

还有一种替代方法,只需考虑使用 Azure Blob 存储作为 Neo4j 数据库的持久存储。

准备Neo4j容器:

FROM neo4j:latest

# Set environment variables
ENV NEO4J_AUTH=neo4j/password
ENV NEO4J_dbms_directories_data=/data

# Expose Neo4j ports
EXPOSE 7474 7687
  • 使用以下脚本和特定配置创建 Azure 容器应用程序,包括将 Azure Blob 存储安装为容器化应用程序的卷。
az container create \
    --resource-group <resource_group_name> \
    --name <container_name> \
    --image skillseekercontainerregistry.azurecr.io/neo4j:latest \
    --azure-blob-volume-account-name <storage_account_name> \
    --azure-blob-volume-container-name <blob_container_name> \
    --azure-blob-volume-account-key <storage_account_key> \
    --azure-blob-volume-mount-path /data \
    --cpu 1 \
    --memory 2Gi \
    --registry-login-server skillseekercontainerregistry.azurecr.io \
    --registry-username <registry_username> \
    --registry-password <registry_password>
  • 指示 Azure Blob 存储卷已成功挂载到容器中的日志。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.