无法在Azure容器实例中将Azure文件共享作为mongodb卷挂载 [英] Unable to mount azure file shares as mongodb volume in azure container instances

查看:158
本文介绍了无法在Azure容器实例中将Azure文件共享作为mongodb卷挂载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用azure容器实例设置mongo数据库实例,并将其安装在Azure文件共享上.

I am trying to set up a mongo DB instance using azure container instances and mounting the same on Azure file share.

我们收到以下错误:

[initandlisten] WiredTiger error (1) [1579245437:724939][1:0x7f9419c67b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1579245437:724939][1:0x7f9419c67b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
W  STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
F  STORAGE  [initandlisten] Reason: 1: Operation not permitted
F  -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 789
[initandlisten] 

***aborting after fassert() failure

AZ命令我正在使用以下命令来创建存储帐户,文件共享和容器实例:

AZ Commands I am using the following commands to create the storage account, file share, and container instance:

az storage account create -g $resourcegroup -n $storageaccount --sku Standard_LRS

az storage share create --name $mongofileshare --account-name $storageaccount

az container create --resource-group $resourcegroup --name $containername --image mongo:latest --dns-name-label $DNSName --ports 27017 --protocol TCP --environment-variables 'MONGO_INITDB_ROOT_USERNAME=admin' 'MONGO_INITDB_ROOT_PASSWORD=*******' --location westeurope --azure-file-volume-account-name $storageaccount --azure-file-volume-account-key '**********' --azure-file-volume-share-name 'mongofileshare' --azure-file-volume-mount-path '/data/db'

推荐答案

引起错误的原因是将Azure File Share装载到容器实例将覆盖安装点中的所有文件.警告显示在此处:

The reason that caused the error you got is that mount the Azure File Share to the container instance will cover all the files in the mount point. The caution is shown here:

将Azure文件共享安装到容器实例类似于 Docker绑定安装.请注意,如果您将共享装载到容器中 文件或目录所在的目录,这些文件或 目录被挂载遮挡,并且在 容器运行.

Mounting an Azure Files share to a container instance is similar to a Docker bind mount. Be aware that if you mount a share into a container directory in which files or directories exist, these files or directories are obscured by the mount and are not accessible while the container runs.

因此,不建议将Azure文件共享安装到现有目录,该目录包含用于初始化Mongo DB的文件.推荐目录类似于路径/var/logs/.

So it's not recommended to mount the Azure File Share to the existing directory which contains the files used to initialize the Mongo DB. The recommend directory will like path /var/logs/.

这篇关于无法在Azure容器实例中将Azure文件共享作为mongodb卷挂载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆