使用Yay安裝MongoDB並在設定檔中短暫卡關

2 min

language: ja bn en es hi pt ru zh-cn zh-tw

大家好,我是無能。

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” 這樣。
如果真是這樣,我希望從一開始就能設定成全部小寫的・・・。