時間:2024-02-07 12:09作者:下載吧人氣:24
在項目實際使用過程中,客戶反饋能打開網頁但無法登陸,第一時間感覺到應該是數據庫服務器掛了,于是查看Mongodb數據庫服務器日志,果不其然掛了。
報錯信息如下:
2020-12-28T13:21:21.731+0800 E STORAGE [conn2624] WiredTiger error (24) [1609132881:731422][23581:0x7fe157189700], WT_SESSION.create: __posix_directory_sync, 135: /data1/mongodb/data/db/: directory-sync: open: Too many open files Raw: [1609132881:731422][23581:0x7fe157189700], WT_SESSION.create: __posix_directory_sync, 135: /data1/mongodb/data/db/: directory-sync: open: Too many open files
2020-12-28T13:21:21.731+0800 E STORAGE [conn2624] WiredTiger error (24) [1609132881:731616][23581:0x7fe157189700], WT_SESSION.create: __posix_directory_sync, 151: /data1/mongodb/data/db/collection-1063-1706476241051221735.wt: directory-sync: Too many open files Raw: [1609132881:731616][23581:0x7fe157189700], WT_SESSION.create: __posix_directory_sync, 151: /data1/mongodb/data/db/collection-1063-1706476241051221735.wt: directory-sync: Too many open files
2020-12-28T13:21:21.731+0800 E STORAGE [conn2624] WiredTiger error (-31804) [1609132881:731651][23581:0x7fe157189700], WT_SESSION.create: __wt_panic, 494: the process must exit and restart: WT_PANIC: WiredTiger library panic Raw: [1609132881:731651][23581:0x7fe157189700], WT_SESSION.create: __wt_panic, 494: the process must exit and restart: WT_PANIC: WiredTiger library panic
2020-12-28T13:21:21.731+0800 F – [conn2624] Fatal Assertion 50853 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 420
2020-12-28T13:21:21.731+0800 F – [conn2624]***aborting after fassert() failure
可以看到核心問題就是 Too many open files。經查閱相關資料,造成如下問題的原因就是Centos7給每個用戶默認的同時打開文件的數值為1024,可通過如下配置文件查看:
ulimit -a
其中所有的參數均可修改,那么如何修改open files呢?
在此提供兩種方法:
首先查看系統全局參數:
所以我們可以修改的最大值也是174198
具體修改方法一:
新建一個nofile.conf文件:
vi /etc/security/limits.d/nofile.conf
網友評論