1。这几天mongodb经常重启,今天直接崩溃,再也起不来了。
错误信息:
./mongod &2018-08-16T10:03:06.975+0 800 E STORAGE [initandlisten] WiredTiger (11) [1534384986:970266][11744:0x7fbf2956fc80], evi ction-server: pthread_create: Resource temporarily unavailable
2018-08-16T10:03:06.979+0800 E STORAGE [initandlisten] WiredTiger (11) [1534384986:979817][1 1744:0x7fbf2956fc80], txn-recover: Recovery failed: Resource temporarily unavailable
2018-08-16T10:03:06.996+0800 I - [initandlisten] Assertion: 28595:11: Resource tempora rily unavailable
2018-08-16T10:03:07.008+0800 I STORAGE [initandlisten] exception in initAndListen: 28595 11: Resource temporarily unavailable, terminating
2018-08-16T10:03:07.010+0800 I CONTROL [initandlisten] dbexit: rc: 100
[2] 11773
[1] Exit 100 ./mongod
root@iZuf6egjg2v2grndob433aZ:/alidata/server/mongodb/bin# 2018-08-16T10:09:45.105+0800 I CONT ROL [initandlisten] MongoDB starting : pid=11773 port=27017 dbpath=/data/db 64-bit host=iZuf 6egjg2v2grndob433aZ
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] db version v3.2.8
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] git version: ed70e33130c977bda0024c12 5b56d159573dbaf0
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1 14 Mar 2012
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] allocator: tcmalloc
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] modules: none
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] build environment:
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] distmod: ubuntu1404
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] distarch: x86_64
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] target_arch: x86_64
2018-08-16T10:09:45.106+0800 I CONTROL [initandlisten] options: {}
2018-08-16T10:09:45.163+0800 I - [initandlisten] Detected data files in /data/db creat ed by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-08-16T10:09:45.164+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_ size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(e nabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000 ),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
root@iZuf6egjg2v2grndob433aZ:/alidata/server/mongodb/bin# 2018-08-16T10:10:00.609+0800 E STOR AGE [initandlisten] WiredTiger (11) [1534385400:602908][11773:0x7f1f9dab9c80], eviction-serv er: pthread_create: Resource temporarily unavailable
2018-08-16T10:10:00.613+0800 E STORAGE [initandlisten] WiredTiger (11) [1534385400:613902][1 1773:0x7f1f9dab9c80], txn-recover: Recovery failed: Resource temporarily unavailable
2018-08-16T10:10:00.631+0800 I - [initandlisten] Assertion: 28595:11: Resource tempora rily unavailable
2018-08-16T10:10:00.643+0800 I STORAGE [initandlisten] exception in initAndListen: 28595 11: Resource temporarily unavailable, terminating
2018-08-16T10:10:00.646+0800 I CONTROL [initandlisten] dbexit: rc: 100
网上讲删除.lockwe文件就好了,
再就是--repair 就好了。
还有chown权限的问题
2。最后还是最后还是删除storage.bson 就好了
从mongodb官网上看Storage Engines
The storage engine is the component of the database that is responsible for managing how data is stored, both in memory and on disk. MongoDB supports multiple storage engines, as different engines perform better for specific workloads. Choosing the appropriate storage engine for your use case can significantly impact the performance of your applications.
WiredTiger is the default storage engine starting in MongoDB 3.2. It is well-suited for most workloads and is recommended for new deployments. WiredTiger provides a document-level concurrency model, checkpointing, and compression, among other features. In MongoDB Enterprise, WiredTiger also supports Encryption at Rest.
MMAPv1 is the original MongoDB storage engine and is the default storage engine for MongoDB versions before 3.2. It performs well on workloads with high volumes of reads and writes, as well as in-place updates.
The In-Memory Storage Engine is available in MongoDB Enterprise. Rather than storing documents on-disk, it retains them in-memory for more predictable data latencies.