I'm trying to setup the config servers for mongodb sharding. I created a specific config file that is set to log to /var/log/mongodb/mongod-config.log
.
When I run mongod --config <path-to-config-file>
, I get this error:
`F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open
"/var/log/mongodb/mongod-config.log"`
When I run the same command but with sudo
, it runs but there's no output.
But then when I try starting the mongo shell at the port (27019) specified by my config file, I get this:
MongoDB shell version v3.6.4
connecting to: mongodb://127.0.0.1:27019/test
2018-05-01T03:13:13.399+0000 W NETWORK [thread1] Failed to connect to
127.0.0.1:27019, in(checking socket for error after poll), reason: Connection
refused
2018-05-01T03:13:13.400+0000 E QUERY [thread1] Error: couldn't connect to
server 127.0.0.1:27019, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
I'm just following the MongoDB sharding documentation
I've seen some of the previous posts on here and one was the same problem. No solution there, but I want to try again and see if anybody has a solution to this.
Not sure if I missed something or what the issue is...