3

mongodb was closed by some reason. system shutdown abnormally.

when i try to restart mongodb use:

mongod -f /usr/local/mongodb/etc/mongo.conf

got

about to fork child process, waiting until server is ready for connections.
forked process: 28402
ERROR: child process failed, exited with error number 51
To see additional information in this output, start without the "--fork" option.

mongodb.log:

2019-02-19T13:22:24.105+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] MongoDB starting :     pid=28131 port=27017 dbpath=/usr/local/mongodb/data/mongodata 64-bit     host=nginx.xchs
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] db version v3.6.2
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] git version:     489d177dbd0f0420a8ca04d39fd78d0a2c539420
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] OpenSSL version:         OpenSSL 1.0.1e-fips 11 Feb 2013
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] modules: none
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] build environment:
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten]     distmod: rhel62
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten]     distarch: x86_64
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten]     target_arch:     x86_64
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] options: { config:     "/usr/local/mongodb/etc/mongo.conf", net: { bindIp: "0.0.0.0" },     processManagement: { fork: true }, storage: { dbPath:     "/usr/local/mongodb/data/mongodata" }, systemLog: { destination: "file",     logAppend: true, path: "/usr/local/mongodb/data/log/mongolog/mongodb.log" } }
2019-02-19T13:22:24.112+0800 W -        [initandlisten] Detected unclean     shutdown - /usr/local/mongodb/data/mongodata/mongod.lock is not empty.
2019-02-19T13:22:24.113+0800 I -        [initandlisten] Detected data files     in /usr/local/mongodb/data/mongodata created by the 'wiredTiger' storage engine,     so setting the active storage engine to 'wiredTiger'.
2019-02-19T13:22:24.113+0800 W STORAGE  [initandlisten] Recovering data from     the last clean checkpoint.
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] 
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] ** WARNING: Using     the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] **          See     http://dochub.mongodb.org/core/prodnotes-filesystem
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] wiredtiger_open     config: create,cache_size=3424M,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-02-19T13:22:24.602+0800 E STORAGE  [initandlisten] WiredTiger error (0)     [1550553744:602025][28131:0x7f41a84cea80], file:WiredTiger.wt, WT_CURSOR.next: read checksum error for 24576B block at offset 1671168: block header checksum of 3727800471 doesn't match expected checksum of 605632
2019-02-19T13:22:24.602+0800 E STORAGE  [initandlisten] WiredTiger error (0) [1550553744:602085][28131:0x7f41a84cea80], file:WiredTiger.wt, WT_CURSOR.next: WiredTiger.wt: encountered an illegal file format or internal value: (__wt_block_read_off, 227)
2019-02-19T13:22:24.602+0800 E STORAGE  [initandlisten] WiredTiger error (-31804) [1550553744:602097][28131:0x7f41a84cea80], file:WiredTiger.wt, WT_CURSOR.next: the process must exit and restart: WT_PANIC: WiredTiger library panic
2019-02-19T13:22:24.602+0800 F -        [initandlisten] Fatal Assertion 28558 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 361
2019-02-19T13:22:24.602+0800 F -        [initandlisten] 

***aborting after fassert() failure

how to resolve this problem?

1

2 Answers 2

1

Open your config file in VIM or in a plain text editor, got to this line:

storage: dbPath: THE_PATH_TO_THE_DIRECTORY_YOU_STORE_YOUR_DB

for example:

/var/mongodb/db/mydb

Go to your terminal to confirm if the path under dbPath exists, type:

ls THE_PATH_TO_THE_DIRECTORY_YOU_STORE_YOUR_DB

for example for my case here:

ls /var/mongodb/db/mydb

If the result is directory does not exist, then just recreate it:

mkdir -p THE_PATH_TO_THE_DIRECTORY_YOU_STORE_YOUR_DB

for example:

mkdir -p /var/mongodb/db/mydb

If you found that the directory exists then it was corrupted during shutdown,as highlighted in the answere above.

Go to your terminal and run the following command:

mongod --dbpath /data/db --repair

Please Refer the above from the Mongo DB Offcial Docs

Sign up to request clarification or add additional context in comments.

Comments

0

Please Try

mongod --repair --dbpath /path/to/data/db

1 Comment

It doesn't work for me. Got the same log as mongodb.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.