跳到主要内容
版本:0.17.0+

mongodb-bugfix

mongodb killed by OS

To avoid mongodb to be killed by the OS, we can set its memory use limit down to a criterion which is lower than the free -h capacity.

free -h
# total used free shared buff/cache available
# Mem: 3.7G 1.3G 665M 6.7M 1.7G 2.1G
# Swap: 0B 0B 0B

You see, there is only 665M for free in ZKJ's server since he is running a background jupyter and doing some sophisticated data analysis and machine learning.

then I can add this into mongodb's config file:

# /etc/mongodb.conf
wiredTiger:
engineConfig:
cacheSizeGB: 0.25

reference:

brew can't restart mongod

brew services stop -dv mongodb-community
brew services start -dv mongodb-community

Pay Attention to the parameter of -dv, it's key important.

Otherwise, I can't restart it!

reference: https://github.com/Homebrew/homebrew-core/issues/22924#issuecomment-357989567