Mongdb 启动警告记录,我在这个论坛上看到很多关于这些警告的问题,但是我想知道这些警告记录在哪里。我可以在 mongod.log 中找到它们。
有人可以分享这些警告日志的路径吗?
MongoDB server version: 3.4.1
Server has startup warnings:
2020-11-19T19:36:51.030-0800 I STORAGE [initandlisten]
2020-11-19T19:36:51.030-0800 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-11-19T19:36:51.030-0800 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten]
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** WARNING: The server is started with the web server interface and access control.
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** The web interfaces (rest, httpinterface and/or jsonp) are insecure
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** and should be disabled unless required for backward compatibility.
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten]
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten]
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten]
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 128538 processes, 500000 files. Number of processes should be at least 250000 : 0.5 times number of files.
2020-11-19T19:44:38.433-0800 I CONTROL [initandlisten]
mongo7052:SECONDARY>
MongoDB server version: 3.4.1
Server has startup warnings:
2021-02-19T00:04:24.384-0800 I CONTROL [main] ** WARNING: --rest is specified without --httpinterface,
2021-02-19T00:04:24.384-0800 I CONTROL [main] ** enabling http interface
2021-02-19T00:04:24.469-0800 I STORAGE [initandlisten]
2021-02-19T00:04:24.469-0800 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2021-02-19T00:04:24.469-0800 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2021-02-19T00:04:27.390-0800 I CONTROL [initandlisten]
2021-02-19T00:04:27.390-0800 I CONTROL [initandlisten] ** WARNING: The server is started with the web server interface and access control.
2021-02-19T00:04:27.390-0800 I CONTROL [initandlisten] ** The web interfaces (rest, httpinterface and/or jsonp) are insecure
2021-02-19T00:04:27.390-0800 I CONTROL [initandlisten] ** and should be disabled unless required for backward compatibility.
2021-02-19T00:04:27.390-0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2021-02-19T00:04:27.390-0800 I CONTROL [initandlisten]
2021-02-19T00:04:27.391-0800 I CONTROL [initandlisten]
2021-02-19T00:04:27.391-0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2021-02-19T00:04:27.391-0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2021-02-19T00:04:27.391-0800 I CONTROL [initandlisten]
shell 中显示的启动警告
mongo
是 MongoDB 服务器日志的摘录。在进程重新启动之前,这些警告不会改变,所以如果你在默认的 MongoDB 日志文件中找不到相应的条目,我希望日志文件在进程启动后已经轮换。根据您的环境配置,旧的日志文件通常会被重命名和压缩,因此您可能需要搜索不同的文件名或使用诸如
zgrep
搜索压缩文件之类的实用程序。show log startupWarnings
您可以通过或getLog
管理命令重新显示警告。