就在剛才,兩刻鐘之前,我需要更新我伺服器裡的MongoDB中的數據,我本地測試機用mongodump方法導出了測試用的哦數據。在伺服器上用mongorestore的方法想把資料導進去,但是我給報錯了(具體報什麼錯我現在也沒辦法講了,因為mongod跑不起來了),然後我就
sudo pkill mongod
然後我把我本地的庫檔案(dbpath下面的那兩個檔案)直接拷貝到服務的dbpath裡面了。我按照平常的方式啟動,但是 報錯啦! ! ! ! ! !
然後我換指定dbpath的方式啟動,還是報錯! ! ! ! ! !
這時候我就開始後悔了,至少剛才mongod還在跑的,現在都不工作了。
報錯的提示,看了一下沒怎麼看懂。坐等大神提示了,現在只有~~~~
伺服器我不敢重啟,因為裡面跑了多少東西我到現在還沒摸清楚(以前是倆人在管理伺服器,後來他走了,很多事情沒交代清楚)! ! ! !
以後我再也不敢這樣沒仔細測試就更新伺服器的東西了,最近沒有手動升級過東西,最近安裝的軟體也之後tree。
伺服器環境:aliyun ubuntu12.4 LTS MongoDB shell version: 2.4.9
sudo mongod --dbpath=./ --logpath=./mongod.log
Fri Jul 11 22:49:42.436 terminate() called, printing stack (if implemented for platform):
0xde46e1 0x6cf54e 0x7fc0a07a1846 0x7fc0a07a1873 0x7fc0a07a196e 0x7fc0a074ea07 0x7fc0a075e284fc 0xe0288b 0xdff530 0x9f257f 0x6dd820 0x6df5c9 0x7fc09fe3b76d 0x6cf339
mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde46e1]
mongod(_ZN5mongo11myterminateEv+0x3e) [0x6cf54e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5846) [0x7fc0a07a1846]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5873) [0x7fc0a07a1873]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb596e) [0x7fc0a07a196e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt21__throw_runtime_errorPKc+0x57) [0x7fc0a074ea07]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x72284) [0x7fc0a075e284]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6locale5_ImplC1EPKcm+0x44) [0x7fc0a0752a74]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6localeC1EPKc+0x73b) [0x7fc0a0753b6b]
mongod(_ZN5boost11filesystem34path21wchar_t_codecvt_facetEv+0x4f) [0xe01f3f]
mongod(_ZNK5boost11filesystem34path14root_directoryEv+0xbb) [0xe0288b]
mongod(_ZN5boost11filesystem38absoluteERKNS0_4pathES3_+0x40) [0xdff530]
mongod(_ZN5mongo27initializeServerGlobalStateEb+0x15f) [0x9f257f]
mongod() [0x6dd820]
mongod(main+0x9) [0x6df5c9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fc09fe3b76d]
mongod(__gxx_personality_v0+0x499) [0x6cf339]
Fri Jul 11 22:49:42.441 Got signal: 6 (Aborted).
Fri Jul 11 22:49:42.444 Backtrace:
0xde46e1 0x6d06c9 0x7fc09fe504a0 0x7fc09fe50425 0x7fc09fe53b8b 0x6cf553 0x7fc0a07a1846 0x7fc0a07a1873x fc0a075e284 0x7fc0a0752a74 0x7fc0a0753b6b 0xe01f3f 0xe0288b 0xdff530 0x9f257f 0x6dd820 0x6dfc9 0x769 30x
mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde46e1]
mongod(_ZN5mongo10abruptQuitEi+0x399) [0x6d06c9]
/lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7fc09fe504a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7fc09fe50425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7fc09fe53b8b]
mongod(_ZN5mongo11myterminateEv+0x43) [0x6cf553]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5846) [0x7fc0a07a1846]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5873) [0x7fc0a07a1873]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb596e) [0x7fc0a07a196e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt21__throw_runtime_errorPKc+0x57) [0x7fc0a074ea07]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x72284) [0x7fc0a075e284]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6locale5_ImplC1EPKcm+0x44) [0x7fc0a0752a74]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6localeC1EPKc+0x73b) [0x7fc0a0753b6b]
mongod(_ZN5boost11filesystem34path21wchar_t_codecvt_facetEv+0x4f) [0xe01f3f]
mongod(_ZNK5boost11filesystem34path14root_directoryEv+0xbb) [0xe0288b]
mongod(_ZN5boost11filesystem38absoluteERKNS0_4pathES3_+0x40) [0xdff530]
mongod(_ZN5mongo27initializeServerGlobalStateEb+0x15f) [0x9f257f]
mongod() [0x6dd820]
mongod(main+0x9) [0x6df5c9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fc09fe3b76d]
antown@AY1403171442351355f0Z:/atdata/MongoDB_datas$ htop
antown@AY1403171442351355f0Z:/atdata/MongoDB_datas$
antown@AY1403171442351355f0Z:/atdata/MongoDB_datas$ ls
antown@AY1403171442351355f0Z:/atdata/MongoDB_datas$ mongo
mongo mongodump mongofiles mongooplog mongorestore mongostat
mongod mongoexport mongoimport mongoperf mongos mongotop
antown@AY1403171442351355f0Z:/atdata/MongoDB_datas$ sudo mongod --dbpath=./ --logpath=./mongod.log
Fri Jul 11 22:51:34.626 terminate() called, printing stack (if implemented for platform):
0xde46e1 0x6cf54e 0x7f169036f846 0x7f169036f873 0x7f169036f96e 0x7f169031ca07 0x7f169032c284 03x e01f3f 0xe0288b 0xdff530 0x9f257f 0x6dd820 0x6df5c9 0x7f168fa0976d 0x6cf339
mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde46e1]
mongod(_ZN5mongo11myterminateEv+0x3e) [0x6cf54e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5846) [0x7f169036f846]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5873) [0x7f169036f873]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb596e) [0x7f169036f96e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt21__throw_runtime_errorPKc+0x57) [0x7f169031ca07]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x72284) [0x7f169032c284]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6locale5_ImplC1EPKcm+0x44) [0x7f1690320a74]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6localeC1EPKc+0x73b) [0x7f1690321b6b]
mongod(_ZN5boost11filesystem34path21wchar_t_codecvt_facetEv+0x4f) [0xe01f3f]
mongod(_ZNK5boost11filesystem34path14root_directoryEv+0xbb) [0xe0288b]
mongod(_ZN5boost11filesystem38absoluteERKNS0_4pathES3_+0x40) [0xdff530]
mongod(_ZN5mongo27initializeServerGlobalStateEb+0x15f) [0x9f257f]
mongod() [0x6dd820]
mongod(main+0x9) [0x6df5c9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f168fa0976d]
mongod(__gxx_personality_v0+0x499) [0x6cf339]
Fri Jul 11 22:51:34.630 Got signal: 6 (Aborted).
Fri Jul 11 22:51:34.633 Backtrace:
0xde46e1 0x6d06c9 0x7f168fa1e4a0 0x7f168fa1e425 0x7f168fa21b8b 0x6cf553 0x7f169036f846 0x7f19036fx ca07 0x7f169032c284 0x7f1690320a74 0x7f1690321b6b 0xe01f3f 0xe0288b 0xdff530 0x9f257f 0xe0288b 0xdff530 0x9f257f 0x6820 9
mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde46e1]
mongod(_ZN5mongo10abruptQuitEi+0x399) [0x6d06c9]
/lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7f168fa1e4a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f168fa1e425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7f168fa21b8b]
mongod(_ZN5mongo11myterminateEv+0x43) [0x6cf553]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5846) [0x7f169036f846]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5873) [0x7f169036f873]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb596e) [0x7f169036f96e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt21__throw_runtime_errorPKc+0x57) [0x7f169031ca07]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x72284) [0x7f169032c284]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6locale5_ImplC1EPKcm+0x44) [0x7f1690320a74]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6localeC1EPKc+0x73b) [0x7f1690321b6b]
mongod(_ZN5boost11filesystem34path21wchar_t_codecvt_facetEv+0x4f) [0xe01f3f]
mongod(_ZNK5boost11filesystem34path14root_directoryEv+0xbb) [0xe0288b]
mongod(_ZN5boost11filesystem38absoluteERKNS0_4pathES3_+0x40) [0xdff530]
mongod(_ZN5mongo27initializeServerGlobalStateEb+0x15f) [0x9f257f]
mongod() [0x6dd820]
mongod(main+0x9) [0x6df5c9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f168fa0976d]
黄舟2017-04-24 09:13:15
從這個堆疊來看,很有可能是你沒有設定正確的 locale,引發了 mongodb 的 bug。
詳見這個 bug 記錄:https://jira.mongodb.org/browse/SERVER-9032 你可以像 bug 裡面說的一樣嘗試在 .bashrc
裡設定正確的 locale 試試。
看你的操作步驟不像能把 mongod 弄壞的樣子,正常關閉 mongod 本來就是用 kill,mongorestore 也不至於弄壞數據,所以應該問題不大。