0

I have watched several videos on Youtube about this issue and none of them have worked. I know that I could not create mkdir -p /data/db because it will show me read-only due to Apple's system updates. You will find below what the terminal shows to me when I try to run a local server by using mongod. In the other hand, I can use mongo command and it works fine.

click here to see an image for the codes that appears when I use the mongod command

  • I'm having trouble seeing that image. In general, the first log line with 'E' tells you what's wrong – Joe Apr 09 '21 at 23:58
  • "ctx":"initandlisten","msg":"Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"Address already in use"}}} that what it said. – Abdallah Apr 10 '21 at 00:02
  • And there it is: "Address already in use" – Joe Apr 10 '21 at 00:03
  • 1
    "Address already in use" means the IP:port that it is trying to bind to is already in use by something else – Joe Apr 10 '21 at 00:05
  • So, what can I do? – Abdallah Apr 10 '21 at 00:05
  • figure out what that something else is – Joe Apr 10 '21 at 00:06
  • Is there a specific code that may help me to figure it out? – Abdallah Apr 10 '21 at 00:10
  • I have used sudo killall mongod. Then I wrote mongod command another timed where this message appear "s":"E", "c":"STORAGE", "id":20557, "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file."}} – Abdallah Apr 10 '21 at 00:16

0 Answers0