使用 Yay 安装 MongoDB 并在配置文件中瞬间踩坑
你好,我是无能。
MongoDB只需按以下最低要求安装即可。我尝试了其他软件包,但编译失败了,所以为了省事,我安装了最小环境。
yay -S mongodb-bin
然后,
我修改了配置文件后它就不工作了,我当时很困惑,所以写下这篇备忘录。
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1, 192.168.10.xxx
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
pidFilePath: /var/run/mongodb/mongod.pid
security:
authorization: disabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
我将其设置为 authorization: disabled 作为临时测试环境,但请务必不要这样做。
在设置 pidFilePath 时,我踩了两次坑。
不能是 PidFilePath 等,必须是 “pidFilePath” 这样。
唉,如果这样的话,一开始就应该全部设置为小写字母啊...