Centos7在安装Graylog时新安装MongoDB报错端口不监听服务不启动无法运行启动失败

由于虚拟机服务器上需要安装Graylog需要安装MongoDB,尝试官网下载安装包,和yum安装均无法正常启动,折腾了好几天,重装了十几次,网上搜索了很多很多资料,均无法正常运行,百度上搜索各种文档,又是检查SeLinux,又是检查磁盘空间,又是检查文件夹权限,又是检查配置文件里的端口号占用,检查数据目录的权限,各种检查,折腾好几天也没搞定,一个mongodb好几天启动 不起来,崩溃了。。。几天在graylog官网,mongodb官网上瞎逛,偶尔翻到官网有说cpu问题,就尝试更改了虚拟机的cpu配置,没想到改完之后,直接启动,正常,疯了······这里记录下,太惨了,留做记录。

如图所示:将CPU模式改为SandyBridge

原始启动报错显示:

2023-12-21T09:58:15.375+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten]
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten]
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten]
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten]
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2023-12-21T09:58:15.380+0800 I CONTROL  [initandlisten]
2023-12-21T09:58:15.382+0800 I SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
2023-12-21T09:58:15.384+0800 I SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
2023-12-21T09:58:15.384+0800 I SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
2023-12-21T09:58:15.386+0800 I SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
2023-12-21T09:58:15.386+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
2023-12-21T09:58:15.387+0800 I SHARDING [initandlisten] Marking collection config.system.sessions as collection version: <unsharded>
2023-12-21T09:58:15.389+0800 I NETWORK  [initandlisten] waiting for connections on port 27017
2023-12-21T09:58:15.389+0800 I SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
2023-12-21T09:58:15.391+0800 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2023-12-21T09:58:15.391+0800 I REPL     [signalProcessingThread] Stepping down the ReplicationCoordinator for shutdown, waitTime: 10000ms
2023-12-21T09:58:15.391+0800 I CONTROL  [signalProcessingThread] Shutting down the LogicalSessionCache
2023-12-21T09:58:15.391+0800 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2023-12-21T09:58:15.392+0800 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2023-12-21T09:58:15.392+0800 I NETWORK  [signalProcessingThread] Shutting down the global connection pool
2023-12-21T09:58:15.392+0800 I STORAGE  [signalProcessingThread] Shutting down the PeriodicThreadToAbortExpiredTransactions
2023-12-21T09:58:15.392+0800 I REPL     [signalProcessingThread] Shutting down the ReplicationCoordinator
2023-12-21T09:58:15.392+0800 I SHARDING [signalProcessingThread] Shutting down the ShardingInitializationMongoD
2023-12-21T09:58:15.392+0800 I COMMAND  [signalProcessingThread] Killing all open transactions
2023-12-21T09:58:15.392+0800 I -        [signalProcessingThread] Killing all operations for shutdown
2023-12-21T09:58:15.392+0800 I NETWORK  [signalProcessingThread] Shutting down the ReplicaSetMonitor
2023-12-21T09:58:15.392+0800 I CONTROL  [signalProcessingThread] Shutting down free monitoring
2023-12-21T09:58:15.392+0800 I CONTROL  [signalProcessingThread] Shutting down free monitoring
2023-12-21T09:58:15.392+0800 I FTDC     [signalProcessingThread] Shutting down full-time data capture
2023-12-21T09:58:15.392+0800 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2023-12-21T09:58:15.392+0800 I STORAGE  [signalProcessingThread] Shutting down the HealthLog
2023-12-21T09:58:15.392+0800 I STORAGE  [signalProcessingThread] Shutting down the storage engine
2023-12-21T09:58:15.392+0800 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2023-12-21T09:58:15.393+0800 I STORAGE  [signalProcessingThread] Shutting down session sweeper thread
2023-12-21T09:58:15.393+0800 I STORAGE  [signalProcessingThread] Finished shutting down session sweeper thread
2023-12-21T09:58:15.496+0800 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2023-12-21T09:58:15.496+0800 I -        [signalProcessingThread] Dropping the scope cache for shutdown
2023-12-21T09:58:15.496+0800 I CONTROL  [signalProcessingThread] now exiting
2023-12-21T09:58:15.496+0800 I CONTROL  [signalProcessingThread] shutting down with code:0

启动报错,日志上根本看不到任何问题,也显示不到具体报错,也通过chatgpt进行搜索,给出了如下的建议:

通过将cpu配置改为 SandyBridge重启服务器,重新启动mongodb,启动正常,

采坑好几天,疯了。。。再次崩溃!

相关推荐
朝九晚五ฺ1 小时前
【Linux探索学习】第十四弹——进程优先级:深入理解操作系统中的进程优先级
linux·运维·学习
自由的dream1 小时前
Linux的桌面
linux
xiaozhiwise1 小时前
Makefile 之 自动化变量
linux
Kkooe2 小时前
GitLab|数据迁移
运维·服务器·git
聂 可 以2 小时前
Windows环境安装MongoDB
数据库·mongodb
web前端神器2 小时前
mongodb多表查询,五个表查询
数据库·mongodb
wusong9992 小时前
mongoDB回顾笔记(一)
数据库·笔记·mongodb
真心喜欢你吖2 小时前
SpringBoot与MongoDB深度整合及应用案例
java·spring boot·后端·mongodb·spring
changuncle2 小时前
MongoDB数据备份与恢复(内含工具下载、数据处理以及常见问题解决方法)
数据库·mongodb