简体   繁体   中英

Mongodb on macOS Catalina still using /data/db, despite new path specified in config file

On mac Catalina, /data/db is no longer writeable, and so the new brew install of mongodb-community uses a new path, /usr/local/var/mongodb . I upgraded, following these instructions: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition and to confirm:

$ ls -al /usr/local/bin/mongod
lrwxr-xr-x  1 rkohr  admin  44 Feb  5 10:49 /usr/local/bin/mongod -> ../Cellar/mongodb-community/4.2.3/bin/mongod
$ cat /usr/local/etc/mongod.conf
systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1

But it seems that the config is being ignored since it is still trying to use the old /data/db path:

$ mongod
2020-02-05T10:55:42.210-0500 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] MongoDB starting : pid=1518 port=27017 dbpath=/data/db 64-bit host=Robs-MacBook-Pro.local
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] db version v4.2.3
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] allocator: system
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] modules: none
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] build environment:
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten]     distarch: x86_64
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten]     target_arch: x86_64
2020-02-05T10:55:42.215-0500 I  CONTROL  [initandlisten] options: {}
2020-02-05T10:55:42.216-0500 E  NETWORK  [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Permission denied
2020-02-05T10:55:42.216-0500 F  -        [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 683
2020-02-05T10:55:42.216-0500 F  -        [initandlisten] 

***aborting after fassert() failure

@RobKohr To make it works, you have to run following command:

mongod --config /usr/local/etc/mongod.conf

See: https://docs.mongodb.com/manual/reference/configuration-options/#use-the-configuration-file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM