Problem analysis of mongodb crash error too many open files
during the actual use of the project, the customer reported that he could open the web page but could not log in. He felt that the database server should hang up for the first time, so he checked the mongodb database server log, and sure enough, it hung up. The error information is as follows:
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
Cause of problem:
The number of open files on the system has reached the maximum
The reason for the above problem is that Centos7 gives each user a default number of files to open at the same time of 1024, which can be checked with the ulitme -u command
Problem solving:
1. Modify the limits.conf default parameters and add the following under the file.
* soft nofile 65536
* hard nofile 65536
PS: After saving as above, you need to reboot the system to take effect permanently
2, dynamic modification (no need to restart the system and mongo)
2.1, check the mongodb service pid file
ps aux | grep mongo
2.2、After getting the pid file, check the corresponding pid limits, the following command
cat /proc/95051/limits
2.3、Run the following command to achieve dynamic changes
prlimit --pid 95051 --nofile=65535:65535
2.4. Check again, the modification is successful
proposal
It is recommended that new servers first change the system default parameters
Read More:
- VS Open the UI file of QT Crash and Report Error [How to Solve]
- [Solved] MongoDB Error: FaileError: dToParse: Password must be URL Encoded for mongodb:// URL:
- [Solved] fatal error C1083: Cannot open included files: “stdafx.h”: No such file or directory
- [Solved] ES Query SIZE too large Error: ENTITY CONTENT IS TOO LONG [105539255] FOR THE CONFIGURED BUFFER LIMIT [104857600]
- [Solved] ELK Log System Error: “statusCode“:429,“error“:“Too Many Requests“,“message“ Data too large
- Mongodb error: authentication failed [How to Solve]
- Android 10 SurfaceView Crash: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
- [Solved] MongoDB Update User Error: Error: not authorized on admin to execute command
- [Solved] ERROR OGG-01028 Detect partial pdata at rba xxxxxx without coinciding crash recovery marker record
- [Solved] MongoDB Error: TypeError: Object of type ObjectId is not JSON serializable
- Android studio can’t start, running error: warning: crash service did not start
- Robo3T Remote Connect MongoDB Error: Failed to refresh ‘Collections‘. Error: ListCollections failed
- How to Solve SpringBoot MongoDB MongoAutoConfiguration Startup Error
- [Solved] Faceswap Error: CRITICAL An unexpected crash has occurred.You MUST provide this file if seeking assistan
- [Solved] Springboot Connect MongoDB Error: UncategorizedMongoDbException: Command failed with error 13 (Unauthorized)
- [Solved] Verdi Crash Error: ICE default IO error handler doing an exit(), pid = 3475, errno = 32
- [Solved] Mac Install mongodb error: NonExistentPath: Data directory /data/db not found.
- [Solved] mongodb Install Error: mongod: error while loading shared libraries
- [Solved] mongodb Startup Error: ERROR: child process failed, exited with error number 14
- [Solved] fatal error C1083: Could Not Open Unable to open include file:“stdint.h”: No such file or directory