当我重新启动kubernetes舵图时,我想将数据保留在mongodb中,但是我不能,因为将数据库映射到主机路径时mongodb无法以以下错误开头(我正在运行)在docker桌面上):
2019-06-23T05:40:35.788+0000 I CONTROL [initandlisten] options: { config: "/opt/bitnami/mongodb/conf/mongodb.conf", net: { bindIpAll: true, ipv6: true, port: 27017, unixDomainSocket: { enabled: true, pathPrefix: "/opt/bitnami/mongodb/tmp" } }, processManagement: { fork: false, pidFilePath: "/opt/bitnami/mongodb/tmp/mongodb.pid" }, security: { authorization: "disabled" }, setParameter: { enableLocalhostAuthBypass: "true" }, storage: { dbPath: "/opt/bitnami/mongodb/data/db", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: true } }
2019-06-23T05:40:35.791+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=989M,session_max=20000,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),statistics_log=(wait=0),verbose=(recovery_progress),
2019-06-23T05:40:37.056+0000 E STORAGE [initandlisten] WiredTiger error (17) [1561268437:56536][36:0x7f8cc73279c0], connection: /opt/bitnami/mongodb/data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1561268437:56536][36:0x7f8cc73279c0], connection: /opt/bitnami/mongodb/data/db/WiredTiger.wt: handle-open: open: File exists
2019-06-23T05:40:37.063+0000 I STORAGE [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.6
2019-06-23T05:40:37.069+0000 E STORAGE [initandlisten] WiredTiger error (1) [1561268437:69980][36:0x7f8cc73279c0], connection: /opt/bitnami/mongodb/data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1561268437:69980][36:0x7f8cc73279c0], connection: /opt/bitnami/mongodb/data/db/WiredTiger.wt: handle-open: open: Operation not permitted
从与docker运行时解决方法是创建持久卷的意义上说,此错误为well known:
docker volume create --name=mongodata
然后将其安装在mongodb docker容器中。 (我相信根本原因是HyperV和VirtualBox不支持跨VM边界的内存映射文件。)
问题是,kubernetes没有用于docker卷的存储驱动程序(据我所知)。所以我需要另一个解决方案。有人有什么想法吗?我希望它具有足够的鲁棒性,使其能够在k8 / docker和我的机器关闭时幸免于难。
我正在Windows 10(由Hyper V支持)(v18.09.2)上最新的稳定docker桌面上运行。我正在使用随它一起提供的Kubernetes(v1.10.11)。