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,启动正常,

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

相关推荐
ghx_echo2 分钟前
linux系统下的磁盘扩容
linux·运维·服务器
hhzz33 分钟前
ansible自动化运维实战--script、unarchive和shell模块(6)
运维·自动化·ansible
幻想编织者38 分钟前
Ubuntu实时核编译安装与NVIDIA驱动安装教程(ubuntu 22.04,20.04)
linux·服务器·ubuntu·nvidia
利刃大大2 小时前
【Linux入门】2w字详解yum、vim、gcc/g++、gdb、makefile以及进度条小程序
linux·c语言·vim·makefile·gdb·gcc
阿狸的家2 小时前
ovs实现lb负载均衡
运维·云计算·负载均衡·ovs
乙己4077 小时前
计算机网络——网络层
运维·服务器·计算机网络
飞行的俊哥7 小时前
Linux 内核学习 3b - 和copilot 讨论pci设备的物理地址在内核空间和用户空间映射到虚拟地址的区别
linux·驱动开发·copilot
hunter2062069 小时前
ubuntu向一个pc主机通过web发送数据,pc端通过工具直接查看收到的数据
linux·前端·ubuntu
加酶洗衣粉9 小时前
MongoDB部署模式
数据库·mongodb
我要出家当道士9 小时前
MongoDB 备份与恢复综述
mongodb·数据库灾备