我想我的Windows機器上運行docker-compose
旋轉了的MongoDB實例和僅數據容器,其代理的連接量包含數據庫文件的。碼頭工人無法通過附着量開始MongoDB的數據,僅容器
mongodata:
image: mongo:2.6.8
volumes:
- ./data/db:/data/db
command: --break-mongo
mongo:
image: mongo:2.6.8
volumes_from:
- mongodata
ports:
- "27017:27017"
command: --smallfiles --rest
* p.s。在--break - 蒙戈命令是在有目的,它只是需要創建卷
據我瞭解,使用data-only
容積模式將處理權限問題,但蒙戈容器啓動過程中,我可以看到以下錯誤:
[0m2016-01-26T00:23:52.340+0000 [initandlisten] info preallocateIsFaster couldn't run due to: couldn't open file /data/db/journal/tempLatencyTest for writing errno:1 Operation not permitted; returning false
[0m2016-01-26T00:23:52.341+0000 [initandlisten] Unable to remove temporary file due to: boost::filesystem::remove: Text file busy: "/data/db/journal/tempLatencyTest"
[0m2016-01-26T00:23:52.344+0000 [initandlisten] exception in initAndListen: 13516 couldn't open file /data/db/journal/j._0 for writing errno:1 Operation not permitted, terminating
因此,我無法在本地機器上使用MongoDb和卷。有沒有解決這個問題的方法?
的'data'目錄是直接我'C下:\ users'目錄。我不確定我應該在哪裏設置權限。據我的理解,「data-only」卷'mongodata'應該給''mongo'容器的'/ data/db'路徑提供完全權限?如果不是,我怎麼知道'UID' /'GID'用於權限? – Ropstah
我接受它缺乏更好的答案。但我仍然無法運行附帶卷Mongo ... – Ropstah