[SERVER-38237] MongoDb can't work without set dbpath command enabled Created: 25/Nov/18  Updated: 01/Feb/19  Resolved: 01/Feb/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.0.4
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: John Lemon [X] Assignee: Danny Hatcher (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

I upgraded my mongodb on ubuntu 16.04 from 3.6 to 4 and now I can't start my mongodb. Only if I run this command sudo mongod `--dbpath /var/lib/mongodb/ --journal` in separate tap and do not close my mongo works. Also I noticed this mongo does not use mongod.conf settings, because authorization is enabled but I still can log in without credentials. Every time when I am trying run mongo without dbpath, appears this error:

MongoDB shell version v4.0.4
connecting to: mongodb://127.0.0.1:27017
2018-11-25T19:12:20.240+0600 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed



 Comments   
Comment by Danny Hatcher (Inactive) [ 01/Feb/19 ]

Hello John,

We haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Thank you,

Danny

Comment by Danny Hatcher (Inactive) [ 26/Nov/18 ]

Hello John,

MongoDB will not use a configuration file unless you tell it to. From the command line, if you specify -f <config file> then it will use the specified file:

mongod -f ~/mongod.conf

I believe each of the problems you mention are a result of not using the correct config file. If you point the mongod at the right config, does everything work as expected?

Thank you,

Danny

Generated at Thu Feb 08 04:48:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.