使用mongo与docker和nfs存储

时间:2017-02-26 09:55:04

标签: mongodb docker docker-volume

当我使用:docker volume create...在Cent7上创建卷并将类型提供为nfs时,我有一个glusterfs可以正常工作,这是我用来创建卷的完整命令:

  

docker volume create --name sv1_mongovol1 --opt type = nfs --opt device =:/ root / gluster / mounts --opt o = addr = 172.23.180.79

如果我使用" alpine"以上音量效果很好。容器或类似的和挂载它,我触摸/创建的文件,写入删除存储,但当我启动mongo容器时,它失败。这就是我发布的方式:

  

docker run --privileged --rm -it -p 27017:27017 -v sv1_mongovol1:/ data / db --name mongodb mongo

这是错误日志

017-02-26T02:31:00.391+0000 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to lock file: /data/db/mongod.lock No locks available. Is a mongod instance already running?, terminating
2017-02-26T02:31:00.391+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-02-26T02:31:00.391+0000 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-02-26T02:31:00.391+0000 I CONTROL [initandlisten] now exiting
2017-02-26T02:31:00.391+0000 I CONTROL [initandlisten] shutting down with code:100

我也在这里发布: https://github.com/docker-library/mongo/issues/30

0 个答案:

没有答案