簡體   English   中英

Docker MongoDB 無法啟動“不允許操作”

[英]Docker MongoDB won't start "Operation not permitted"

我有一台 VM 機器,我在其中安裝了一個 NFS 文件夾,其中放置了我的 docker 數據,我像這樣安裝它:

path: "/var/docker_data", source: "10.10.0.19:/data/docker", fs: nfs, opts: "rw,sync"

我像這樣導出 NFS:

/data *(rw,sync,no_subtree_check,all_squash,anonuid=0,anongid=0)

現在在我的 docker 主機上,我嘗試使用以下 docker-compose 啟動 mongodb(我嘗試了最新但其他版本):

services:
  mongo:
    image: mongo:latest
    container_name: mongodb
    user: "root:root"
    networks:
      proxy:
    restart: always
    volumes:
      - /var/docker_data/mongodb:/data/db"
    labels:
      - "traefik.enable=false"
networks:
  proxy:
    external: true

我也嘗試過不指定用戶並刪除所有數據並讓它從頭開始創建,但不管是什么相同的問題。

我得到Operation not permitted

"t":{"$date":"2021-05-07T11:36:11.459+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2021-05-07T11:36:11.464+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2021-05-07T11:36:11.464+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2021-05-07T11:36:11.465+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"b7b5f8f21532"}}
{"t":{"$date":"2021-05-07T11:36:11.465+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.5","gitVersion":"ff5cb77101b052fa02da43b8538093486cf9b3f7","openSSLVersion":"OpenSSL 1.1.1  11 Sep 2018","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu1804","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2021-05-07T11:36:11.465+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"18.04"}}}
{"t":{"$date":"2021-05-07T11:36:11.465+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"}}}}
{"t":{"$date":"2021-05-07T11:36:11.499+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=7508M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
{"t":{"$date":"2021-05-07T11:36:12.166+00:00"},"s":"E",  "c":"STORAGE",  "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error","attr":{"error":1,"message":"[1620387372:166497][1:0x7f689190dac0], connection: __posix_open_file, 808: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted"}}
{"t":{"$date":"2021-05-07T11:36:12.220+00:00"},"s":"E",  "c":"STORAGE",  "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error","attr":{"error":17,"message":"[1620387372:220645][1:0x7f689190dac0], connection: __posix_open_file, 808: /data/db/WiredTiger.wt: handle-open: open: File exists"}}
{"t":{"$date":"2021-05-07T11:36:12.232+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.1"}}
{"t":{"$date":"2021-05-07T11:36:12.250+00:00"},"s":"E",  "c":"STORAGE",  "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error","attr":{"error":1,"message":"[1620387372:250121][1:0x7f689190dac0], connection: __posix_open_file, 808: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted"}}
{"t":{"$date":"2021-05-07T11:36:12.267+00:00"},"s":"E",  "c":"STORAGE",  "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error","attr":{"error":17,"message":"[1620387372:267753][1:0x7f689190dac0], connection: __posix_open_file, 808: /data/db/WiredTiger.wt: handle-open: open: File exists"}}
{"t":{"$date":"2021-05-07T11:36:12.274+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.2"}}
{"t":{"$date":"2021-05-07T11:36:12.299+00:00"},"s":"E",  "c":"STORAGE",  "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error","attr":{"error":1,"message":"[1620387372:299167][1:0x7f689190dac0], connection: __posix_open_file, 808: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted"}}
{"t":{"$date":"2021-05-07T11:36:12.301+00:00"},"s":"W",  "c":"STORAGE",  "id":22347,   "ctx":"initandlisten","msg":"Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade."}
{"t":{"$date":"2021-05-07T11:36:12.301+00:00"},"s":"F",  "c":"STORAGE",  "id":28595,   "ctx":"initandlisten","msg":"Terminating.","attr":{"reason":"1: Operation not permitted"}}
{"t":{"$date":"2021-05-07T11:36:12.301+00:00"},"s":"F",  "c":"-",        "id":23091,   "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":28595,"file":"src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp","line":947}}
{"t":{"$date":"2021-05-07T11:36:12.301+00:00"},"s":"F",  "c":"-",        "id":23092,   "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}

在 top_level 上創建另一個volumes屬性來聲明您的卷:

version: "3.8"
services:
  database:
    image: mongo:5.0
    container_name: mongodb
    environment:
      - MONGO_INITDB_ROOT_USERNAME=admin
      - MONGO_INITDB_ROOT_PASSWORD=admin
    volumes:
      - mongo_data:/data/db
    ports:
      - 27017:27017

volumes:
  mongo_data:

https://docs.docker.com/storage/volumes/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM