gpt4 book ai didi

MongoDB 停止未知原因

转载 作者:行者123 更新时间:2023-12-04 18:30:05 24 4
gpt4 key购买 nike

我在 Ubuntu 14.04.4 上设置了 MongoDB 服务器有时它会停止不明原因。你有什么想法吗?

你可以看到我启动mongod实例之前和之后的最后日志。

2016-10-12T08:47:32.223+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-10-12T08:47:32.222+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
2016-10-12T08:47:31.727+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-10-12T08:47:31.727+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
2016-10-12T08:47:31.727+0000 W - [initandlisten] Detected unclean shutdown - /var/lib/mongodb/mongod.lock is not empty.
2016-10-12T08:47:31.727+0000 I - [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1,server_ip", port: 27017 }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] distarch: x86_64
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] build environment:
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] modules: none
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] git version: 79d9b3ab5ce20f51c272b4411202710a082d0317
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] db version v3.2.10
2016-10-12T08:47:31.700+0000 I CONTROL [initandlisten] MongoDB starting : pid=4487 port=27017 dbpath=/var/lib/mongodb 64-bit host=db-server
2016-10-11T06:54:31.233+0000 I ACCESS [conn1] Successfully authenticated as principal agent on admin
2016-10-11T06:54:29.641+0000 I ACCESS [conn6] Successfully authenticated as principal agent on admin

Note: I was not change anything on config file except bind Ip.

更新

当我查看系统日志文件时;

Oct 11 02:54:38 db-server kernel: [] Out of memory: Kill process 26603 (mongod) score 687 or sacrifice child
Oct 11 02:54:38 db-server kernel: [] init: mongod main process (26603) killed by KILL signal

最佳答案

看起来您的 mongo 进程已被 Linux 内存不足 killer 杀死。这通常发生在您的机器内存不足并且需要杀死某些东西以防止操作系统崩溃时。

您可以就如何操作给它一些指导。您可以查看这篇文章以获取一些建议:

OOM Killer

或者,您可以尝试在较少的内存中运行 Mongo,但 Mongo 可能难以配置以限制内存使用。这里有一些指导:

Easy Steps to Limit Mongodb Memory Usage

可能是您的机器上没有足够的 RAM 来运行 mongo - 您的 Ubuntu 服务器上有多少内存?

关于MongoDB 停止未知原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39994553/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com