Mongodb start failed
mongo_1 | 2016-02-25T10:40:00.658+0000 I CONTROL [initandlisten] MongoDB starting : pid=7 port=27017 dbpath=/var/lib/mongodb 64-bit host=8ae2074f84da mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] db version v3.2.3 mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937 mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] allocator: system mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] modules: none mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] build environment: mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] distarch: x86_64 mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] target_arch: x86_64 mongo_1 | 2016-02-25T10:40:00.663+0000 I CONTROL [initandlisten] options: { config: "/etc/mongodb.conf", net: { http: { enabled: false } }, storage: { dbPath: "/var/lib/mongodb", mmapv1: { preallocDataFiles: false, smallFiles: true } } } mongo_1 | 2016-02-25T10:40:00.752+0000 I - [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. mongo_1 | 2016-02-25T10:40:00.752+0000 W - [initandlisten] Detected unclean shutdown - /var/lib/mongodb/mongod.lock is not empty. mongo_1 | 2016-02-25T10:40:00.752+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint. mongo_1 | 2016-02-25T10:40:00.753+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), mongo_1 | 2016-02-25T10:40:02.992+0000 I STORAGE [initandlisten] dropping unused ident: collection-2--3658185868592342520 mongo_1 | 2016-02-25T10:40:02.992+0000 E STORAGE [initandlisten] WiredTiger (22) [1456396802:992568][7:0x7fba0654f808], WT_SESSION.drop: unknown configuration key: 'lock_wait': Invalid argument mongo_1 | 2016-02-25T10:40:02.992+0000 I - [initandlisten] Invariant failure: ret resulted in status BadValue: 22: Invalid argument at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 553 mongo_1 | 2016-02-25T10:40:02.992+0000 I CONTROL [initandlisten] This platform does not support printing stacktraces mongo_1 | 2016-02-25T10:40:02.992+0000 I - [initandlisten] mongo_1 | mongo_1 | ***aborting after invariant() failure
Here is my dockerfile:
FROM alpine:edge
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --update \
mongodb@testing
WORKDIR /tmp
RUN mkdir -p /var/lib/mongodb
ADD mongodb.conf /etc/mongodb.conf
EXPOSE 27017
CMD /usr/bin/mongod --config /etc/mongodb.conf
and conf file:
- mongodb.conf
- Where to store the data.
- Note: if you run mongodb as a non-root user (recommended) you may
- need to create and set permissions for this directory manually,
- e.g., if the parent directory isn’t mutable by the mongodb user.
dbpath=/var/lib/mongodb
#where to log
#logpath=/var/log/mongodb/mongodb.log
#logappend=true
#port = 27017
- Disables write-ahead journaling
- nojournal = true
- Enables periodic logging of CPU utilization and I/O wait
#cpu = true
- Turn on/off security. Off is currently the default
#noauth = true
#auth = true
- Verbose logging output.
#verbose = true
- Inspect all client data for validity on receipt (useful for
- developing drivers)
#objcheck = true
- Enable db quota management
#quota = true
- Set oplogging level where n is
- 0=off (default)
- 1=W
- 2=R
- 3=both
- 7=W+some reads
#diaglog = 0
- Ignore query hints
#nohints = true
- Disable the HTTP interface (Defaults to localhost:28017).
nohttpinterface = true
- Turns off server-side scripting. This will result in greatly limited
- functionality
#noscripting = true
- Turns off table scans. Any query that would do a table scan fails.
#notablescan = true
- Disable data file preallocation.
noprealloc = true
smallfiles = true
- Specify .ns file size for new databases.
- nssize =
- Accout token for Mongo monitoring server.
#mms-token =
- Server name for Mongo monitoring server.
#mms-name =
- Ping interval for Mongo monitoring server.
#mms-interval =
- Replication Options
- in master/slave replicated mongo databases, specify here whether
- this is a slave or master
#slave = true
#source = master.example.com - Slave only: specify a single database to replicate
#only = master.example.com - or
#master = true
#source = slave.example.com
- in replica set configuration, specify the name of the replica set
- replSet = setname
In some cases it starts after several tries (tried at different machines), but never works after the first start.
(from redmine: issue id 5188, created on 2016-02-25, closed on 2017-05-19)